From 5c4e102ac8551f6aaa58d54778a2442dc470b0e5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 28 Aug 2022 17:50:16 +0300 Subject: feat(tvix/eval): track whether locals needs to be finalised 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 --- tvix/eval/src/compiler/scope.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tvix/eval/src/compiler/scope.rs') 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 { -- cgit 1.4.1