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:
parent
1f37275cfb
commit
d1798444be
3 changed files with 41 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue