AOT/JIT: StringBox.length デバッグ追跡とローカル材化強化
- ops_ext: StringBox.len/lengthの結果を必ずローカルに保存 - param/local/literal/handle.of全経路で dst があれば local_index に格納 - Returnが確実に値を拾えるよう修正 - デバッグ計測追加: - NYASH_JIT_TRACE_LOWER: BoxCall処理の追跡 - NYASH_JIT_TRACE_RET: Return時の値解決追跡 - NYASH_JIT_TRACE_LOCAL: ローカルslot I/O追跡 - NYASH_JIT_TRACE_LEN: string.len_h thunk実行追跡 - 診断用プローブ追加: tmp_len_stringbox_probe.nyash - CURRENT_TASK更新: 3rdハンドオフ進捗記録 現状: lowering/Return/ローカル材化は正しく配線されているが、 hostcall実行時に0を返している疑い。シンボル解決の追跡継続中。 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -685,6 +685,9 @@ impl IRBuilder for CraneliftBuilder {
|
||||
else { let one = fb.ins().iconst(types::I64, 1); let zero = fb.ins().iconst(types::I64, 0); let b1 = fb.ins().icmp_imm(IntCC::NotEqual, v, 0); v = fb.ins().select(b1, one, zero); }
|
||||
}
|
||||
if let Some(slot) = slot { fb.ins().stack_store(v, slot, 0); }
|
||||
if std::env::var("NYASH_JIT_TRACE_LOCAL").ok().as_deref() == Some("1") {
|
||||
eprintln!("[JIT-LOCAL] store idx={} (tracked_slots={})", index, self.local_slots.len());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -693,6 +696,9 @@ impl IRBuilder for CraneliftBuilder {
|
||||
if !self.local_slots.contains_key(&index) { self.ensure_local_i64(index); }
|
||||
if let Some(&slot) = self.local_slots.get(&index) {
|
||||
let v = Self::with_fb(|fb| fb.ins().stack_load(types::I64, slot, 0));
|
||||
if std::env::var("NYASH_JIT_TRACE_LOCAL").ok().as_deref() == Some("1") {
|
||||
eprintln!("[JIT-LOCAL] load idx={} (tracked_slots={})", index, self.local_slots.len());
|
||||
}
|
||||
self.value_stack.push(v); self.stats.0 += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user