openharmony 鸿蒙 arkts-bytecode-fundamentals

2025-06-06 浏览 (1)

Ark Bytecode Fundamentals

Overall Design

Overview

Ark bytecode is a binary file generated by the ArkCompiler from ArkTS/TS/JS code and provided for Ark Runtime to interpret and execute. Bytecode mainly contains Ark bytecode instructions.
This topic introduces the design of these instructions, covering key concepts, specific formats, and meanings to help you understand and work with Ark bytecode instructions effectively.
An Ark bytecode instruction consists of an operation code (instruction name) and a list of parameters. An operation code can be prefix-free or prefixed. Registers, immediate values, string id, method id, and literal id can be used as parameters. In addition, the accumulator can be used as a default parameter in some instructions.
In addition to registers and accumulator, Ark bytecode supports four value storage mechanisms: global variables, module namespaces and variables, lexical environments and variables, and patch variables. Instructions can reference values from these storage locations as parameters.

Terms and Constraints

Terms

The following table lists the terms used in this topic.

TermDescription
accAccumulator, a special register in the Ark bytecode.
bitA binary digit, represented as a bit in this topic.
holeAn uninitialized object or variable.
idIndex, a general term for string id, method id, or literal id.
string idA 16-bit number indexing a string.
method idA 16-bit number indexing a method.
literal idA 16-bit number indexing a literal array.
lexical environmentA semantic environment storing closure variables.
lexical variableA closure variable stored in the lexical environment.

Constraints

  • All code examples provided in this topic adhere to the ArkTS language specifications.
  • This topic is applicable only to Ark bytecode of version 12.0.6.0. The version number is an internal field of the ArkCompiler and does not require your attention.

Bytecode Composition

Operation Codes and Prefixes

Operation codes in Ark bytecode are typically 8-bit values, allowing for up to 256 unique opcodes. However, as the ArkCompiler's functionality has expanded, the number of operation codes has exceeded 256. To accommodate this, the Ark bytecode introduces prefixes, expanding the maximum operation code width from 8 bits to 16 bits. 8-bit operation codes (prefix-free) are used for common instructions, whereas 16-bit operation codes (prefixed) are used for less frequent ones.
Prefixed operation codes are stored in little-endian format, composed of an 8-bit operation code and an 8-bit prefix. During encoding, the operation code is shifted left by 8 bits and then ORed with the prefix.

PrefixMnemonicDescription
0xfethrowConditional/Unconditional throw instruction.
0xfdwideInstructions with wider encoding widths for immediate values, IDs, or register indexes.
0xfcdeprecatedInstructions no longer generated by the ArkCompiler. They are used only for runtime compatibility.
These instructions are not described in the following sections.
0xfbcallruntimeInstructions for calling runtime methods.

The mnemonic form of a prefixed operation code is prefix mnemonic.operation code mnemonic. For example, wide.stlexvar combines the prefix wide (0xfd) with the operation code stlexvar (0x0d), resulting in the prefixed operation code 0x0dfd.

Registers and Accumulator

The Ark Virtual Machine (VM) uses a register-based model with virtual registers. When a register holds a primitive value, it is 64 bits wide; when it holds an object reference, its width adjusts accordingly.
A special invisible register called the accumulator (acc) is used in the Ark bytecode. The acc serves as the default target for many instructions and as a default parameter for others, helping to produce more compact bytecode without consuming additional encoding width.

Example:

function foo(): number {
    return 1;
}

Related instructions in the bytecode:

.function any .foo(any a0, any a1, any a2) {
    ldai 0x1
    return
}

ldai 0x1: loads integer literal 1 to the acc.
return: returns the value in the acc.

immediate values

Some instructions use constants to represent integer values, double-precision floating-point values, or jump offsets. These constants, known as immediate values, can be 8-bit, 16-bit, 32-bit, or 64-bit.

Method, String, and Literal Indexes

The Ark bytecode stores offsets for all methods, strings, and literal arrays used in the source file. Literal arrays contain various literals, such as integer numbers, string offsets, and method offsets. In Ark bytecode instructions, these indexes are 16-bit values, referred to as method indexes (method id), string indexes (string id), and literal indexes (literal id). These indexes are encoded in instructions to reference methods, strings, and literal arrays.

Value Storage Mechanisms

Global Variables

In Script build mode, global variables are stored in a globally unique mapping, with the variable name as the key and its value as the value. Global variables can be accessed using global-related instructions.

Example:

function foo(): void {
    a += 2;
    b = 5;
}

Related instructions in the bytecode:

.function any .foo(any a0, any a1, any a2) {
    tryldglobalbyname 0x0, a
    sta v4
    ldai 0x2
    add2 0x1, v4
    trystglobalbyname 0x2, a
    ldai 0x5
    trystglobalbyname 0x3, b
    ...
}

tryldglobalbyname 0x0, a: loads a global variable named a to the acc. If this variable does not exist, an exception is thrown.
trystglobalbyname 0x2, a: stores the value of the acc to a global variable named a. If this variable does not exist, an exception is thrown.
trystglobalbyname 0x3, b: stores the value of the acc to a global variable named b. If this variable does not exist, an exception is thrown.

NOTE

0x0, 0x2, and 0x3 in the preceding instructions are reserved for internal use in the Ark Runtime.

Module Namespaces and Variables

All module namespaces used in the source file are compiled into arrays, referenced by instructions using indexes. For example, getmodulenamespace 0x1 references the module namespace at index 0x1.
All module variables used in the source file are compiled into arrays, referenced by instructions using indexes. For example, stmodulevar 0x1 references a module variable at index 0x1.
In a function, if the declaration of a module variable is in the same source file as the function, the variable is called a local module variable. Otherwise, it is called an external module variable. For example, ldlocalmodulevar and ldexternalmodulevar are used to load local module variables and external module variables, respectively.
Scenarios for generating module instructions include import and export. The main scenarios are as follows:

  • import * as: module namespace
  • import { }: module variable
  • export: local export

NOTE

Module-related logic is an internal implementation detail of the compiler. As the ArkCompiler evolves, new scenarios involving module instructions may emerge, and existing ones may change due to evolving requirements or code refactoring.

Example:

import { a, b } from "./module_foo"
import * as c from "./module_bar"

export let d: number = 3;

a + b + d;

Related instructions in the bytecode:

.function any .func_main_0(any a0, any a1, any a2) {
    getmodulenamespace 0x1
    ldai 0x3
    stmodulevar 0x0
    ldexternalmodulevar 0x0
    sta v0
    throw.undefinedifholewithname a
    ldexternalmodulevar 0x1
    sta v1
    throw.undefinedifholewithname b
    lda v1
    add2 0x0, v0
    sta v0
    ldlocalmodulevar 0x0
    sta v1
    throw.undefinedifholewithname d
    lda v1
    add2 0x1, v0
    ...
}

getmodulenamespace 0x1: obtains the module namespace (c) of slot 1 and stores it in the acc.
stmodulevar 0x0: stores the values in the acc into slot 0 of the current module.
ldexternalmodulevar 0x0: loads the value (a) of slot 0 of the external module and stores it in the acc.
ldlocalmodulevar 0x0: loads the value (d) of slot 0 of the current local module and stores it in the acc.

Lexical Environments and Lexical Variables

In Ark bytecode, a lexical environment may be considered as an array with multiple slots, and each slot corresponds to one lexical variable. A method may contain multiple lexical environments. Instructions reference lexical variables using the relative nesting level and slot index of the lexical environment. For example, ldlexvar 0x1, 0x2 loads the value from slot 0x2 of the lexical environment one level outside the current lexical environment into the acc.

|xxx|xxx|xxx|xxx|  <-- Lexical environment one level outside the current lexical environment.
         ^
       |------------ ldlexvar 0x1, 0x2

|xxx|xxx|xxx|xxx|  <-- Current lexical environment.

NOTE
The logic related to lexical is used in the compiler. With subsequent evolution of the ArkCompiler, new scenarios involving lexical instructions may emerge. On the other hand, existing lexical instruction-related scenarios may no longer generates lexical instructions as requirements evolve and code is reconstructed. Example:

