Hermes Opcodes Table
Hermes Opcodes Table
With the opcode byte value indicated respective to each stable version of the React Native Hermes VM bytecode format, as
well as the auto-generated documentation from the "BytecodeList.def" file from the Hermes VM source tree.
This list of opcodes is used by the hermes-dec open-source reverse engineering project.
Call a function.
Arg1 is the destination of the return
value.
Call 74 74 74 74 74 74 74 74 75 75 77
Arg2 is the closure to invoke.
Arg3 is the number of arguments,
assumed to be found in reverse
order
from the end of the current frame.
Call1 76 76 76 76 76 76 76 76 77 77 79 Reg8, Reg8, Reg8 (total size 3)
Create a closure.
CreateClosure 93 93 94 94 94 94 94 94 96 96 98 Arg1 is the register in which to store
the closure.
Arg2 is the current environment as
loaded by GetEnvironment 0.
Arg3 is index in the function table.
Reg8, Reg8, UInt32 (function_id)
(total size 6)
Create a closure.
CreateClosureLongIndex 94 94 95 95 95 95 95 95 97 97 99 Arg1 is the register in which to store
the closure.
Arg2 is the current environment as
loaded by GetEnvironment 0.
Arg3 is index in the function table.
Reg8 (total size 1)
CreateEnvironment 47 47 47 47 47 47 47 47 48 48 50
Create a new environment, to store
values captured by closures.
Reg8, Reg8, UInt16 (function_id)
(total size 4)
Create a generator.
CreateGenerator 124 125 125 125 125 125 125 130 130 135 Arg1 is the register in which to store
the generator.
Arg2 is the current environment as
loaded by GetEnvironment 0.
Arg3 is index in the function table.
Reg8, Reg8, UInt16 (function_id)
(total size 4)
Create a generator.
CreateGeneratorLongIndex 125 126 126 126 126 126 126 131 131 136 Arg1 is the register in which to store
the generator.
Arg2 is the current environment as
loaded by GetEnvironment 0.
Arg3 is index in the function table.
Reg8, UInt32 (string_id), UInt32
(string_id), UInt32 (total size 13)
SaveGenerator 134 135 135 135 135 138 138 143 143 148 Save the provided value, yield, and
signal the VM to restart execution
at the provided target.
Addr32 (total size 4)
SaveGeneratorLong 135 136 136 136 136 139 139 144 144 149 Save the provided value, yield, and
signal the VM to restart execution
at the provided target.
Reg8, Reg8, Reg8 (total size 3)
ToInt32 112 114 115 115 115 115 115 115 120 120 125 Convert a value to a 32-bit signed
integer.
Arg1 = Arg2 | 0
Reg8, Reg8 (total size 2)
ToNumber 111 113 114 114 114 114 114 114 119 119 123
Convert a value to a number.
Arg1 = Arg2 - 0
Reg8, Reg8 (total size 2)
ToNumeric 124
Convert a value to a numberic.
Arg1 = ToNumeric(Arg2)
TryGetById 52 52 52 52 52 52 52 52 53 53 55 Reg8, Reg8, UInt8, UInt16 (string_id)
(total size 5)
Instruction Bytecode version to opcode Documentation
51 58 59 60 62 71 74 76 83 84 89