From 07ea30370e887b16228af0dccbe126010cce9e25 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 6 Sep 2022 23:13:48 +0300 Subject: refactor(tvix/eval): capture entire with_stack in upvalues This completely rewrites the handling of "dynamic upvalues" to, instead of resolving them at thunk/closure instantiation time (which forces some values too early), capture the entire with stack of parent contexts if it exists. There are a couple of things in here that could be written more efficiently, but I'm first working through this to get to a bug related to with + recursion and the code complexity of some of the optimisations is distracting. Change-Id: Ia538e06c9146e3bf8decb9adf02dd726d2c651cf Reviewed-on: https://cl.tvl.fyi/c/depot/+/6486 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/compiler/scope.rs | 13 ------------- 1 file changed, 13 deletions(-) (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 ca8512d409c8..e69922a33013 100644 --- a/tvix/eval/src/compiler/scope.rs +++ b/tvix/eval/src/compiler/scope.rs @@ -15,8 +15,6 @@ use std::{ ops::Index, }; -use smol_str::SmolStr; - use crate::opcode::{StackIdx, UpvalueIdx}; #[derive(Debug)] @@ -102,17 +100,6 @@ pub enum UpvalueKind { /// This upvalue captures an enclosing upvalue. Upvalue(UpvalueIdx), - - /// This upvalue captures a dynamically resolved value (i.e. - /// `with`). - /// - /// It stores the identifier with which to perform a dynamic - /// lookup, as well as the optional upvalue index in the enclosing - /// function (if any). - Dynamic { - name: SmolStr, - up: Option, - }, } #[derive(Clone, Debug)] -- cgit 1.4.1