about summary refs log tree commit diff
path: root/tvix/eval/src/opcode.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-28T20·53+0300
committertazjin <tazjin@tvl.su>2022-09-06T14·58+0000
commitd1798444bec692a608aa93605cbe449d985c3e16 (patch)
tree470d7aeef33079e12d865b89f7797c2b531ca072 /tvix/eval/src/opcode.rs
parent1f37275cfb42994ed23742b80055a7ab0485247d (diff)
feat(tvix/eval): Add Compiler::thunk method for emitting thunks r/4674
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>
Diffstat (limited to 'tvix/eval/src/opcode.rs')
-rw-r--r--tvix/eval/src/opcode.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs
index 45a6337229..a8802e8c0a 100644
--- a/tvix/eval/src/opcode.rs
+++ b/tvix/eval/src/opcode.rs
@@ -107,6 +107,9 @@ pub enum OpCode {
     OpGetUpvalue(UpvalueIdx),
     OpClosure(ConstantIdx),
 
+    // Thunks
+    OpThunk(ConstantIdx),
+
     /// Finalise initialisation of the upvalues of the value in the
     /// given stack index after the scope is fully bound.
     OpFinalise(StackIdx),