about summary refs log tree commit diff
path: root/tvix/eval
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval')
-rw-r--r--tvix/eval/src/compiler/mod.rs18
-rw-r--r--tvix/eval/src/opcode.rs1
-rw-r--r--tvix/eval/src/vm.rs5
3 files changed, 0 insertions, 24 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index 6dd0b669f957..a59f935b0494 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -1019,11 +1019,6 @@ impl Compiler<'_> {
         // lambda as a constant.
         let mut compiled = self.contexts.pop().unwrap();
 
-        // Check if tail-call optimisation is possible and perform it.
-        if self.dead_scope == 0 {
-            optimise_tail_call(&mut compiled.lambda.chunk);
-        }
-
         // Capturing the with stack counts as an upvalue, as it is
         // emitted as an upvalue data instruction.
         if compiled.captures_with_stack {
@@ -1288,19 +1283,6 @@ fn expr_static_attr_str(node: &ast::Attr) -> Option<SmolStr> {
     }
 }
 
-/// Perform tail-call optimisation if the last call within a
-/// compiled chunk is another call.
-fn optimise_tail_call(chunk: &mut Chunk) {
-    let last_op = chunk
-        .code
-        .last_mut()
-        .expect("compiler bug: chunk should never be empty");
-
-    if matches!(last_op, OpCode::OpCall) {
-        *last_op = OpCode::OpTailCall;
-    }
-}
-
 /// Create a delayed source-only builtin compilation, for a builtin
 /// which is written in Nix code.
 ///
diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs
index a49bee425dea..445b994b04d8 100644
--- a/tvix/eval/src/opcode.rs
+++ b/tvix/eval/src/opcode.rs
@@ -141,7 +141,6 @@ pub enum OpCode {
 
     // Lambdas & closures
     OpCall,
-    OpTailCall,
     OpGetUpvalue(UpvalueIdx),
     /// A Closure which has upvalues but no self-references
     OpClosure(ConstantIdx),
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index cd6fc211b4ad..10966aca811b 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -956,11 +956,6 @@ impl<'o> VM<'o> {
 
             OpCode::OpCall => {
                 let callable = self.pop();
-                self.call_value(&callable)?;
-            }
-
-            OpCode::OpTailCall => {
-                let callable = self.pop();
                 self.tail_call_value(callable)?;
             }