feat(tvix/eval): Add Compiler::thunk method for emitting thunks

The logic in this method is *very* similar to `compile_lambda`. It is
intended to be called around any expression that should be
thunked (such as function applications, attribute set values, etc.).

Change-Id: Idfbb2daa9f4b735095378fb9c39a2fd07c8cff91
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6344
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2022-08-28 23:53:20 +03:00 committed by tazjin
parent 1f37275cfb
commit d1798444be
3 changed files with 41 additions and 1 deletions

View file

@ -435,6 +435,8 @@ impl VM {
}
}
OpCode::OpThunk(_idx) => todo!("runtime thunk construction"),
OpCode::OpFinalise(StackIdx(idx)) => {
match &self.stack[self.frame().stack_offset + idx] {
Value::Closure(closure) => closure