about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/eval/src/compiler/scope.rs4
-rw-r--r--tvix/eval/src/opcode.rs8
2 files changed, 7 insertions, 5 deletions
diff --git a/tvix/eval/src/compiler/scope.rs b/tvix/eval/src/compiler/scope.rs
index 83fba6eed7..327766bcb5 100644
--- a/tvix/eval/src/compiler/scope.rs
+++ b/tvix/eval/src/compiler/scope.rs
@@ -121,9 +121,7 @@ pub struct Upvalue {
     pub span: codemap::Span,
 }
 
-/// Represents the index of a local in the scope's local array, which
-/// is subtly different from its `StackIdx` (which excludes
-/// uninitialised values in between).
+/// The index of a local in the scope's local array at compile time.
 #[repr(transparent)]
 #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)]
 pub struct LocalIdx(usize);
diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs
index 382a857ef9..b7367cd815 100644
--- a/tvix/eval/src/opcode.rs
+++ b/tvix/eval/src/opcode.rs
@@ -27,12 +27,16 @@ impl Sub<usize> for CodeIdx {
     }
 }
 
-/// Index of a value in the runtime stack.
+/// Index of a value in the runtime stack.  This is an offset
+/// *relative to* the VM value stack_base of the CallFrame
+/// containing the opcode which contains this StackIdx.
 #[repr(transparent)]
 #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)]
 pub struct StackIdx(pub usize);
 
-/// Index of an upvalue within a closure's upvalue list.
+/// Index of an upvalue within a closure's bound-variable upvalue
+/// list.  This is an absolute index into the Upvalues of the
+/// CallFrame containing the opcode which contains this UpvalueIdx.
 #[repr(transparent)]
 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
 pub struct UpvalueIdx(pub usize);