Skip to main content

Opcode

Enum Opcode 

Source
#[repr(u8)]
pub enum Opcode {
Show 148 variants Nop = 0, End = 1, Return = 2, LoadConst = 10, LoadInt = 11, LoadInt8 = 12, LoadTrue = 13, LoadFalse = 14, LoadNull = 15, LoadUndefined = 16, LoadTdz = 17, CheckTdz = 18, CheckRef = 19, CheckObjectCoercible = 91, Add = 20, Sub = 21, SubImm8 = 34, AddNum = 35, SubNum = 36, MulNum = 37, DivNum = 38, AddImm8 = 39, Mul = 22, Div = 23, Mod = 24, Pow = 25, Neg = 26, BitAnd = 27, BitOr = 28, BitXor = 29, BitNot = 30, Shl = 31, Shr = 32, UShr = 33, Lt = 50, Lte = 51, LteImm8 = 60, Gt = 52, Gte = 53, Eq = 54, Neq = 55, StrictEq = 56, StrictNeq = 57, InstanceOf = 58, NewRegExp = 59, Not = 70, TypeOf = 71, Jump = 80, JumpIf = 81, JumpIfNot = 82, JumpBreak = 199, EndFinally = 200, ResetPerIterVar = 201, JumpIfNullish = 176, Throw = 83, Try = 84, Catch = 85, Finally = 86, Jump8 = 87, JumpIf8 = 88, JumpIfNot8 = 89, Move = 90, GetLocal = 100, SetLocal = 101, GetGlobal = 102, SetGlobal = 103, GetUpvalue = 104, SetUpvalue = 105, IncLocal = 106, DecLocal = 107, NewObject = 120, NewArray = 121, GetField = 122, SetField = 123, GetProp = 124, SetProp = 125, Call = 126, CallMethod = 127, NewFunction = 128, CallNew = 129, DeleteProp = 130, HasProperty = 131, GatherRest = 132, ObjectSpread = 133, GetPropertyNames = 134, ArrayExtend = 135, SetProto = 136, GetSuper = 137, ArrayPush = 138, CallSpread = 139, CallMethodSpread = 140, CallNewSpread = 141, GetPrivate = 142, SetPrivate = 143, HasPrivate = 144, Yield = 145, NewGeneratorFunction = 146, NewAsyncFunction = 147, Await = 148, NewAsyncGeneratorFunction = 149, GetIterator = 150, IteratorNext = 151, GetArguments = 152, GetCurrentFunction = 153, CallCurrent = 154, CallCurrent1 = 155, GetNamedProp = 156, SetNamedProp = 157, Call0 = 174, Call1 = 175, Call2 = 177, Call3 = 178, CallNamedMethod = 179, MathSin = 180, MathCos = 181, MathSqrt = 182, MathAbs = 183, MathFloor = 184, MathCeil = 185, MathRound = 186, MathPow = 187, MathMin = 188, MathMax = 189, DefineAccessor = 190, DefinePrivateAccessor = 191, SetMethodProp = 192, Pos = 193, DefineGlobal = 194, DeleteGlobal = 195, ThrowReferenceError = 196, SetGlobalVar = 197, InitGlobalVar = 198, LtJumpIfNot = 158, LtJumpIf = 159, LteJumpIfNot = 160, LteJumpIf = 161, GtJumpIfNot = 162, GtJumpIf = 163, GteJumpIfNot = 164, GteJumpIf = 165, EqJumpIfNot = 166, EqJumpIf = 167, NeqJumpIfNot = 168, NeqJumpIf = 169, StrictEqJumpIfNot = 170, StrictEqJumpIf = 171, StrictNeqJumpIfNot = 172, StrictNeqJumpIf = 173,
}

Variants§

§

Nop = 0

§

End = 1

§

Return = 2

§

LoadConst = 10

§

LoadInt = 11

§

LoadInt8 = 12

§

LoadTrue = 13

§

LoadFalse = 14

§

LoadNull = 15

§

LoadUndefined = 16

§

LoadTdz = 17

§

CheckTdz = 18

§

CheckRef = 19

§

CheckObjectCoercible = 91

§

Add = 20

§