function foo(): void {
    let a: number = 1;
    function bar(): number {
        return a;
    }
}

Related instructions in the bytecode:

.function any .foo(any a0, any a1, any a2) {
    newlexenv 0x1
    ...
    definefunc 0x0, .bar, 0x0
    sta v3
    ldai 0x1 
    ...
    stlexvar 0x0, 0x0
    ...
}    

.function any .bar(any a0, any a1, any a2) {
    ...
    ldlexvar 0x0, 0x0
    ...
}

newlexenv 0x1: creates a lexical environment with one slot, stores it in the acc, and enters this environment.
stlexvar 0x0, 0x0: stores the value in the acc into slot 0 of the lexical environment 0 level outside the current lexical environment.
ldlexvar 0x0, 0x0: stores the value from slot 0 of the lexical environment 0 level outside the current lexical environment into the acc.

Shared Lexical Environments

Shared lexical environments are a special type of lexical environment Unlike regular lexical environments, each lexical variable in a shared lexical environment is a Sendable object. The ArkCompiler uses shared lexical environments to enable sharing of lexical variables across multiple threads.

Example:

@Sendable
class A { }

@Sendable
class B {
    u: A = new A()
}

Related instructions in the bytecode:

.function any .#~B=#B(any a0, any a1, any a2) {
label_1: 
label_0: 
	callruntime.ldsendablevar 0x0, 0x0
	sta v0
	throw.undefinedifholewithname A
	...
label_2: 
}

.function any .func_main_0(any a0, any a1, any a2) {
label_1: 
label_0: 
	callruntime.newsendableenv 0x1
	...
	callruntime.definesendableclass 0x0, .#~A=#A, _3, 0x0, v0
	callruntime.stsendablevar 0x0, 0x0
	...
label_2: 
}

an instruction callruntime.newsendableenv 0x1: creates a shared lexical environment with one slot and enters this lexical environment.
callruntime.stsendablevar 0x0, 0x0: stores the value in the acc into slot 0 of the lexical environment outside level 0.
callruntime.ldsendablevar 0x0, 0x0: stores the value from slot 0 of the lexical environment 0 level outside the current lexical environment into the acc.

Patch Variables

The ArkCompiler supports patch mode compilation. When a source file is modified, patch mode compilation generates a patch bytecode that, together with the original bytecode, completes the functional update. During patch mode compilation, patch variables generated by the ArkCompiler are stored in a special patch lexical environment. Instructions in the Ark bytecode use slot numbers from the patch lexical environment to reference patch variables. For example, the instruction ldpatchvar 0x1 is used to load the patch variable from slot 1.

Example:

function bar(): void {} // Add a statement and compile the patch.

function foo(): void {
    bar(); // Add a statement and compile the patch.
}

Related instructions in the bytecode:

.function any foo(...) {
    ...
    wide.ldpatchvar 0x0
    sta v4
    lda v4
    callarg0 0x0
    ...
}

.function any patch_main_0(...) {
    newlexenv 0x1
    definefunc 0x1, bar:(any,any,any), 0x0
    wide.stpatchvar 0x0
    ...
}

wide.stpatchvar 0x0: stores the bar function into slot 0 of the patch lexical environment.
wide.ldpatchvar 0x0: stores the value from slot 0 in the patch lexical environment into the acc.

Function Call Specifications

For a method with N formal parameters, the last N+3 registers are used to pass parameters. The first three registers are fixed to represent the function object (FunctionObject), new.target (NewTarget), and this from the lexical environment where the function resides. The subsequent N registers correspond to the N formal parameters.

Example:

function foo(a: number, b: number): void {}

Related instructions in the bytecode:

.function any .foo(any a0, any a1, any a2, any a3, any a4) {
    // a0: FunctionObject
    // a1: NewTarget
    // a2: this 
    // a3: a
    // a4: b
}

Bytecode Format Description

MnemonicSemantic Description
ID168-bit operation code and 16-bit id
IMM168-bit operation code and 16-bit immediate value
IMM16_ID168-bit operation code, 16-bit immediate value, and 16-bit id
IMM16_ID16_ID16_IMM16_V88-bit operation code, 16-bit immediate value, two 16-bit id, 16-bit immediate value, and 8-bit register
IMM16_ID16_IMM88-bit operation code, 16-bit immediate value, 16-bit id, and 8-bit immediate value
IMM16_ID16_V88-bit operation code, 16-bit immediate value, 16-bit id, and 8-bit register
IMM16_IMM168-bit operation code and two 16-bit immediate values
IMM16_IMM8_V88-bit operation code, 16-bit immediate value, 8-bit immediate value, and 8-bit register
IMM16_V88-bit operation code, 16-bit immediate value, and 8-bit register
IMM16_V8_IMM168-bit operation code, 16-bit immediate value, 8-bit register, and 16-bit immediate value
IMM16_V8_V88-bit operation code, 16-bit immediate value, and two 8-bit registers
IMM328-bit operation code and 32-bit immediate value
IMM4_IMM48-bit operation code and two 4-bit immediate values
IMM648-bit operation code and 64-bit immediate value
IMM88-bit operation code and 8-bit immediate value
IMM8_ID168-bit operation code, 8-bit immediate value, and 16-bit id
IMM8_ID16_ID16_IMM16_V88-bit operation code, 8-bit immediate value, two 16-bit id, 16-bit immediate value, and 8-bit register
IMM8_ID16_IMM88-bit operation code, 8-bit immediate value, 16-bit id, 8-bit immediate value
IMM8_ID16_V88-bit operation code, 8-bit immediate value, 16-bit id, and 8-bit register
IMM8_IMM168-bit operation code, 8-bit immediate value, and 16-bit immediate value
IMM8_IMM88-bit operation code and two 8-bit immediate values
IMM8_IMM8_V88-bit operation code, two 8-bit immediate values, and 8-bit register
IMM8_V88-bit operation code, 8-bit immediate value, and 8-bit register
IMM8_V8_IMM168-bit operation code, 8-bit immediate value, 8-bit register, and 16-bit immediate value
IMM8_V8_V88-bit operation code, 8-bit immediate value, and two 8-bit registers
IMM8_V8_V8_V88-bit operation code, 8-bit immediate value, and three 8-bit registers
IMM8_V8_V8_V8_V88-bit operation code, 8-bit immediate value, and four 8-bit registers
NONE8-bit operation code
PREF_IMM1616-bit prefixed operation code, 16-bit immediate value
PREF_IMM16_ID1616-bit prefixed operation code, 16-bit immediate value, and 16-bit id
PREF_IMM16_V816-bit prefixed operation code, 16-bit immediate value, and 8-bit register
PREF_IMM16_V8_V816-bit prefixed operation code, 16-bit immediate value, and two 8-bit registers
PREF_IMM816-bit prefixed operation code and 8-bit immediate value
PREF_NONE16-bit prefixed operation code
PREF_V816-bit prefixed operation code and 8-bit register
PREF_V8_ID1616-bit prefixed operation code, 8-bit register, and 16-bit id
PREF_V8_IMM3216-bit prefixed operation code, 8-bit register, and 32-bit immediate value
V16_V168-bit operation code and two 16-bit registers
V4_V48-bit operation code and two 4-bit registers
V88-bit operation code and 8-bit register
V8_IMM168-bit operation code, 8-bit register, and 16-bit immediate value
V8_IMM88-bit operation code, 8-bit register, and 8-bit immediate value
V8_V88-bit operation code and two 8-bit registers
V8_V8_V88-bit operation code and three 8-bit registers
V8_V8_V8_V88-bit operation code and four 8-bit registers

Bytecode Summary

The table below summarizes all Ark bytecode instructions in the current version. The register index, immediate value, and id are described using a character to represent each four-bit width.
For example, consider the instruction defineclasswithbuffer RR, @AAAA, @BBBB, +CCCC, vDD:

  • defineclasswithbuffer: mnemonic for the operation code.
  • RR: 8-bit reserved number used internally during the Ark runtime. The number mentioned here is just an example showing a complete instruction format.
  • @AAAA, @BBBB: 16-bit id
  • +CCCC: 16-bit immediate value
  • vDD: 8-bit register index
