pub enum Instruction {
Visit(usize),
Push(ReadOperation),
Mutate(usize, ReadOperation),
ExternCall(usize),
}
Expand description
An enum representing a bytecode instruction. For bytecode mapping, see the byte_id module.
Variants§
Visit(usize)
Set the execution pointer index.
This is also known as the call
or goto
instruction.
Push(ReadOperation)
Push data to the stack.
Mutate(usize, ReadOperation)
Mutate a location in the memory pool.
ExternCall(usize)
Call an external function.
Similar to the syscall
instruction in machine code.
Implementations§
Source§impl Instruction
impl Instruction
Sourcepub fn get_identifier_byte(&self) -> u8
pub fn get_identifier_byte(&self) -> u8
Get the bytecode identifier of this instruction. See the byte_id module for the byte mapping.
Sourcepub fn compile(&self, dest: &mut Vec<u8>, program_options: &ProgramOptions)
pub fn compile(&self, dest: &mut Vec<u8>, program_options: &ProgramOptions)
Compile this instruction to its bytecode representation.
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more