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

@ -7,6 +7,7 @@
pub mod instruction;
pub mod instruction_v2; // New 25-instruction specification
pub mod instruction_introspection; // Introspection helpers for tests (core instruction names)
pub mod basic_block;
pub mod function;
pub mod builder;
@ -190,13 +191,10 @@ mod tests {
#[test]
fn test_lowering_extern_console_log() {
// Build AST: console.log("hi") → ExternCall env.console.log
let ast = ASTNode::Expression {
expr: Box::new(ASTNode::MethodCall {
object: Box::new(ASTNode::Variable { name: "console".to_string(), span: crate::ast::Span::unknown() }),
method: "log".to_string(),
arguments: vec![ ASTNode::Literal { value: LiteralValue::String("hi".to_string()), span: crate::ast::Span::unknown() } ],
span: crate::ast::Span::unknown(),
}),
let ast = ASTNode::MethodCall {
object: Box::new(ASTNode::Variable { name: "console".to_string(), span: crate::ast::Span::unknown() }),
method: "log".to_string(),
arguments: vec![ ASTNode::Literal { value: LiteralValue::String("hi".to_string()), span: crate::ast::Span::unknown() } ],
span: crate::ast::Span::unknown(),
};
@ -210,13 +208,10 @@ mod tests {
#[test]
fn test_lowering_boxcall_array_push() {
// Build AST: (new ArrayBox()).push(1)
let ast = ASTNode::Expression {
expr: Box::new(ASTNode::MethodCall {
object: Box::new(ASTNode::New { class: "ArrayBox".to_string(), arguments: vec![], type_arguments: vec![], span: crate::ast::Span::unknown() }),
method: "push".to_string(),
arguments: vec![ ASTNode::Literal { value: LiteralValue::Integer(1), span: crate::ast::Span::unknown() } ],
span: crate::ast::Span::unknown(),
}),
let ast = ASTNode::MethodCall {
object: Box::new(ASTNode::New { class: "ArrayBox".to_string(), arguments: vec![], type_arguments: vec![], span: crate::ast::Span::unknown() }),
method: "push".to_string(),
arguments: vec![ ASTNode::Literal { value: LiteralValue::Integer(1), span: crate::ast::Span::unknown() } ],
span: crate::ast::Span::unknown(),
};