Sub = 21

§

SubImm8 = 34

§

AddNum = 35

§

SubNum = 36

§

MulNum = 37

§

DivNum = 38

§

AddImm8 = 39

§

Mul = 22

§

Div = 23

§

Mod = 24

§

Pow = 25

§

Neg = 26

§

BitAnd = 27

§

BitOr = 28

§

BitXor = 29

§

BitNot = 30

§

Shl = 31

§

Shr = 32

§

UShr = 33

§

Lt = 50

§

Lte = 51

§

LteImm8 = 60

§

Gt = 52

§

Gte = 53

§

Eq = 54

§

Neq = 55

§

StrictEq = 56

§

StrictNeq = 57

§

InstanceOf = 58

§

NewRegExp = 59

§

Not = 70

§

TypeOf = 71

§

Jump = 80

§

JumpIf = 81

§

JumpIfNot = 82

§

JumpBreak = 199

§

EndFinally = 200

§

ResetPerIterVar = 201

§

JumpIfNullish = 176

§

Throw = 83

§

Try = 84

§

Catch = 85

§

Finally = 86

§

Jump8 = 87

§

JumpIf8 = 88

§

JumpIfNot8 = 89

§

Move = 90

§

GetLocal = 100

§

SetLocal = 101

§

GetGlobal = 102

§

SetGlobal = 103

§

GetUpvalue = 104

§

SetUpvalue = 105

§

IncLocal = 106

§

DecLocal = 107

§

NewObject = 120

§

NewArray = 121

§

GetField = 122

§

SetField = 123

§

GetProp = 124

§

SetProp = 125

§

Call = 126

§

CallMethod = 127

§

NewFunction = 128

§

CallNew = 129

§

DeleteProp = 130

§

HasProperty = 131

§

GatherRest = 132

§

ObjectSpread = 133

§

GetPropertyNames = 134

§

ArrayExtend = 135

§

SetProto = 136

§

GetSuper = 137

§

ArrayPush = 138

§

CallSpread = 139

§

CallMethodSpread = 140

§

CallNewSpread = 141

§

GetPrivate = 142

§

SetPrivate = 143

§

HasPrivate = 144

§

Yield = 145

§

NewGeneratorFunction = 146

§

NewAsyncFunction = 147

§

Await = 148

§

NewAsyncGeneratorFunction = 149

§

GetIterator = 150

§

IteratorNext = 151

§

GetArguments = 152

§

GetCurrentFunction = 153

§

CallCurrent = 154

§

CallCurrent1 = 155

§

GetNamedProp = 156

§

SetNamedProp = 157

§

Call0 = 174

§

Call1 = 175

§

Call2 = 177

§

Call3 = 178

§

CallNamedMethod = 179

§

MathSin = 180

§

MathCos = 181

§

MathSqrt = 182

§

MathAbs = 183

§

MathFloor = 184

§

MathCeil = 185

§

MathRound = 186

§

MathPow = 187

§

MathMin = 188

§

MathMax = 189

§

DefineAccessor = 190

§

DefinePrivateAccessor = 191

§

SetMethodProp = 192

§

Pos = 193

§

DefineGlobal = 194

§

DeleteGlobal = 195

§

ThrowReferenceError = 196

§

SetGlobalVar = 197

§

InitGlobalVar = 198

§

LtJumpIfNot = 158

§

LtJumpIf = 159

§

LteJumpIfNot = 160

§

LteJumpIf = 161

§

GtJumpIfNot = 162

§

GtJumpIf = 163

§

GteJumpIfNot = 164

§

GteJumpIf = 165

§

EqJumpIfNot = 166

§

EqJumpIf = 167

§

NeqJumpIfNot = 168

§

NeqJumpIf = 169

§

StrictEqJumpIfNot = 170

§

StrictEqJumpIf = 171

§

StrictNeqJumpIfNot = 172

§

StrictNeqJumpIf = 173

Implementations§

Source§

impl Opcode

Source

pub fn from_u8(v: u8) -> Option<Self>

Source

pub fn from_u8_unchecked(v: u8) -> Self

Source

pub fn instruction_size(op: Opcode) -> usize

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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.