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:
Vincent Ambo 2022-08-28 16:50:46 +03:00 committed by tazjin
parent 203d9f2e3e
commit 6c1948a71a
3 changed files with 22 additions and 3 deletions

View file

@ -115,6 +115,7 @@ pub enum OpCode {
// The VM skips over these by advancing the instruction pointer
// according to the count.
DataLocalIdx(StackIdx),
DataDeferredLocal(StackIdx),
DataUpvalueIdx(UpvalueIdx),
DataDynamicIdx(ConstantIdx),
DataDynamicAncestor(UpvalueIdx),