about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/opcode.rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/opcode.rs')
-rw-r--r--users/tazjin/rlox/src/bytecode/opcode.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/bytecode/opcode.rs b/users/tazjin/rlox/src/bytecode/opcode.rs
index 13e2f23939ed..accc6b3bac10 100644
--- a/users/tazjin/rlox/src/bytecode/opcode.rs
+++ b/users/tazjin/rlox/src/bytecode/opcode.rs
@@ -7,6 +7,9 @@ pub struct StackIdx(pub usize);
 #[derive(Clone, Copy, Debug)]
 pub struct CodeIdx(pub usize);
 
+#[derive(Clone, Copy, Debug)]
+pub struct CodeOffset(pub usize);
+
 #[derive(Debug)]
 pub enum OpCode {
     /// Push a constant onto the stack.
@@ -45,4 +48,8 @@ pub enum OpCode {
     OpSetGlobal(ConstantIdx),
     OpGetLocal(StackIdx),
     OpSetLocal(StackIdx),
+
+    // Control flow
+    OpJumpPlaceholder(bool),
+    OpJumpIfFalse(CodeOffset),
 }