rune
rune copied to clipboard
Re-use the same virtual machine in VmExecution
While working on cleanup for VmExecution
it became apparent to me that it should be possible to re-use the same virtual machine in VmExecution
.
VmExecution
currently is essentially a stack of virtual machines - because the execution context might hop between various contexts and units in cases such as sharing Function
objects across executions. But this stack of vms could potentially be replaced with a stack of context, unit, and instruction offsets. Everything needed to modify a single virtual machine.
Doing this means we can re-use a single stack of values even in complex execution environments which should be better for memory locality than multiple vms per execution each with their individual stacks.