about summary refs log tree commit diff
path: root/tvix/eval/src/vm.rs
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-10-25T09·16-0700
committerAdam Joseph <adam@westernsemico.com>2022-11-05T21·58+0000
commitc096152953d7178566f8ae53b63154b5f2bbb177 (patch)
tree7e7649bac60cd446adf6079e7ffaf492e137eee4 /tvix/eval/src/vm.rs
parent8240b2959e47a38cc946d56c7514f15510305f57 (diff)
refactor(tvix/eval): rename Opcode::DataLocalIdx to DataStackIdx r/5250
It is very confusing that this opcode is called DataLocalIdx, but it
carries a StackIdx rather than a LocalIdx.  It seems like this
really ought to be called DataStackIdx, but maybe I've
misunderstood; if so please explain it to me.

Change-Id: I91f6ffa759412beef0b91d3c19ec0d873fe51b99
Signed-off-by: Adam Joseph <adam@westernsemico.com>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7088
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r--tvix/eval/src/vm.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index c9b96fa61c34..c67e9f6d8899 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -734,7 +734,7 @@ impl<'o> VM<'o> {
 
             // Data-carrying operands should never be executed,
             // that is a critical error in the VM.
-            OpCode::DataLocalIdx(_)
+            OpCode::DataStackIdx(_)
             | OpCode::DataDeferredLocal(_)
             | OpCode::DataUpvalueIdx(_)
             | OpCode::DataCaptureWith => {
@@ -813,7 +813,7 @@ impl<'o> VM<'o> {
     ) -> EvalResult<()> {
         for _ in 0..count {
             match self.inc_ip() {
-                OpCode::DataLocalIdx(StackIdx(stack_idx)) => {
+                OpCode::DataStackIdx(StackIdx(stack_idx)) => {
                     let idx = self.frame().stack_offset + stack_idx;
 
                     let val = match self.stack.get(idx) {
@@ -823,8 +823,8 @@ impl<'o> VM<'o> {
                                 msg: "upvalue to be captured was missing on stack",
                                 metadata: Some(Rc::new(json!({
                                     "ip": format!("{:#x}", self.frame().ip.0 - 1),
-                                    "stack_idx": stack_idx,
-                                    "absolute stack position": idx,
+                                    "stack_idx(relative)": stack_idx,
+                                    "stack_idx(absolute)": idx,
                                 }))),
                             }))
                         }