Skip to main content

Opcode

Enum Opcode 

Source
#[repr(u8)]
pub enum Opcode {
Show 90 variants Nop = 0, Break = 1, LoadNil = 2, LoadB = 3, LoadN = 4, LoadK = 5, Move = 6, GetGlobal = 7, SetGlobal = 8, GetUpval = 9, SetUpval = 10, CloseUpvals = 11, GetImport = 12, GetTable = 13, SetTable = 14, GetTableKs = 15, SetTableKs = 16, GetTableN = 17, SetTableN = 18, NewClosure = 19, NameCall = 20, Call = 21, Return = 22, Jump = 23, JumpBack = 24, JumpIf = 25, JumpIfNot = 26, JumpIfEq = 27, JumpIfLe = 28, JumpIfLt = 29, JumpIfNotEq = 30, JumpIfNotLe = 31, JumpIfNotLt = 32, Add = 33, Sub = 34, Mul = 35, Div = 36, Mod = 37, Pow = 38, AddK = 39, SubK = 40, MulK = 41, DivK = 42, ModK = 43, PowK = 44, And = 45, Or = 46, AndK = 47, OrK = 48, Concat = 49, Not = 50, Minus = 51, Length = 52, NewTable = 53, DupTable = 54, SetList = 55, ForNPrep = 56, ForNLoop = 57, ForGLoop = 58, ForGPrepInext = 59, FastCall3 = 60, ForGPrepNext = 61, NativeCall = 62, GetVarargs = 63, DupClosure = 64, PrepVarargs = 65, LoadKx = 66, JumpX = 67, FastCall = 68, Coverage = 69, Capture = 70, SubRK = 71, DivRK = 72, FastCall1 = 73, FastCall2 = 74, FastCall2K = 75, ForGPrep = 76, JumpXEqKNil = 77, JumpXEqKB = 78, JumpXEqKN = 79, JumpXEqKS = 80, IDiv = 81, IDivK = 82, GetUDataKs = 83, SetUDataKs = 84, NameCallUData = 85, NewClassMember = 86, CallFb = 87, CmpProto = 88, NewClass = 89,
}

Variants§

§

Nop = 0

§

Break = 1

§

LoadNil = 2

§

LoadB = 3

§

LoadN = 4

§

LoadK = 5

§

Move = 6

§

GetGlobal = 7

§

SetGlobal = 8

§

GetUpval = 9

§

SetUpval = 10

§

CloseUpvals = 11

§

GetImport = 12

§

GetTable = 13

§

SetTable = 14

§

GetTableKs = 15

§

SetTableKs = 16

§

GetTableN = 17

§

SetTableN = 18

§

NewClosure = 19

§

NameCall = 20

§

Call = 21

§

Return = 22

§

Jump = 23

§

JumpBack = 24

§

JumpIf = 25

§

JumpIfNot = 26

§

JumpIfEq = 27

§

JumpIfLe = 28

§

JumpIfLt = 29

§

JumpIfNotEq = 30

§

JumpIfNotLe = 31

§

JumpIfNotLt = 32

§

Add = 33

§

Sub = 34

§

Mul = 35

§

Div = 36

§

Mod = 37

§

Pow = 38

§

AddK = 39

§

SubK = 40

§

MulK = 41

§

DivK = 42

§

ModK = 43

§

PowK = 44

§

And = 45

§

Or = 46

§

AndK = 47

§

OrK = 48

§

Concat = 49

§

Not = 50

§

Minus = 51

§

Length = 52

§

NewTable = 53

§

DupTable = 54

§

SetList = 55

§

ForNPrep = 56

§

ForNLoop = 57

§

ForGLoop = 58

§

ForGPrepInext = 59

§

FastCall3 = 60

§

ForGPrepNext = 61

§

NativeCall = 62

§

GetVarargs = 63

§

DupClosure = 64

§

PrepVarargs = 65

§

LoadKx = 66

§

JumpX = 67

§

FastCall = 68

§

Coverage = 69

§

Capture = 70

§

SubRK = 71

§

DivRK = 72

§

FastCall1 = 73

§

FastCall2 = 74

§

FastCall2K = 75

§

ForGPrep = 76

§

JumpXEqKNil = 77

§

JumpXEqKB = 78

§

JumpXEqKN = 79

§

JumpXEqKS = 80

§

IDiv = 81

§

IDivK = 82

§

GetUDataKs = 83

§

SetUDataKs = 84

§

NameCallUData = 85

§

NewClassMember = 86

§

CallFb = 87

§

CmpProto = 88

§

NewClass = 89

Implementations§

Source§

impl Opcode

Source

pub const COUNT: usize

Source

pub fn from_byte(value: u8) -> Option<Self>

Source

pub fn jump_target(self, instruction: Instruction, pc: u32) -> Option<i32>

Computes the jump target for this opcode/instruction pair.

instruction must be the instruction word whose opcode decoded to self; AUX words are not valid inputs.

Source

pub fn length(self) -> usize

Source

pub fn is_fast_call(self) -> bool

Source

pub fn is_jump_d(self) -> bool

Source

pub fn is_skip_c(self) -> bool

Source

pub fn is_fallthrough(self) -> bool

Source

pub fn is_loop_jump(self) -> bool

Trait Implementations§

Source§

impl Clone for Opcode

Source§

fn clone(&self) -> Opcode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Opcode

Source§

impl Debug for Opcode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Opcode

Source§

impl PartialEq for Opcode

Source§

fn eq(&self, other: &Opcode) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Opcode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.