builder/vm: stabilize json_lint_vm under unified calls

- Fix condition_fn resolution: Value call path + dev safety + stub injection
- VM bridge: handle Method::birth via BoxCall; ArrayBox push/get/length/set direct bridge
- Receiver safety: pin receiver in method_call_handlers to avoid undefined use across blocks
- Local vars: materialize on declaration (use init ValueId; void for uninit)
- Prefer legacy BoxCall for Array/Map/String/user boxes in emit_box_or_plugin_call (stability-first)
- Test runner: update LLVM hint to llvmlite harness (remove LLVM_SYS_180_PREFIX guidance)
- Docs/roadmap: update CURRENT_TASK with unified default-ON + guards

Note: NYASH_DEV_BIRTH_INJECT_BUILTINS=1 can re-enable builtin birth() injection during migration.
This commit is contained in:
nyash-codex
2025-09-28 12:19:49 +09:00
parent 41a46b433d
commit 510f4cf523
74 changed files with 2846 additions and 825 deletions

View File

@ -1,7 +1,7 @@
#![cfg(feature = "interpreter-legacy")]
use super::super::NyashRunner;
use nyash_rust::{
backend::VM, interpreter::NyashInterpreter, mir::MirCompiler, parser::NyashParser,
};
use nyash_rust::{backend::VM, interpreter::NyashInterpreter, mir::MirCompiler, parser::NyashParser};
impl NyashRunner {
/// Execute benchmark mode (split)
@ -241,4 +241,3 @@ impl NyashRunner {
Ok(())
}
}
#![cfg(feature = "vm-legacy")]

View File

@ -1,6 +1,9 @@
use super::super::NyashRunner;
use crate::runner::json_v0_bridge;
#[cfg(feature = "interpreter-legacy")]
use nyash_rust::{interpreter::NyashInterpreter, parser::NyashParser};
#[cfg(not(feature = "interpreter-legacy"))]
use nyash_rust::parser::NyashParser;
// Use the library crate's plugin init module rather than the bin crate root
use crate::cli_v;
use crate::runner::pipeline::{resolve_using_target, suggest_in_base};
@ -13,6 +16,7 @@ use std::{fs, process};
// (moved) suggest_in_base is now in runner/pipeline.rs
#[cfg(feature = "interpreter-legacy")]
impl NyashRunner {
// legacy run_file_legacy removed (was commented out)
@ -289,3 +293,12 @@ impl NyashRunner {
}
}
}
#[cfg(not(feature = "interpreter-legacy"))]
impl NyashRunner {
/// Interpreter backend is disabled in default builds. Use `--backend vm` or `--backend llvm`.
pub(crate) fn execute_nyash_file(&self, _filename: &str) {
eprintln!("❌ Interpreter backend (AST) is disabled. Build with --features interpreter-legacy to enable, or use --backend vm/llvm.");
std::process::exit(1);
}
}

View File

@ -103,7 +103,8 @@ pub fn ny_llvmc_emit_exe_lib(
.arg("exe")
.arg("--out")
.arg(exe_out);
if let Some(dir) = nyrt_dir { cmd.arg("--nyrt").arg(dir); } else { cmd.arg("--nyrt").arg("target/release"); }
let default_nyrt = std::env::var("NYASH_EMIT_EXE_NYRT") .ok() .or_else(|| std::env::var("NYASH_ROOT").ok().map(|r| format!("{}/target/release", r))) .unwrap_or_else(|| "target/release".to_string());
if let Some(dir) = nyrt_dir { cmd.arg("--nyrt").arg(dir); } else { cmd.arg("--nyrt").arg(default_nyrt); }
if let Some(flags) = extra_libs { if !flags.trim().is_empty() { cmd.arg("--libs").arg(flags); } }
let status = cmd.status().map_err(|e| {
let prog_path = std::path::Path::new(cmd.get_program());
@ -146,7 +147,8 @@ pub fn ny_llvmc_emit_exe_bin(
.arg("exe")
.arg("--out")
.arg(exe_out);
if let Some(dir) = nyrt_dir { cmd.arg("--nyrt").arg(dir); } else { cmd.arg("--nyrt").arg("target/release"); }
let default_nyrt = std::env::var("NYASH_EMIT_EXE_NYRT") .ok() .or_else(|| std::env::var("NYASH_ROOT").ok().map(|r| format!("{}/target/release", r))) .unwrap_or_else(|| "target/release".to_string());
if let Some(dir) = nyrt_dir { cmd.arg("--nyrt").arg(dir); } else { cmd.arg("--nyrt").arg(default_nyrt); }
if let Some(flags) = extra_libs { if !flags.trim().is_empty() { cmd.arg("--libs").arg(flags); } }
let status = cmd.status().map_err(|e| {
let prog_path = std::path::Path::new(cmd.get_program());