#[repr(u8)]pub enum RegOpCode {
Show 48 variants
LoadConst = 0,
LoadUndefined = 1,
LoadNull = 2,
LoadTrue = 3,
LoadFalse = 4,
Move = 5,
Add = 6,
Sub = 7,
Mul = 8,
Div = 9,
Mod = 10,
Negate = 11,
BitAnd = 12,
BitOr = 13,
BitXor = 14,
BitNot = 15,
ShiftLeft = 16,
ShiftRight = 17,
UShiftRight = 18,
StrictEqual = 19,
StrictNotEqual = 20,
Equal = 21,
NotEqual = 22,
LessThan = 23,
LessEqual = 24,
GreaterThan = 25,
GreaterEqual = 26,
Not = 27,
TypeOf = 28,
UnaryPlus = 29,
GetVar = 30,
SetVar = 31,
DeclareVar = 32,
DeclareLet = 33,
DeclareConst = 34,
InitVar = 35,
InitBinding = 36,
GetProp = 37,
SetProp = 38,
GetElem = 39,
SetElem = 40,
Jump = 41,
JumpIfFalse = 42,
JumpIfTrue = 43,
Call = 44,
CallMethod = 45,
Return = 46,
Halt = 47,
}Expand description
Bytecode opcodes for the register-based VM.
Variants§
LoadConst = 0
dst = constant pool value.
LoadUndefined = 1
dst = undefined.
LoadNull = 2
dst = null.
LoadTrue = 3
dst = true.
LoadFalse = 4
dst = false.
Move = 5
dst = src1.
Add = 6
dst = src1 + src2.
Sub = 7
dst = src1 - src2.
Mul = 8
dst = src1 * src2.
Div = 9
dst = src1 / src2.
Mod = 10
dst = src1 % src2.
Negate = 11
dst = -src1.
BitAnd = 12
dst = src1 & src2.
BitOr = 13
dst = src1 | src2.
BitXor = 14
dst = src1 ^ src2.
BitNot = 15
dst = ~src1.
ShiftLeft = 16
dst = src1 << src2.
ShiftRight = 17
dst = src1 >> src2.
UShiftRight = 18
dst = src1 >>> src2.
StrictEqual = 19
dst = (src1 === src2).
StrictNotEqual = 20
dst = (src1 !== src2).
Equal = 21
dst = (src1 == src2).
NotEqual = 22
dst = (src1 != src2).
LessThan = 23
dst = (src1 < src2).
LessEqual = 24
dst = (src1 <= src2).
GreaterThan = 25
dst = (src1 > src2).
GreaterEqual = 26
dst = (src1 >= src2).
Not = 27
dst = !src1.
TypeOf = 28
dst = typeof src1.
UnaryPlus = 29
dst = +src1.
GetVar = 30
dst = get var by name (imm = name index).
SetVar = 31
set var by name (src1 = value, imm = name index).
DeclareVar = 32
declare var (imm = name index).
DeclareLet = 33
declare let (imm = name index).
DeclareConst = 34
declare const (imm = name index).
InitVar = 35
init var (src1 = value, imm = name index).
InitBinding = 36
init let/const (src1 = value, imm = name index).
GetProp = 37
dst = obj.prop (src1 = obj, imm = name index).
SetProp = 38
obj.prop = value (src1 = obj, src2 = value, imm = name index).
GetElem = 39
dst = obj[key] (src1 = obj, src2 = key).
SetElem = 40
obj[key] = value (dst = value, src1 = obj, src2 = key).
Jump = 41
jump to imm (absolute index).
JumpIfFalse = 42
if !src1 jump to imm.
JumpIfTrue = 43
if src1 jump to imm.
Call = 44
dst = call callee (src1 = callee, imm = arg count).
CallMethod = 45
dst = call method (src1 = object, imm = arg count, src2 = name index).
Return = 46
return src1.
Halt = 47
halt (optional src1 as result).