about summary refs log tree commit diff
path: root/tvix/eval/src/compiler/mod.rs
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-10-18T07·48-0700
committerAdam Joseph <adam@westernsemico.com>2022-10-27T22·00+0000
commit4d83fd84b452b3c3245f3098c4eefe62b8e163e4 (patch)
treedf07e2c06f632e8dbc52d1392002a509812e7d86 /tvix/eval/src/compiler/mod.rs
parent8616f13a71e3fc186e01bdb4ada60503f233be99 (diff)
refactor(tvix/eval): search-and-replace changes r/5214
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 <adam@westernsemico.com>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7037
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/compiler/mod.rs')
-rw-r--r--tvix/eval/src/compiler/mod.rs10
1 files changed, 5 insertions, 5 deletions
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<N, F>(
         &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<RefCell<>>