diff options
Diffstat (limited to 'tvix/eval/src/opcode.rs')
-rw-r--r-- | tvix/eval/src/opcode.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs index f2daf9bd8e52..6cce7ea9b176 100644 --- a/tvix/eval/src/opcode.rs +++ b/tvix/eval/src/opcode.rs @@ -13,9 +13,14 @@ pub struct CodeIdx(pub usize); /// Index of a value in the runtime stack. #[repr(transparent)] -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] pub struct StackIdx(pub usize); +/// Index of an upvalue within a closure's upvalue list. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct UpvalueIdx(pub usize); + /// Offset by which an instruction pointer should change in a jump. #[repr(transparent)] #[derive(Clone, Copy, Debug)] @@ -99,4 +104,5 @@ pub enum OpCode { // Lambdas OpCall, + OpGetUpvalue(UpvalueIdx), } |