Operation CodeFormatMnemonic/SyntaxParametersDescription
0x00NONEldundefinedLoads undefined to the acc.
0x01NONEldnullLoads null to the acc.
0x02NONEldtrueLoads true to the acc.
0x03NONEldfalseLoads false to the acc.
0x04NONEcreateemptyobjectCreates an empty object and stores it in the acc.
0x05IMM8createemptyarray RRR: 8-bit reserved number used in Ark runtimeCreates an empty array and stores it in the acc.
0x06IMM8_ID16createarraywithbuffer RR, @AAAAR: 8-bit reserved number used in Ark runtime
A: 16-bit literal id
Uses the literal array corresponding to index A to create an array object and stores it in the acc.
0x07IMM8_ID16createobjectwithbuffer RR, @AAAAR: 8-bit reserved number used in Ark runtime
A: 16-bit literal id
Uses the literal array corresponding to index A to create an object and stores it in the acc.
0x08IMM8_IMM8_V8newobjrange RR, +AA, vBBR: 8-bit reserved number used in Ark runtime
A: number of parameters
B: class object
B + 1, ..., B + A - 1: parameter passed to the constructor
Uses B + 1, ..., B + A - 1 as a parameter to create an instance of class B and stores it in the acc.
0x09IMM8newlexenv +AAA: number of slots in the lexical environmentCreates a lexical environment with slot A, stores it in the acc, and enters the lexical environment.
0x0aIMM8_V8add2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A + acc and stores the result in the acc.
0x0bIMM8_V8sub2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A - acc and stores the result in the acc.
0x0cIMM8_V8mul2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A * acc and stores the result in the acc.
0x0dIMM8_V8div2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A / acc and stores the result in the acc.
0x0eIMM8_V8mod2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A % acc and stores the result in the acc.
0x0fIMM8_V8eq RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A == acc and stores the result in the acc.
0x10IMM8_V8noteq RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A != acc and stores the result in the acc.
0x11IMM8_V8less RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A < acc and stores the result in the acc.
0x12IMM8_V8lesseq RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A <= acc and stores the result in the acc.
0x13IMM8_V8greater RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A > acc and stores the result in the acc.
0x14IMM8_V8greatereq RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A >= acc and stores the result in the acc.
0x15IMM8_V8shl2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A << acc and stores the result in the acc.
0x16IMM8_V8shr2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A >>> acc and stores the result in the acc.
0x17IMM8_V8ashr2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A >> acc and stores the result in the acc.
0x18IMM8_V8and2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A & acc and stores the result in the acc.
0x19IMM8_V8or2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A |acc and stores the result in the acc.
0x1aIMM8_V8xor2 RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A ^ acc and stores the result in the acc.
0x1bIMM8_V8exp RR, vAADefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
A: operand
Calculates A ** acc and stores the result in the acc.
0x1cIMM8typeof RRDefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
Calculates typeof acc and stores the result in the acc.
0x1dIMM8tonumber RRDefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
Uses the acc as a parameter, executes ToNumber, and stores the result in the acc.
0x1eIMM8tonumeric RRDefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
Uses the acc as a parameter, executes ToNumeric, and stores the result in the acc.
0x1fIMM8neg RRDefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
Calculates -acc and stores the result in the acc.
0x20IMM8not RRDefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
Calculates ~acc and stores the result in the acc.
0x21IMM8inc RRDefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
Calculates acc + 1 and stores the result in the acc.
0x22IMM8dec RRDefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
Calculates acc - 1 and stores the result in the acc.
0x23NONEistrueDefault input parameter: acc: objectCalculates acc == true and stores the result in the acc.
0x24NONEisfalseDefault input parameter: acc: objectCalculates acc == false and stores the result in the acc.
0x25IMM8_V8isin RR, vAADefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
A: Object
Calculates A in acc and stores the result in the acc.
0x26IMM8_V8instanceof RR, vAADefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
A: Object
Calculates A instanceof acc and stores the result in the acc.
0x27IMM8_V8strictnoteq RR, vAADefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
A: Object
Calculates acc !== A and stores the result in the acc.
0x28IMM8_V8stricteq RR, vAADefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
A: Object
Calculates acc === A and stores the result in the acc.
0x29IMM8callarg0 RRDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
Directly calls the function object stored in the acc without passing parameters and stores the result in the acc.
0x2aIMM8_V8callarg1 RR, vAADefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: Parameter
Uses A as a parameter to call the function object stored in the acc and stores the result in the acc.
0x2bIMM8_V8_V8callargs2 RR, vAA, vBBDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A and B: parameters
Uses A and B as parameters to call the function object stored in the acc and stores the result in the acc.
0x2cIMM8_V8_V8_V8callargs3 RR, vAA, vBB, vCCDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A, B, C: parameter
Uses A, B, and C as parameters to call the function object stored in the acc and stores the result in the acc.
0x2dIMM8_V8callthis0 RR, vAADefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: Object
Sets this to A, calls the function object stored in the acc without passing parameters, and stores the result in the acc.
0x2eIMM8_V8_V8callthis1 RR, vAA, vBBDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: Object
B: parameter
Sets this to A, calls the function object stored in the acc by setting B as a parameter, and stores the result in the acc.
0x2fIMM8_V8_V8_V8callthis2 RR, vAA, vBB, vCCDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: Object
B, C: parameter
Sets this to A, calls the function object stored in the acc by setting B and C as parameters, and stores the result in the acc.
0x30IMM8_V8_V8_V8_V8callthis3 RR, vAA, vBB, vCC, vDDDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: Object
B, C, D: parameter
Sets this to A, calls the function object stored in the acc by setting B, C, and D as parameters, and stores the result in the acc.
0x31IMM8_IMM8_V8callthisrange RR, +AA, vBBDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: number of parameters
B: object
B + 1, ..., B + A: parameter
Sets this to B, calls the function object stored in the acc by setting B + 1, ..., B + A as a parameter, and stores the result in the acc.
0x32IMM8_IMM8_V8supercallthisrange RR, +AA, vBBR: 8-bit reserved number used in Ark runtime
A: number of parameters
B, ..., B + A - 1: parameter
Uses B, ..., B + A - 1 as a parameter to call the super function and stores the result in the acc.
When the value of A is 0, the value of B is undefined.
This instruction appears only in non-arrow functions.
0x33IMM8_ID16_IMM8definefunc RR, @AAAA, +BBR: 8-bit reserved number used in Ark runtime
A: method id
B: number of formal parameters of method A
Creates the function object of method A and stores it in the acc.
0x34IMM8_ID16_IMM8definemethod RR, @AAAA, +BBDefault input parameter: acc: class object or its prototype. When the static method is used, the parameter is a class object in the acc.
R: 8-bit reserved number used in Ark runtime
A: method id
B: number of formal parameters of method A
Creates the function object of method A, sets the object in the acc to the HomeObject property of the function object, and stores this function object in the acc.
0x35IMM8_ID16_ID16_IMM16_V8defineclasswithbuffer RR, @AAAA, @BBBB, +CCCC, vDDR: 8-bit reserved number used in Ark runtime
A: method id of the constructor of a class
B: literal id
C: number of formal parameters of method A
D: parent class
Uses the literal array corresponding to index B and parent class D to create a class object of A and stores it in the acc.
0x36V8getnextpropname vAAA: iteratorExecutes the next method of for-in iterator A and stores the result in the acc.
0x37IMM8_V8ldobjbyvalue RR, vAADefault input parameter: acc: property key
R: 8-bit reserved number used in Ark runtime
A: Object
Loads the property whose key is acc of object A and stores the result in the acc.
0x38IMM8_V8_V8stobjbyvalue RR, vAA, vBBDefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0x39IMM8_V8ldsuperbyvalue RR, vAADefault input parameter: acc: property key
R: 8-bit reserved number used in Ark runtime
A: Object
In the current function, obtains the property whose key of super is acc and stores the property in the acc. If the property is of an accessor, the object in A is used as the this parameter when the getter function of the property is called.
0x3aIMM8_IMM16ldobjbyindex RR, +AAAADefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
A: property key
Loads the property whose key is A of the object stored in the acc and stores the property in the acc.
0x3bIMM8_V8_IMM16stobjbyindex RR, vAA, +BBBBDefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0x3cIMM4_IMM4ldlexvar +A, +BA: lexical environment level
B: slot number
Stores the value of slot B in the lexical environment beyond A levels in the acc.
0x3dIMM4_IMM4stlexvar +A, +BDefault input parameter: acc: value
A: lexical environment level
B: slot number
Stores the value in the acc to slot B in the lexical environment beyond A levels.
0x3eID16lda.str @AAAAA: string idStores the string corresponding to index A to acc.
0x3fIMM8_ID16tryldglobalbyname RR, @AAAAR: 8-bit reserved number used in Ark runtime
A: string id
Stores the global variable whose name is the string corresponding to index A in the acc. If the global variable named A does not exist, an exception is thrown.
0x40IMM8_ID16trystglobalbyname RR, @AAAADefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: string id
Stores the value in the acc to the global variable whose name is the string corresponding to index A. If the global variable named A does not exist, an exception is thrown.
0x41IMM16_ID16ldglobalvar RRRR, @AAAAR: 16-bit reserved number used in Ark runtime
A: string id
Stores the value of the global variable whose name is the string corresponding to index A in the acc. The variable must exist.
0x42IMM8_ID16ldobjbyname RR, @AAAADefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
A: string id
Loads the property whose key of the object stored in the acc is the string corresponding to index A and stores the property in the acc.
0x43IMM8_ID16_V8stobjbyname RR, @AAAA, vBBDefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: string id
B: object
Stores the value in the acc to the property whose key of object B is the string corresponding to index A.
0x44V4_V4mov vA, vBA, B: register indexCopies the contents in register B to register A.
0x45V8_V8mov vAA, vBBA, B: register indexCopies the contents in register B to register A.
0x46IMM8_ID16ldsuperbyname RR, @AAAADefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
A: string id
In the current function, obtains the property whose key of super is the string corresponding to index A and stores the property in the acc. If the property is of an accessor, the object in the acc is used as the this parameter when the getter function of the property is called.
0x47IMM16_ID16stconsttoglobalrecord RRRR, @AAAADefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: string id
Stores the value in the acc to the constant of the string corresponding to index A defined by const in the global variable.
0x48IMM16_ID16sttoglobalrecord RRRR, @AAAADefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: string id
Stores the value in the acc to the variable of the string corresponding to index A defined by let in the global variable.
0x49IMM8_ID16ldthisbyname RR, @AAAAR: 8-bit reserved number used in Ark runtime
A: string id
Loads the property whose key of this is the string corresponding to index A and stores the result in the acc.
0x4aIMM8_ID16stthisbyname RR, @AAAADefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: string id
Stores the value in the acc to the property whose key of this is the string corresponding to index A.
0x4bIMM8ldthisbyvalue RRDefault input parameter: acc: property key
R: 8-bit reserved number used in Ark runtime
Loads the property whose key of this is acc and stores the result in the acc.
0x4cIMM8_V8stthisbyvalue RR, vAADefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: property key
Stores the value in the acc to the property whose key of this is A.
0x4dIMM8jmp +AAA: signed branch offsetJumps to branch A unconditionally.
0x4eIMM16jmp +AAAAA: signed branch offsetJumps to branch A unconditionally.
0x4fIMM8jeqz +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc == 0 and jumps to branch A if it is true.
0x50IMM16jeqz +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc == 0 and jumps to branch A if it is true.
0x51IMM8jnez +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc != 0 and jumps to branch A if it is true.
0x52IMM8jstricteqz +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc === 0 and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x53IMM8jnstricteqz +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc !== 0 and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x54IMM8jeqnull +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc == null and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x55IMM8jnenull +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc != null and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x56IMM8jstricteqnull +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc === null and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x57IMM8jnstricteqnull +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc !== null and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x58IMM8jequndefined +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc == undefined and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x59IMM8jneundefined +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc != undefined and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x5aIMM8jstrictequndefined +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc === undefined and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x5bIMM8jnstrictequndefined +AADefault input parameter: acc: value
A: signed branch offset
Calculates acc !== undefined and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x5cV8_IMM8jeq vAA, +BBDefault input parameter: acc: value
A: value
B: signed branch offset
Calculates acc == A and jumps to branch B if it is true.
The instruction feature is disabled and is unavailable currently.
0x5dV8_IMM8jne vAA, +BBDefault input parameter: acc: value
A: value
B: signed branch offset
Calculates acc != A and jumps to branch B if it is true.
The instruction feature is disabled and is unavailable currently.
0x5eV8_IMM8jstricteq vAA, +BBDefault input parameter: acc: object
A: Object
B: signed branch offset
Calculates acc === A and jumps to branch B if it is true.
The instruction feature is disabled and is unavailable currently.
0x5fV8_IMM8jnstricteq vAA, +BBDefault input parameter: acc: object
A: Object
B: signed branch offset
Calculates acc !== A and jumps to branch B if it is true.
The instruction feature is disabled and is unavailable currently.
0x60V8lda vAAA: register indexStores the contents of register A in the acc.
0x61V8sta vAADefault input parameter: acc
A: register index
Stores the contents of acc in register A.
0x62IMM32ldai +AAAAAAAAA: constant literalStores the integer literal A in the acc.
0x63IMM64fldai +AAAAAAAAAAAAAAAAA: constant literalStores the double-precision floating-point literal A in the acc.
0x64NONEreturnDefault input parameter: acc: valueReturns the value in the acc.
0x65NONEreturnundefinedReturns undefined.
0x66NONEgetpropiteratorDefault input parameter: acc: objectStores the for-in iterator of the object in the acc.
0x67IMM8getiterator RRDefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
Executes the GetIterator (acc, sync) method and stores the result in the acc.
0x68IMM8_V8closeiterator RR, vAAR: 8-bit reserved number used in Ark runtime
A: Object
Uses A of the iteratorRecord type as a parameter to execute IteratorClose and stores the result in the acc.
0x69NONEpoplexenvJumps out of the current lexical environment and enters the outer lexical environment.
0x6aNONEldnanStores the nan value in the acc.
0x6bNONEldinfinityStores the infinity value in the acc.
0x6cNONEgetunmappedargsStores the arguments of the current function in the acc.
0x6dNONEldglobalStores the global object in the acc.
0x6eNONEldnewtargetStores the NewTarget implicit parameter of the current function in the acc.
The instruction feature is disabled and is unavailable currently.
0x6fNONEldthisStores the this value in the acc.
0x70NONEldholeStores the hole value in the acc.
0x71IMM8_ID16_IMM8createregexpwithliteral RR, @AAAA, +BBR: 8-bit reserved number used in Ark runtime
A: string id
B: regular expression modifier
Uses the string corresponding to index A and the modifier corresponding to index B to create a regular expression and stores it in the acc.
The correspondence between B and a specified modifier is: 0 (default value with no modifier), 1 (g), 2 (i), 4 (m), 8 (s), 16 (u), 32 (y); B may also refer to a combination of modifiers that comply with syntax specifications, for example, 3 and its modifier is gi.
0x72IMM16_ID16_IMM8createregexpwithliteral RRRR, @AAAA, +BBR: 16-bit reserved number used in Ark runtime
A: string id
B: regular expression modifier
Uses the string corresponding to index A and the modifier corresponding to index B to create a regular expression and stores it in the acc.
The correspondence between B and a specified modifier is: 0 (default value with no modifier), 1 (g), 2 (i), 4 (m), 8 (s), 16 (u), 32 (y); B may also refer to a combination of modifiers that comply with syntax specifications, for example, 3 and its modifier is gi.
0x73IMM8_IMM8_V8callrange RR, +AA, vBBDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: number of parameters
B, ..., B + A - 1: parameter
Uses B, ..., B + A - 1 as a parameter to call the function object stored in the acc and stores the result in the acc.
0x74IMM16_ID16_IMM8definefunc RRRR, @AAAA, +BBR: 16-bit reserved number used in Ark runtime
A: method id
B: number of formal parameters of method A
Creates the function object of method A and stores it in the acc.
0x75IMM16_ID16_ID16_IMM16_V8defineclasswithbuffer RRRR, @AAAA, @BBBB, +CCCC, vDDR: 16-bit reserved number used in Ark runtime
A: method id of the constructor of a class
B: literal id
C: number of formal parameters of method A
D: parent class
Uses the literal array corresponding to index B and parent class D to create a class object of A and stores it in the acc.
0x76IMM8gettemplateobject RRDefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
Executes GetTemplateObject (acc) and stores the result in the acc.
0x77IMM8_V8setobjectwithproto RR, vAADefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
A: value
Sets the __proto__ property of the object stored in the acc to A.
0x78IMM8_V8_V8stownbyvalue RR, vAA, vBBDefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0x79IMM8_V8_IMM16stownbyindex RR, vAA, +BBBBDefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0x7aIMM8_ID16_V8stownbyname RR, @AAAA, vBBDefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: string id
B: object
Stores the value in the acc to the property whose key of object B is the string corresponding to index A.
0x7bIMM8getmodulenamespace +AAA: module indexExecutes the GetModuleNamespace instruction for module A and stores the result in the acc.
0x7cIMM8stmodulevar +AADefault input parameter: acc: value
A: slot number
Stores the value in the acc to the module variable of slot A.
0x7dIMM8ldlocalmodulevar +AAA: slot numberStores the local module variables of slot A in the acc.
0x7eIMM8ldexternalmodulevar +AAA: slot numberStores the external module variable of slot A in the acc.
0x7fIMM16_ID16stglobalvar RRRR, @AAAADefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: string id
Stores the value in the acc to the global variable whose name is the string corresponding to index A. This variable must exist.
0x80IMM16createemptyarray RRRRR: 16-bit reserved number used in Ark runtimeCreates an empty array and stores it in the acc.
0x81IMM16_ID16createarraywithbuffer RRRR, @AAAAR: 16-bit reserved number used in Ark runtime
A: literal id
Uses the literal array corresponding to index A to create an array object and stores it in the acc.
0x82IMM16_ID16createobjectwithbuffer RRRR, @AAAAR: 16-bit reserved number used in Ark runtime
A: literal id
Uses the literal array corresponding to index A to create an object and stores it in the acc.
0x83IMM16_IMM8_V8newobjrange RRRR, +AA, vBBR: 16-bit reserved number used in Ark runtime
A: number of parameters
B: class object
B + 1, ..., B + A - 1: parameter passed to the constructor
Uses B + 1, ..., B + A - 1 as a parameter to create an instance of class B and stores it in the acc.
0x84IMM16typeof RRRRDefault input parameter: acc: object
R: 16-bit reserved number used in Ark runtime
Calculates typeof acc and stores the result in the acc.
0x85IMM16_V8ldobjbyvalue RRRR, vAADefault input parameter: acc: property key
R: 16-bit reserved number used in Ark runtime
A: Object
Loads the property whose key is acc of object A and stores the result in the acc.
0x86IMM16_V8_V8stobjbyvalue RRRR, vAA, vBBDefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0x87IMM16_V8ldsuperbyvalue RRRR, vAADefault input parameter: acc: property key
R: 16-bit reserved number used in Ark runtime
A: Object
In the current function, obtains the property whose key of super is acc and stores the property in the acc. If the property is of an accessor, the object in A is used as the this parameter when the getter function of the property is called.
0x88IMM16_IMM16ldobjbyindex RRRR, +AAAADefault input parameter: acc: object
R: 16-bit reserved number used in Ark runtime
A: property key
Loads the property whose key is A of the object stored in the acc and stores the property in the acc.
0x89IMM16_V8_IMM16stobjbyindex RRRR, vAA, +BBBBDefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0x8aIMM8_IMM8ldlexvar +AA, +BBA: lexical environment level
B: slot number
Stores the value of slot B in the lexical environment beyond A levels in the acc.
0x8bIMM8_IMM8stlexvar +AA, +BBDefault input parameter: acc: value
A: lexical environment level
B: slot number
Stores the value in the acc to slot B in the lexical environment beyond A levels.
0x8cIMM16_ID16tryldglobalbyname RRRR, @AAAAR: 16-bit reserved number used in Ark runtime
A: string id
Stores the global variable whose name is the string corresponding to index A in the acc. If the global variable named A does not exist, an exception is thrown.
0x8dIMM16_ID16trystglobalbyname RRRR, @AAAADefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: string id
Stores the value in the acc to the global variable whose name is the string corresponding to index A. If the global variable named A does not exist, an exception is thrown.
0x8eIMM8_ID16_V8stownbynamewithnameset RR, @AAAA, vBBDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: string id
B: object
Stores the function object in the acc to the property whose key of object B is the string corresponding to index A and sets the function name to the string corresponding to index A.
0x8fV16_V16mov vAAAA, vBBBBA, B: register indexCopies the contents in register B to register A.
0x90IMM16_ID16ldobjbyname RRRR, @AAAADefault input parameter: acc: object
R: 16-bit reserved number used in Ark runtime
A: string id
Loads the property whose key of the object stored in the acc is the string corresponding to index A and stores the property in the acc.
0x91IMM16_ID16_V8stobjbyname RRRR, @AAAA, vBBDefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: string id
B: object
Stores the value in the acc to the property whose key of object B is the string corresponding to index A.
0x92IMM16_ID16ldsuperbyname RRRR, @AAAADefault input parameter: acc: object
R: 16-bit reserved number used in Ark runtime
A: string id
In the current function, obtains the property whose key of super is the string corresponding to index A and stores the property in the acc. If the property is of an accessor, the object in the acc is used as the this parameter when the getter function of the property is called.
0x93IMM16_ID16ldthisbyname RRRR, @AAAAR: 16-bit reserved number used in Ark runtime
A: string id
Loads the property whose key of this is the string corresponding to index A and stores the result in the acc.
0x94IMM16_ID16stthisbyname RRRR, @AAAADefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: string id
Stores the value in the acc to the property whose key of this is the string corresponding to index A.
0x95IMM16ldthisbyvalue RRRRDefault input parameter: acc: property key
R: 16-bit reserved number used in Ark runtime
Loads the property whose key of this is acc and stores the result in the acc.
0x96IMM16_V8stthisbyvalue RRRR, vAADefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: property key
Stores the value in the acc to the property whose key of this is A.
0x97V8asyncgeneratorreject vAADefault input parameter: acc: exception
A: generator
Uses the exception stored in generator A and the acc, executes AsyncGeneratorReject, and stores the result in the acc.
0x98IMM32jmp +AAAAAAAAA: signed branch offsetJumps to branch A unconditionally.
0x99IMM8_V8_V8stownbyvaluewithnameset RR, vAA, vBBDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key of object A is B and set the function name to B.
0x9aIMM32jeqz +AAAAAAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc == 0 and jumps to branch A if it is true.
0x9bIMM16jnez +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc != 0 and jumps to branch A if it is true.
0x9cIMM32jnez +AAAAAAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc != 0 and jumps to branch A if it is true.
0x9dIMM16jstricteqz +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc === 0 and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x9eIMM16jnstricteqz +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc !== 0 and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0x9fIMM16jeqnull +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc == null and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0xa0IMM16jnenull +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc != null and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0xa1IMM16jstricteqnull +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc === null and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0xa2IMM16jnstricteqnull +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc !== null and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0xa3IMM16jequndefined +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc == undefined and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0xa4IMM16jneundefined +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc != undefined and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0xa5IMM16jstrictequndefined +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc === undefined and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0xa6IMM16jnstrictequndefined +AAAADefault input parameter: acc: value
A: signed branch offset
Calculates acc !== undefined and jumps to branch A if it is true.
The instruction feature is disabled and is unavailable currently.
0xa7V8_IMM16jeq vAA, +BBBBDefault input parameter: acc: value
A: value
B: signed branch offset
Calculates acc == A and jumps to branch B if it is true.
The instruction feature is disabled and is unavailable currently.
0xa8V8_IMM16jne vAA, +BBBBDefault input parameter: acc: value
A: value
B: signed branch offset
Calculates acc != A and jumps to branch B if it is true.
The instruction feature is disabled and is unavailable currently.
0xa9V8_IMM16jstricteq vAA, +BBBBDefault input parameter: acc: value
A: value
B: signed branch offset
Calculates acc === A and jumps to branch B if it is true.
The instruction feature is disabled and is unavailable currently.
0xaaV8_IMM16jnstricteq vAA, +BBBBDefault input parameter: acc: value
A: value
B: signed branch offset
Calculates acc !== A and jumps to branch B if it is true.
The instruction feature is disabled and is unavailable currently.
0xabIMM16getiterator RRRRDefault input parameter: acc: object
R: 16-bit reserved number used in Ark runtime
Executes the GetIterator (acc, sync) method and stores the result in the acc.
0xacIMM16_V8closeiterator RRRR, vAAR: 16-bit reserved number used in Ark runtime
A: Object
Uses A of the iteratorRecord type as a parameter to execute IteratorClose and stores the result in the acc.
0xadNONEldsymbolLoad the Symbol object in acc.
0xaeNONEasyncfunctionenterCreates an asynchronous function object and store the object in the acc.
0xafNONEldfunctionLoads the current function object in the acc.
0xb0NONEdebuggerPauses execution during debugging.
0xb1V8creategeneratorobj vAAA: function objectUses function object A to create a generator and stores it in the acc.
0xb2V8_V8createiterresultobj vAA, vBBA: Object
B: Boolean value
Sets value A and done B as parameters to execute CreateIterResultObject instruction and stores the result in the acc.
0xb3IMM8_V8_V8createobjectwithexcludedkeys +AA, vBB, vCCA: number of range registers
B: object
C, ..., C + A: property key value.
Based on object B, creates an object excluding the key C, ..., C + A and stores it in the acc.
This instruction supports object creation by using destructor and extension syntax.
0xb4IMM8_V8newobjapply RR, vAADefault input parameter: acc: parameter list
R: 8-bit reserved number used in Ark runtime
A: class object
Uses the parameter list stored in the acc to create an instance of class A and stores it in the acc.
0xb5IMM16_V8newobjapply RRRR, vAADefault input parameter: acc: parameter list
R: 16-bit reserved number used in Ark runtime
A: class object
Uses the parameter list stored in the acc to create an instance of class A and stores it in the acc.
0xb6IMM8_ID16newlexenvwithname +AA, @BBBBA: number of slots in the lexical environment
B: literal id
Uses the lexical variable name stored in the literal array corresponding to index B to create a lexical environment with A slots, stores this lexical environment in the acc, and enters the lexical environment.
0xb7V8createasyncgeneratorobj vAAA: function objectCreates an asynchronous generator based on function object A and stores it in the acc.
0xb8V8_V8_V8asyncgeneratorresolve vAA, vBB, vCCA: generator
B: object
C: boolean value
Uses generator A, value B, and done C as parameters to execute AsyncGeneratorResolve and stores the result in the acc.
0xb9IMM8_V8supercallspread RR, vAADefault input parameter: acc: class object
R: 8-bit reserved number used in Ark runtime
A: parameter list
Uses parameter list A as a parameter, calls the parent class constructor of the class stored in the acc, and stores the result in the acc.
0xbaIMM8_V8_V8apply RR, vAA, vBBDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: Object
B: parameter list
Sets this to A, use parameter list B as a parameter, calls the function object stored in the acc, and stores the return value in the acc.
0xbbIMM8_IMM8_V8supercallarrowrange RR, +AA, vBBDefault input parameter: acc: class object
R: 8-bit reserved number used in Ark runtime
A: number of parameters
B, ..., B + A - 1: parameter
Uses B, ..., B + A - 1 as a parameter to call the constructor function of the parent class of the class stored in the acc and stores the result in the acc.
If the value of A is 0, B is undefined.
This instruction appears only in arrow functions.
0xbcV8_V8_V8_V8definegettersetterbyvalue vAA, vBB, vCC, vDDDefault input parameter: acc: boolean value, indicating whether to set a name for the accessor.
A: Object
B: property key
C: getter function object
D: setter function object
Uses getter method C and setter method D as parameters to define the accessor of the property whose key of object A is B and stores the result object in the acc.
If C is undefined and D is undefined, getter and setter are not set respectively.
0xbdNONEdynamicimportDefault input parameter: acc: valueUses the value in the acc as a parameter, executes ImportCalls, and stores the result in the acc.
0xbeIMM16_ID16_IMM8definemethod RRRR, @AAAA, +BBDefault input parameter: acc: class object or its prototype. When the static method is used, the parameter is a class object in the acc.
R: 16-bit reserved number used in Ark runtime
A: method id
B: number of formal parameters of method A
Creates the function object of method A, sets the object in the acc to the HomeObject property of the function object, and stores this function object in the acc.
0xbfNONEresumegeneratorDefault input parameter: acc: generatorExecutes GeneratorResume based on the generator stored in the acc and stores the result in the acc.
0xc0NONEgetresumemodeDefault input parameter: acc: generatorAfter the generator finishes executing, obtains the restored value and stores it in the acc.
0xc1IMM16gettemplateobject RRRRDefault input parameter: acc: object
R: 16-bit reserved number used in Ark runtime
Executes GetTemplateObject (acc) and stores the result in the acc.
0xc2V8delobjprop vAADefault input parameter: acc: property key
A: Object
Deletes the property whose key is acc of object A.
0xc3V8suspendgenerator vAADefault input parameter: acc: value
A: generator
Uses the value stored in the acc to suspend generator A and stores the result in the acc.
0xc4V8asyncfunctionawaituncaught vAADefault input parameter: acc: value
A: function object
Uses the function object A and the value in the acc to execute AwaitExpression and stores the result in the acc.
0xc5V8copydataproperties vAADefault input parameter: acc: object
A: target object
Copies all properties of the object stored in the acc to A and stores A in the acc.
0xc6V8_V8starrayspread vAA, vBBDefault input parameter: acc: value
A: array
B: array index
Stores the value in the acc to the position starting with index B of array A in the format of SpreadElement, and stores the length of the result array in the acc.
0xc7IMM16_V8setobjectwithproto RRRR, vAADefault input parameter: acc: object
R: 16-bit reserved number used in Ark runtime
A: value
Sets the __proto__ property of the object stored in the acc to A.
0xc8IMM16_V8_V8stownbyvalue RRRR, vAA, vBBDefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0xc9IMM8_V8_V8stsuperbyvalue RR, vAA, vBBDefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: Object
B: property key
In the current function, stores the value in the acc to the property whose key of super is B. If the property is of an accessor, the object in A is used as the this parameter when the setter function of the property is called.
0xcaIMM16_V8_V8stsuperbyvalue RRRR, vAA, vBBDefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: Object
B: property key
In the current function, stores the value in the acc to the property whose key of super is B. If the property is of an accessor, the object in A is used as the this parameter when the setter function of the property is called.
0xcbIMM16_V8_IMM16stownbyindex RRRR, vAA, +BBBBDefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0xccIMM16_ID16_V8stownbyname RRRR, @AAAA, vBBDefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: string id
B: object
Stores the value in the acc to the property whose key of object B is the string corresponding to index A.
0xcdV8asyncfunctionresolve vAADefault input parameter: acc: value
A: asynchronous function object
Uses the value in the acc to parse the Promise object of object A and stores the result in the acc.
0xceV8asyncfunctionreject vAADefault input parameter: acc: value
A: asynchronous function object
Uses the value in the acc to reject the Promise object of object A and stores the result in the acc.
0xcfIMM8copyrestargs +AAA: position of the rest parameter in the formal parameter listCopies the rest parameters and stores the parameter array copy in the acc.
0xd0IMM8_ID16_V8stsuperbyname RR, @AAAA, vBBDefault input parameter: acc: value
R: 8-bit reserved number used in Ark runtime
A: string id
B: object
In the current function, stores the value in the acc to the property whose key of super is the string corresponding to index A.
If the property is of an accessor, the object in B is used as the this parameter when the setter function of the property is called.
0xd1IMM16_ID16_V8stsuperbyname RRRR, @AAAA, vBBDefault input parameter: acc: value
R: 16-bit reserved number used in Ark runtime
A: string id
B: object
In the current function, stores the value in the acc to the property whose key of super is the string corresponding to index A.
If the property is of an accessor, the object in B is used as the this parameter when the setter function of the property is called.
0xd2IMM16_V8_V8stownbyvaluewithnameset RRRR, vAA, vBBDefault input parameter: acc: function object
R: 8-bit reserved number used in Ark runtime
A: Object
B: property key
Stores the value in the acc to the property whose key of object A is B and set the function name to B.
0xd3ID16ldbigint @AAAAA: string idCreates a value of the BigInt type based on the string corresponding to index A and stores the value in the acc.
0xd4IMM16_ID16_V8stownbynamewithnameset RRRR, @AAAA, vBBDefault input parameter: acc: function object
R: 16-bit reserved number used in Ark runtime
A: string id
B: object
Stores the function object in the acc to the property whose key of object B is the string corresponding to index A and sets the function name to the string corresponding to index A.
0xd5NONEnopNo operation.
0xd6IMM8setgeneratorstate +AADefault input parameter: acc: generator object
A: generator state
Sets the generator state stored in the acc to A. For details, see GeneratorState and AsyncGeneratorState.
A may have the following values: undefined(0x0), suspendedStart(0x1), suspendedYield(0x2), executing(0x3), completed (0x4), and awaitingReturn (0x5).
0xd7IMM8getasynciterator RRDefault input parameter: acc: object
R: 8-bit reserved number used in Ark runtime
Executes the GetIterator (acc, async) and stores the result in the acc.
0xd8IMM8_IMM16_IMM16ldprivateproperty RR, +AAAA, +BBBBDefault input parameter: acc: object
A: lexical environment level
B: slot number
Loads and sets the value of slot B in the lexical environment beyond A levels as the property key, and stores the value corresponding to the key of the object in the acc.
0xd9IMM8_IMM16_IMM16_V8stprivateproperty RR, +AAAA, +BBBB, vCCA: lexical environment level
B: slot number
C: object
Loads the value of slot B in the lexical environment beyond A levels as the property key and stores the value in the acc to the key of the object C stored in the acc.
0xdaIMM8_IMM16_IMM16testin RR, +AAAA, +BBBBDefault input parameter: acc: object
A: lexical environment level
B: slot number
Loads the value of slot B in the lexical environment beyond A levels, calculates whether the value is in acc, and stores the result in the acc.
0xdbIMM8_ID16_V8definefieldbyname RR, @AAAA, vBBDefault input parameter: acc: value
A: string id
B: object
Defines a property whose key is A for object B and store the value in the acc to the property.
0xdcIMM8_ID16_V8definepropertybyname RR, @AAAA, vBBDefault input parameter: acc: value
A: string id
B: object
Defines a property whose key is A for object B and store the value in the acc to the property.
0xfbPREF_NONEcallruntime.notifyconcurrentresultDefault input parameter: acc: return value of the concurrent functionNotifies the runtime of the return value of the concurrent function.
This instruction appears only in concurrent functions.
0xfc(deprecated)Deprecated operation code.
0xfdPREF_IMM16_V8_V8wide.createobjectwithexcludedkeys +AAAA, vBB, vCCA: number of range registers
B: object
C, ..., C + A: property key value.
Based on object B, creates an object excluding the key C, ..., C + A and stores it in the acc.
This instruction supports object creation by using destructor and extension syntax.
0xfePREF_NONEthrowDefault input parameter: acc: exceptionThrows the exception stored in acc.
0x01fbPREF_IMM8_V8_V8callruntime.definefieldbyvalue RR, vAA, vBBDefault input parameter: acc: value
A: property key
B: object
Defines a property whose key is A for object B and store the value in the acc to the property.
0x01fc(deprecated)Deprecated operation code.
0x01fdPREF_IMM16_V8wide.newobjrange +AAAA, vBBA: number of parameters
B: class object
B + 1, ..., B + A - 1: parameter passed to the constructor
Uses B + 1, ..., B + A - 1 as a parameter to create an instance of class B and stores it in the acc.
0x01fePREF_NONEthrow.notexistsException thrown: undefined method.
0x02fbPREF_IMM8_IMM32_V8callruntime.definefieldbyindex RR, +AAAAAAAA, vBBDefault input parameter: acc: value
A: property key
B: object
Defines a property whose key is A for object B and store the value in the acc to the property.
0x02fc(deprecated)Deprecated operation code.
0x02fdPREF_IMM16wide.newlexenv +AAAAA: number of slots in the lexical environmentCreates a lexical environment with slot A, stores it in the acc, and enters the lexical environment.
0x02fePREF_NONEthrow.patternnoncoercibleThrows an exception indicating that this object cannot be forcibly executed.
0x03fbPREF_NONEcallruntime.topropertykeyDefault input parameter: acc: valueConverts the value in the acc to the property value. If the conversion fails, an error is thrown.
0x03fc(deprecated)Deprecated operation code.
0x03fdPREF_IMM16_ID16wide.newlexenvwithname +AAAA, @BBBBA: number of slots in the lexical environment
B: literal id
Uses the lexical variable name stored in the literal array corresponding to index B to create a lexical environment with A slots, stores this lexical environment in the acc, and enters the lexical environment.
0x03fePREF_NONEthrow.deletesuperpropertyThrows an exception indicating an attempt to delete the property of the parent class.
0x04fbPREF_IMM_16_ID16callruntime.createprivateproperty +AAAA, @BBBBA: number of symbols to be created
B: literal id
Creates A symbols. Obtain the stored private method from the literal array corresponding to index B. If a private instance method exists, an additional symbol ("method") will be created. Based on the creation sequence, place the created symbols at the end of the lexical environment where the current class is located.
This instruction appears only when a class is defined.
0x04fc(deprecated)Deprecated operation code.
0x04fdPREF_IMM16_V8wide.callrange +AAAA, vBBDefault input parameter: acc: function object
A: number of parameters
B, ..., B + A - 1: parameter
Uses B, ..., B + A - 1 as a parameter to call the function object stored in the acc and stores the result in the acc.
0x04fePREF_V8throw.constassignment vAAA: constant variable nameThrows an exception indicating a value is assigned to a constant variable.
0x05fbPREF_IMM8_IMM_16_IMM_16_V8callruntime.defineprivateproperty RR, +AAAA, +BBBB, vCCDefault input parameter: acc: value
A: lexical environment level
B: slot number
C: object
Loads the value of slot B in the lexical environment beyond A levels, changes the value to acc, and adds it to object C as a private property.
0x05fc(deprecated)Deprecated operation code.
0x05fdPREF_IMM16_V8wide.callthisrange +AAAA, vBBDefault input parameter: acc: function object
A: number of parameters
B: object
B + 1, ..., B + A: parameter
Sets this to B, calls the function object stored in the acc by setting B + 1, ..., B + A as a parameter, and stores the result in the acc.
0x05fePREF_V8throw.ifnotobject vAAA: ObjectThrows an exception if A is not an object.
0x06fbPREF_IMM8_V8callruntime.callinit +RR, vAAacc: function object
R: 8-bit reserved number used in Ark runtime
A: Object
Sets this to A, calls the function object stored in the acc without passing parameters, and stores the result in the acc.
0x06fc(deprecated)Deprecated operation code.
0x06fdPREF_IMM16_V8wide.supercallthisrange +AAAA, vBBA: number of parameters
B, ..., B + A - 1: parameter
Uses B, ..., B + A - 1 as a parameter to call the super function and stores the result in the acc.
When the value of A is 0, the value of B is undefined.
This instruction appears only in non-arrow functions.
0x06fePREF_V8_V8throw.undefinedifhole vAA, vBBA: Object
B: object name
If the value of A is hole, throws an exception indicating that the value of B is undefined.
0x07fbPREF_IMM16_ID16_ID16_IMM16_V8callruntime.definesendableclass RRRR, @AAAA, @BBBB, +CCCC, vDDR: 16-bit reserved number used in Ark runtime
A: method id of the constructor of sendable class
B: literal id
C: number of formal parameters of method A
D: parent class
Uses the literal array corresponding to index B and parent class D to create a class object of A and stores it in the acc.
0x07fc(deprecated)Deprecated operation code.
0x07fdPREF_IMM16_V8wide.supercallarrowrange +AAAA, vBBDefault input parameter: acc: class object
A: number of parameters
B, ..., B + A - 1: parameter
Uses B, ..., B + A - 1 as a parameter to call the constructor function of the parent class of the class stored in the acc and stores the result in the acc.
If the value of A is 0, B is undefined.
This instruction appears only in arrow functions.
0x07fePREF_IMM8throw.ifsupernotcorrectcall +AADefault input parameter: acc: object
A: error type
Throws an exception if super is not called properly.
0x08fbPREF_IMM16callruntime.ldsendableclass +AAAAA: lexical environment levelStores the Sendable class of the lexical environment beyond A levels in the acc.
0x08fc(deprecated)Deprecated operation code.
0x08fdPREF_IMM32wide.ldobjbyindex +AAAAAAAADefault input parameter: acc: object
A: property key
Loads the property whose key is A of the object stored in the acc and stores the property in the acc.
0x08fePREF_IMM16throw.ifsupernotcorrectcall +AAAADefault input parameter: acc: object
A: error type
Throws an exception if super is not called properly.
0x09fbPREF_IMM8callruntime.ldsendableexternalmodulevar +AAA: slot numberStores the external module variable of slot A in the acc. This instruction is used only in Sendable classes and Sendable functions.
0x09fc(deprecated)Deprecated operation code.
0x09fdPREF_V8_IMM32wide.stobjbyindex vAA, +BBBBBBBBDefault input parameter: acc: value
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0x09fePREF_ID16throw.undefinedifholewithname @AAAADefault input parameter: acc: object
A: string id
If the value in the acc is hole, throws an exception indicating that the value of A is undefined.
0x0afbPREF_IMM16callruntime.wideldsendableexternalmodulevar +AAAAA: slot numberStores the external module variable of slot A in the acc. This instruction is used only in Sendable classes and Sendable functions.
0x0afc(deprecated)Deprecated operation code.
0x0afdPREF_V8_IMM32wide.stownbyindex vAA, +BBBBBBBBDefault input parameter: acc: value
A: Object
B: property key
Stores the value in the acc to the property whose key is B of object A.
0x0bfbPREF_IMM8callruntime.newsendableenv +AAA: number of slots in a shared lexical environmentCreates a shared lexical environment with slot A and enters the lexical environment.
0x0bfc(deprecated)Deprecated operation code.
0x0bfdPREF_IMM16wide.copyrestargs +AAAAA: start position of the rest parameters in the formal parameter listCopies the rest parameters and stores the parameter array copy in the acc.
0x0cfbPREF_IMM16callruntime.widenewsendableenv +AAAAA: number of slots in a shared lexical environmentCreates a shared lexical environment with slot A and enters the lexical environment.
0x0cfc(deprecated)Deprecated operation code.
0x0cfdPREF_IMM16_IMM16wide.ldlexvar +AAAA, +BBBBA: lexical environment level
B: slot number
Stores the value of slot B in the lexical environment beyond A levels in the acc.
0x0dfbPREF_IMM4_IMM4callruntime.stsendablevar +A +BDefault input parameter: acc: value
A: shared lexical environment level
B: slot number
Stores the value in the acc to slot B in the shared lexical environment beyond A levels.
0x0dfc(deprecated)Deprecated operation code.
0x0dfdPREF_IMM16_IMM16wide.stlexvar +AAAA, +BBBBDefault input parameter: acc: value
A: lexical environment level
B: slot number
Stores the value in the acc to slot B in the lexical environment beyond A levels.
0x0efbPREF_IMM8_IMM8callruntime.stsendablevar +AA +BBDefault input parameter: acc: value
A: shared lexical environment level
B: slot number
Stores the value in the acc to slot B in the shared lexical environment beyond A levels.
0x0efc(deprecated)Deprecated operation code.
0x0efdPREF_IMM16wide.getmodulenamespace +AAAAA: module indexExecutes the GetModuleNamespace instruction for module A and stores the result in the acc.
0x0ffbPREF_IMM16_IMM16callruntime.widestsendablevar +AAAA +BBBBDefault input parameter: acc: value
A: shared lexical environment level
B: slot number
Stores the value in the acc to slot B in the shared lexical environment beyond A levels.
0x0ffc(deprecated)Deprecated operation code.
0x0ffdPREF_IMM16wide.stmodulevar +AAAADefault input parameter: acc: value
A: slot number
Stores the value in the acc to the module variable of slot A.
0x10fbPREF_IMM4_IMM4callruntime.ldsendablevar +A +BA: shared lexical environment level
B: slot number
Stores the value of slot B in the shared lexical environment beyond A levels in the acc.
0x10fc(deprecated)Deprecated operation code.
0x10fdPREF_IMM16wide.ldlocalmodulevar +AAAAA: slot numberStores the local module variables of slot A in the acc.
0x11fbPREF_IMM8_IMM8callruntime.ldsendablevar +AA + BBA: shared lexical environment level
B: slot number
Stores the value of slot B in the shared lexical environment beyond A levels in the acc.
0x11fc(deprecated)Deprecated operation code.
0x11fdPREF_IMM16wide.ldexternalmodulevar +AAAAA: slot numberStores the external module variable of slot A in the acc.
0x12fbPREF_IMM16_IMM16callruntime.wideldsendablevar +AAAA +BBBBA: shared lexical environment level
B: slot number
Stores the value of slot B in the shared lexical environment beyond A levels in the acc.
0x12fc(deprecated)Deprecated operation code.
0x12fdPREF_IMM16wide.ldpatchvar +AAAAA: slot number of the patch variableLoads the patch variable of slot A to the acc.
This instruction is used only build scenarios under the patch mode.
0x13fbPREF_IMM8callruntime.istrue +RRDefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
Calculates acc == true and stores the result in the acc.
0x13fc(deprecated)Deprecated operation code.
0x13fdPREF_IMM16wide.stpatchvar +AAAADefault input parameter: acc: value
A: slot number of the patch variable
Stores the value in the acc to the patch variable of slot A.
This instruction is used only build scenarios under the patch mode.
0x14fbPREF_IMM8callruntime.isfalse +RRDefault input parameter: acc: operand
R: 8-bit reserved number used in Ark runtime
Calculates acc == false and stores the result in the acc.
0x15fbPREF_IMM8callruntime.ldlazymodulevar +AAA: slot numberStores the external module variable of slot A in the acc. This instruction applies only to module variables imported using lazy import.
0x16fbPREF_IMM16callruntime.wideldlazymodulevar +AAAAA: slot numberStores the external module variable of slot A in the acc. This instruction applies only to module variables imported using lazy import.
0x17fbPREF_IMM8callruntime.ldlazysendablemodulevar +AAA: slot numberStores the external module variable of slot A in the acc. This instruction applies only to module variables imported through lazy import and appears only in Sendable classes and Sendable functions.
0x18fbPREF_IMM16callruntime.wideldlazysendablemodulevar +AAAAA: slot numberStores the external module variable of slot A in the acc. This instruction applies only to module variables imported through lazy import and appears only in Sendable classes and Sendable functions.
0x14fc
0x15fc
...
0x2efc
(deprecated)Deprecated operation code.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkTS

harmony 鸿蒙Configuring arkOptions in build-profile.json5

harmony 鸿蒙Asynchronous Lock

harmony 鸿蒙Ark Bytecode File Format

harmony 鸿蒙Naming Conventions for Ark Bytecode Functions

harmony 鸿蒙Overview of Ark Bytecode

harmony 鸿蒙Shared Container

harmony 鸿蒙Asynchronous Waiting

harmony 鸿蒙ArkTS Cross-Language Interaction

harmony 鸿蒙Dynamic Import

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/JdVvVU