Implement Phase 9.7: ExternCall instruction and WASM runtime imports

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-14 08:56:39 +00:00
parent 9b25330d94
commit 2091462441
9 changed files with 318 additions and 3 deletions

View File

@ -360,6 +360,16 @@ impl MirPrinter {
MirInstruction::Await { dst, future } => {
format!("{} = await {}", dst, future)
},
// Phase 9.7: External Function Calls
MirInstruction::ExternCall { dst, iface_name, method_name, args, effects } => {
let args_str = args.iter().map(|v| format!("{}", v)).collect::<Vec<_>>().join(", ");
if let Some(dst) = dst {
format!("{} = extern_call {}.{}({}) [effects: {}]", dst, iface_name, method_name, args_str, effects)
} else {
format!("extern_call {}.{}({}) [effects: {}]", iface_name, method_name, args_str, effects)
}
},
}
}