pub enum Instruction {
Show 49 variants
Clone,
Sp,
Pop,
Deref,
Jump(usize),
JumpTrue(usize),
JumpFalse(usize),
GetLocalVariable(usize),
SetLocalVariable(usize),
InitLocalVariable(usize),
IsNil,
Nil,
Boolean(bool),
Numeric(LuaNumber),
String(Vec<u8>),
GetEnv,
TableInit(usize),
TableIndexInit,
TableInitLast(IntType),
TableIndex,
TableIndexSet,
FunctionInit(usize, usize),
FunctionInitUpvalueFromLocalVar(usize),
FunctionInitUpvalueFromUpvalue(usize),
FunctionUpvalue(usize),
FunctionUpvalueSet(usize),
BinaryAdd,
BinarySub,
BinaryMul,
BinaryDiv,
BinaryFloorDiv,
BinaryMod,
BinaryPow,
BinaryConcat,
BinaryBitwiseAnd,
BinaryBitwiseOr,
BinaryBitwiseXor,
BinaryShiftLeft,
BinaryShiftRight,
BinaryEqual,
BinaryLessThan,
BinaryLessEqual,
UnaryMinus,
UnaryBitwiseNot,
UnaryLength,
UnaryLogicalNot,
FunctionCall(Option<usize>),
Return,
GetVariadic(Option<usize>),
}Variants§
Clone
clone top of the data_stack and push it
Sp
push current length of data_stack to usize_stack
Pop
Deref
clone where top of the usize_stack points to. Does not pop from usize_stack.
Jump(usize)
jump to label
JumpTrue(usize)
pops data_stack and jump to label if stack_top is true.
JumpFalse(usize)
pops data_stack and jump to label if stack_top is false
GetLocalVariable(usize)
get i’th local variable and push the value to stack_top
SetLocalVariable(usize)
pop data_stack and set i’th local variable to the value.
If i’th local variable is Ref, the internal value will be set.
InitLocalVariable(usize)
pop data_stack and initialize i’th local variable to the Value.
IsNil
pop data_stack and check if it is nil.
Nil
push nil
Boolean(bool)
push bool
Numeric(LuaNumber)
push int or float
String(Vec<u8>)
push string
GetEnv
push _ENV
TableInit(usize)
init new table with capacity
TableIndexInit
table -> key -> value -> stack_top. table must not be popped.
TableInitLast(IntType)
sp pushed to usize_stack, points to the start of args. table -> args… -> stack_top ^ sp
TableIndex
table -> index -> stack_top
TableIndexSet
value -> table -> index -> stack_top
FunctionInit(usize, usize)
function_id, number of upvalues
FunctionInitUpvalueFromLocalVar(usize)
func -> top. src_stack_id
FunctionInitUpvalueFromUpvalue(usize)
src_upvalue_id
FunctionUpvalue(usize)
get i’th upvalue of current function
FunctionUpvalueSet(usize)
set i’th upvalue of current function
BinaryAdd
BinarySub
BinaryMul
BinaryDiv
BinaryFloorDiv
BinaryMod
BinaryPow
BinaryConcat
BinaryBitwiseAnd
BinaryBitwiseOr
BinaryBitwiseXor
BinaryShiftLeft
BinaryShiftRight
BinaryEqual
BinaryLessThan
BinaryLessEqual
UnaryMinus
UnaryBitwiseNot
UnaryLength
UnaryLogicalNot
FunctionCall(Option<usize>)
return expected can be 0. sp pushed to usize_stack, points to the start of args. args -> function -> stack top
Return
GetVariadic(Option<usize>)
Invalid call ( using ... in a non-variadic function ) was filtered out in parser.
Trait Implementations§
source§impl Clone for Instruction
impl Clone for Instruction
source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)