about summary refs log tree commit diff
path: root/tvix/eval/src/compiler/scope.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-28T14·50+0300
committertazjin <tazjin@tvl.su>2022-09-06T14·58+0000
commit5c4e102ac8551f6aaa58d54778a2442dc470b0e5 (patch)
treebadcefd13ffccf7e4c3d4382174eaaeb7cb0b39b /tvix/eval/src/compiler/scope.rs
parent025a9a4a0a66c8593cd6b7e4b0f0fa7aea84c353 (diff)
feat(tvix/eval): track whether locals needs to be finalised r/4668
When encountering a deferred local upvalue, the compiler will now mark
the corresponding local as needing a finaliser which makes it possible
to emit the OpFinalise instruction for this stack slot a little bit
down the line.

Change-Id: I3962066f10fc6c6e1472722b8bdb415a811e0740
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6338
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to '')
-rw-r--r--tvix/eval/src/compiler/scope.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tvix/eval/src/compiler/scope.rs b/tvix/eval/src/compiler/scope.rs
index a76a411b46..310f33d608 100644
--- a/tvix/eval/src/compiler/scope.rs
+++ b/tvix/eval/src/compiler/scope.rs
@@ -38,6 +38,10 @@ pub struct Local {
 
     // Is this local known to have been used at all?
     pub used: bool,
+
+    // Does this local need to be finalised after the enclosing scope
+    // is completely constructed?
+    pub needs_finaliser: bool,
 }
 
 impl Local {