pub enum IRInstruction {
Show 15 variants
LoadConst(Value),
LoadVar(String),
StoreVar(String),
BinaryOp(BinaryOp),
UnaryOp(UnaryOp),
Call {
func: String,
args_count: usize,
},
CallIntrinsic {
name: String,
args_count: usize,
},
MakeList(usize),
MakeDict(usize),
GetAttr(String),
GetItem,
CallMethod {
name: String,
argc: usize,
},
Await,
Dup,
Pop,
}Expand description
IR instructions - higher level than VM bytecode
Variants§
LoadConst(Value)
Load a constant value
LoadVar(String)
Load a variable
StoreVar(String)
Store to a variable (creates new binding)
BinaryOp(BinaryOp)
Binary operation
UnaryOp(UnaryOp)
Unary operation
Call
Call a function
CallIntrinsic
Call an intrinsic
MakeList(usize)
Build a list
MakeDict(usize)
Build a dict
GetAttr(String)
Get attribute
GetItem
Get item by index
CallMethod
Call method on object
Await
Await a promise
Dup
Duplicate top of stack
Pop
Pop top of stack
Trait Implementations§
Source§impl Clone for IRInstruction
impl Clone for IRInstruction
Source§fn clone(&self) -> IRInstruction
fn clone(&self) -> IRInstruction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IRInstruction
impl RefUnwindSafe for IRInstruction
impl Send for IRInstruction
impl Sync for IRInstruction
impl Unpin for IRInstruction
impl UnwindSafe for IRInstruction
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