pub enum Instruction {
Show 59 variants
LoadNil,
LoadBool(bool),
LoadInt(i64),
LoadFloat(f64),
LoadStr(String),
LoadConst(usize),
Pop,
Dup,
Swap,
GetLocal(usize),
SetLocal(usize),
GetUpvalue(usize),
SetUpvalue(usize),
GetGlobal(String),
SetGlobal(String),
NewTable,
SetField(String),
GetField(String),
SetIndex,
GetIndex,
TableAppend,
Len,
Neg,
Not,
BitNot,
Add,
Sub,
Mul,
Div,
IDiv,
Mod,
Pow,
Concat,
BitAnd,
BitOr,
BitXor,
Shl,
Shr,
Eq,
NotEq,
Lt,
LtEq,
Gt,
GtEq,
Jump(isize),
JumpIf(isize),
JumpIfNot(isize),
JumpIfNotPop(isize),
JumpIfPop(isize),
JumpAbs(usize),
Call(usize),
CallMethod(String, usize),
Return(usize),
MakeFunction(usize),
MakeClosure(usize, Vec<(bool, usize)>),
CloseUpvalue(usize),
ForPrep(usize),
ForStep(usize, isize),
Nop,
}Expand description
Runtime instruction set emitted by Compiler::compile_script.
Variants§
LoadNil
LoadBool(bool)
LoadInt(i64)
LoadFloat(f64)
LoadStr(String)
LoadConst(usize)
Pop
Dup
Swap
GetLocal(usize)
SetLocal(usize)
GetUpvalue(usize)
SetUpvalue(usize)
GetGlobal(String)
SetGlobal(String)
NewTable
SetField(String)
GetField(String)
SetIndex
GetIndex
TableAppend
Len
Neg
Not
BitNot
Add
Sub
Mul
Div
IDiv
Mod
Pow
Concat
BitAnd
BitOr
BitXor
Shl
Shr
Eq
NotEq
Lt
LtEq
Gt
GtEq
Jump(isize)
JumpIf(isize)
JumpIfNot(isize)
JumpIfNotPop(isize)
Peek; if not truthy jump (and leave value); if truthy pop and continue.
JumpIfPop(isize)
Peek; if truthy jump (and leave value); if falsy pop and continue.
JumpAbs(usize)
Call(usize)
CallMethod(String, usize)
Return(usize)
MakeFunction(usize)
MakeClosure(usize, Vec<(bool, usize)>)
CloseUpvalue(usize)
ForPrep(usize)
ForStep(usize, isize)
Advance numeric for-loop: local_idx = loop var slot, jump_offset = exit jump.
Nop
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
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 moreSource§impl Debug for Instruction
impl Debug for Instruction
Source§impl PartialEq for Instruction
impl PartialEq for Instruction
impl StructuralPartialEq for Instruction
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.