feat: Add stack size to runtime metadata

Store the pre-calculated stack size of lambda bodies in the
RuntimeMetadata. This allows the VM to directly access this information
without recalculating it.
This commit is contained in:
Michael Schimmel
2026-03-10 20:25:04 +01:00
parent 8c865681ff
commit efcb4e3685
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -508,7 +508,7 @@ impl VM {
for addr in upvalues {
captured.push(self.capture_upvalue(*addr)?);
}
let stack_size = body.calculate_stack_size();
let stack_size = node.ty.stack_size;
let closure = Closure::new(
params.ty.original.clone(),
body.ty.original.clone(),