diff options
Diffstat (limited to 'tvix/eval/src/opcode.rs')
-rw-r--r-- | tvix/eval/src/opcode.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs new file mode 100644 index 000000000000..b43f75efaa8f --- /dev/null +++ b/tvix/eval/src/opcode.rs @@ -0,0 +1,19 @@ +//! This module implements the instruction set running on the abstract +//! machine implemented by tvix. + +#[derive(Clone, Copy, Debug)] +pub struct ConstantIdx(pub usize); + +#[derive(Clone, Copy, Debug)] +pub struct CodeIdx(pub usize); + +#[derive(Clone, Copy, Debug)] +pub enum OpCode { + // Push a constant onto the stack. + OpConstant(ConstantIdx), + + // Push a literal value. + OpNull, + OpTrue, + OpFalse, +} |