Problem: - 3 duplicate call instruction patterns - Lines ~404-417 (handle_call non-tail) - Lines ~506-518 (exit block tail call) - Lines ~530-540 (unconditional jump tail call) Solution: - Use existing call_generator.rs helpers - emit_call_pair() for current_instructions (no separate spans) - emit_call_pair_with_spans() for BasicBlock with spans Result: - ✅ ~15 lines eliminated (3 duplicate patterns removed) - ✅ Tests pass, no regression - ✅ Cleaner handle_jump implementation 🤖 Generated with Claude Code Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
JoinIR → VM bridge layer
Responsibilities:
- Convert normalized JoinIR modules into MIR for the Rust VM without changing semantics.
- Provide a thin runner helper that executes a JoinIR entry via the VM.
- Host experimental metadata-aware paths (Phase 40-1) behind clearly marked helpers.
Boundaries:
- No new control-flow semantics or heuristics here; this layer only maps structures already normalized by JoinIR.
- Keep type information minimal (MirType::Unknown) and avoid adding inference or guessing.
- Debug/diagnostic output must stay behind
NYASH_JOINIR_VM_BRIDGE_DEBUG=1.
File layout:
mod.rs: public surface + shared helpers (naming, error, logging)convert.rs: JoinIR→MIR lowering (functions/blocks/instructions)runner.rs: VM execution entry (run_joinir_via_vm)meta.rs: experimental metadata-aware conversion hookstests.rs: bridge-specific unit tests (kept local to avoid cross-layer leakage)