feat(tvix/eval): detect deferred upvalue capturing
Uses the threaded through slot offset to determine whether initialisation of a captured local upvalue must be defered to a later point where all values of a scope are available. This adds a new data representation to the opcode for this situation, but the equivalent runtime handling is not yet implemented. This is in part because there is more compiler machinery needed to find the resolution point. Change-Id: Ifd0c393f76abfe6e2d91483faf0f58947ab1dedc Reviewed-on: https://cl.tvl.fyi/c/depot/+/6329 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
This commit is contained in:
parent
203d9f2e3e
commit
6c1948a71a
3 changed files with 22 additions and 3 deletions
|
|
@ -426,6 +426,10 @@ impl VM {
|
|||
closure.push_upvalue(value);
|
||||
}
|
||||
|
||||
OpCode::DataDeferredLocal(_idx) => {
|
||||
todo!("deferred local initialisation")
|
||||
}
|
||||
|
||||
_ => panic!("compiler error: missing closure operand"),
|
||||
}
|
||||
}
|
||||
|
|
@ -434,6 +438,7 @@ impl VM {
|
|||
// Data-carrying operands should never be executed,
|
||||
// that is a critical error in the VM.
|
||||
OpCode::DataLocalIdx(_)
|
||||
| OpCode::DataDeferredLocal(_)
|
||||
| OpCode::DataUpvalueIdx(_)
|
||||
| OpCode::DataDynamicIdx(_)
|
||||
| OpCode::DataDynamicAncestor(_) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue