phase(9.78h): stabilize MIR/VM pipeline

- Add MIR26 doc≡code sync test (tests/mir_instruction_set_sync.rs)
- Quiet snapshots; filter plugin/net logs; golden all green
- Delegate VM phi selection to LoopExecutor (borrow-safe)
- ResultBox migration: remove legacy box_trait::ResultBox paths
- VM BoxRef arithmetic fallbacks via toString().parse::<i64>()
- Bridge BoxCall(InstanceBox) to Class.method/arity in VM
- Fix Effects purity (READ -> readonly, not pure)
- Mark Catch as CONTROL to prevent DCE; Try/Catch test green
- Add env-gated debug logs (effects, verifier, mir-printer, trycatch, ref, bin)
- Update CURRENT_TASK with progress and next steps
This commit is contained in:
Moe Charm
2025-08-26 05:49:23 +09:00
parent 248c3ba183
commit bf4b87526e
21 changed files with 310 additions and 95 deletions

View File

@ -844,6 +844,9 @@ impl MirBuilder {
// Set up exception handler for the try block (before we enter it)
if let Some(catch_clause) = catch_clauses.first() {
if std::env::var("NYASH_DEBUG_TRYCATCH").ok().as_deref() == Some("1") {
eprintln!("[BUILDER] Emitting catch handler for {:?}", catch_clause.exception_type);
}
let exception_value = self.value_gen.next();
// Register catch handler for exceptions that may occur in try block
@ -874,9 +877,15 @@ impl MirBuilder {
// Build catch block (reachable via exception handling)
self.start_new_block(catch_block)?;
if std::env::var("NYASH_DEBUG_TRYCATCH").ok().as_deref() == Some("1") {
eprintln!("[BUILDER] Enter catch block {:?}", catch_block);
}
// Handle catch clause
if let Some(catch_clause) = catch_clauses.first() {
if std::env::var("NYASH_DEBUG_TRYCATCH").ok().as_deref() == Some("1") {
eprintln!("[BUILDER] Emitting catch handler for {:?}", catch_clause.exception_type);
}
// Build catch body
let catch_ast = ASTNode::Program {
statements: catch_clause.body.clone(),