Enum passerine::common::opcode::Opcode [−][src]
#[repr(u8)]
pub enum Opcode {
Show 19 variants
Con,
NotInit,
Del,
FFICall,
Copy,
Capture,
Save,
SaveCap,
Load,
LoadCap,
Call,
Return,
Closure,
Print,
Label,
Tuple,
UnData,
UnLabel,
UnTuple,
}
Expand description
This enum represents a single opcode. Under the hood, it’s just a byte. This allows non opcode bytes to be inserted in bytecode streams.
Variants
Load a constant.
Load uninitialized Data.
Delete a value off the stack.
Calls out to a Rust function via FFI
Copies topmost value on the stack.
Moves a variable onto the heap.
Save a constant into a variable.
Save a value to a captured variable.
Push a copy of a variable onto the stack.
Load a copy of a captured variable.
Call a function.
Return from a function.
Creates a closure over the current local environment.
Prints a value.
Constructs a label.
Destructures atomic data by asserting it matches exactly.
Destructures a label.
Sestructures a tuple.
Implementations
Convert a raw byte to an opcode. Note that non-opcode bytes should never be interpreted as an opcode. Under the hood, this is just a transmute, so the regular cautions apply. This should never cause a crash and if it does, the vm’s designed to crash hard so it’ll be pretty obvious.