From 4d83fd84b452b3c3245f3098c4eefe62b8e163e4 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 18 Oct 2022 00:48:19 -0700 Subject: refactor(tvix/eval): search-and-replace changes This commit contains two search-and-replace renames which are broken out from I04131501029772f30e28da8281d864427685097f in order to reduce the noise in that CL: - `is_thunk -> is_suspended_thunk`, since there are now OpThunkClosure and OpThunkSuspended - `compile_lambda_or_thunk` -> `compile_lambda_or_suspension` Change-Id: I7cc5bbb75ef6605e3428c7be27e812f41a10c127 Signed-off-by: Adam Joseph Reviewed-on: https://cl.tvl.fyi/c/depot/+/7037 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/compiler/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tvix/eval/src/compiler/mod.rs') diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index 34a15330c227..db6031e0a4f8 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -898,7 +898,7 @@ impl Compiler<'_> { /// Compile an expression into a runtime cloure or thunk fn compile_lambda_or_thunk( &mut self, - is_thunk: bool, + is_suspended_thunk: bool, outer_slot: LocalIdx, node: &N, content: F, @@ -936,7 +936,7 @@ impl Compiler<'_> { } let lambda = Rc::new(compiled.lambda); - if is_thunk { + if is_suspended_thunk { self.observer.observe_compiled_thunk(&lambda); } else { self.observer.observe_compiled_lambda(&lambda); @@ -945,7 +945,7 @@ impl Compiler<'_> { // If no upvalues are captured, emit directly and move on. if lambda.upvalue_count == 0 { self.emit_constant( - if is_thunk { + if is_suspended_thunk { Value::Thunk(Thunk::new_suspended(lambda, span)) } else { Value::Closure(Closure::new(lambda)) @@ -962,7 +962,7 @@ impl Compiler<'_> { let blueprint_idx = self.chunk().push_constant(Value::Blueprint(lambda)); let code_idx = self.push_op( - if is_thunk { + if is_suspended_thunk { OpCode::OpThunkSuspended(blueprint_idx) } else { OpCode::OpThunkClosure(blueprint_idx) @@ -977,7 +977,7 @@ impl Compiler<'_> { compiled.captures_with_stack, ); - if !is_thunk && !self.scope()[outer_slot].needs_finaliser { + if !is_suspended_thunk && !self.scope()[outer_slot].needs_finaliser { if !self.scope()[outer_slot].must_thunk { // The closure has upvalues, but is not recursive. Therefore no thunk is required, // which saves us the overhead of Rc> -- cgit 1.4.1