feat(tvix/eval): implement compilation of upvalue access

This adds a new upvalue tracking structure in the compiler to resolve
upvalues and track their positions within a function when compiling a
closure.

The compiler will emit runtime upvalue access instructions after this
commit, but the creation of the runtime closure object etc. is not yet
wired up.

Change-Id: Ib0c2c25f686bfd45f797c528753068858e3a770d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6289
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-08-26 21:48:51 +03:00 committed by tazjin
parent 2f93ed297e
commit 1163ef3e41
4 changed files with 66 additions and 4 deletions

View file

@ -366,6 +366,8 @@ impl VM {
_ => return Err(ErrorKind::NotCallable.into()),
};
}
OpCode::OpGetUpvalue(_) => todo!("getting upvalues"),
}
#[cfg(feature = "disassembler")]