feat(jit): JIT Strictモード実装とプラグイン経路の安定化

- InvokePolicy/Observe導入でLowererの分岐をスリム化
- ArrayBox/MapBox/StringBoxのプラグイン経路統一
- 特殊コメント機能(@jit-debug, @plugin-builtins, @jit-strict)実装
- 型ヒント伝搬パス(TypeHintPass)を独立モジュール化
- VM→Plugin引数整合の安定化(I64統一、IntegerBox自動プリミティブ化)
- StringBoxのpost-birth初期化(空文字列セグフォルト修正)
- JIT観測サンプル追加(Array/Map/String)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-29 21:39:47 +09:00
parent 3d8ba3f3ec
commit 1eee62a8ea
25 changed files with 1008 additions and 332 deletions

View File

@ -59,6 +59,11 @@ impl JitEngine {
self.last_phi_total = phi_t; self.last_phi_b1 = phi_b1; self.last_ret_bool_hint = ret_b;
// Record per-function stats into manager via callback if available (handled by caller)
let cfg_now = crate::jit::config::current();
// Strict mode: any unsupported lowering must fail-fast
if lower.unsupported > 0 && std::env::var("NYASH_JIT_STRICT").ok().as_deref() == Some("1") {
eprintln!("[JIT][strict] unsupported lowering ops for {}: {} — failing compile", func_name, lower.unsupported);
return None;
}
if cfg_now.dump {
let phi_min = cfg_now.phi_min;
let native_f64 = cfg_now.native_f64;