Name Date Size

..25-Oct-20244 KiB

.gitee/H25-Oct-20244 KiB

.gitignoreH A D25-Oct-2024165

BUILD.gnH A D25-Oct-202443 KiB

bundle.jsonH A D25-Oct-20243.6 KiB

CODEOWNERSH A D25-Oct-2024613

compiler_service/H25-Oct-20244 KiB

docs/H25-Oct-20244 KiB

ecmascript/H25-Oct-202412 KiB

etc/H25-Oct-20244 KiB

hisysevent.yamlH A D25-Oct-20244.4 KiB

js_runtime_config.gniH A D25-Oct-202410 KiB

libark_jsruntime.mapH A D25-Oct-202419.2 KiB

LICENSEH A D25-Oct-202410.1 KiB

OAT.xmlH A D25-Oct-20246.4 KiB

README.mdH A D25-Oct-20243.2 KiB

README_zh.mdH A D25-Oct-20244.1 KiB

REVIEWERSH A D25-Oct-20242.8 KiB

script/H25-Oct-20244 KiB

test/H25-Oct-20244 KiB

tools/H25-Oct-20244 KiB

README.md

1# ArkCompiler JS Runtime
2
3### Introduction
4
5ArkCompiler JS Runtime is the default JS runtime on OpenHarmony. It supports ECMAScript libraries and efficient container libraries. It also provides a set of native APIs for C++ and JS interaction and a variety of garbage collectors that features high performance.
6
7For more information, see [ArkCompiler JS Runtime](https://gitee.com/openharmony/docs/blob/master/en/readme/ARK-Runtime-Subsystem.md).
8
9**ArkCompiler JS Runtime architecture**
10
11![](/docs/figures/en-us_image_ark-js-arch.png)
12
13## Directory Structure
14
15```
16/arkcompiler/ets_runtime
17├─ ecmascript             # Implementation of ArkCompiler JS Runtime, including the ECMAScript library, interpreter, and memory management
18│   ├─ base               # Base helper class
19│   ├─ builtins           # ECMAScript libraries
20│   ├─ compiler           # JS compiler
21│   ├─ containers         # Non-ECMAScript containers
22│   ├─ dfx                # Memory and profiling tool
23│   ├─ ic                 # Inline cache module
24│   ├─ interpreter        # JS interpreter
25│   ├─ jobs               # Queue of jobs
26│   ├─ js_vm              # Command line tool
27│   ├─ jspandafile        # abc file management module
28│   ├─ mem                # Memory management module
29│   ├─ module             # ECMAScript module
30│   ├─ napi               # C++ API module
31│   ├─ taskpool           # Task pool
32│   ├─ regexp             # Regular expression engine module
33│   ├─ snapshot           # Snapshot module
34│   ├─ stubs              # Runtime stub functions
35│   ├─ tests              # Unit test cases
36│   ├─ debugger           # JS debugger
37│   ├─ trampoline         # Trampoline function
38│   ├─ ts_type            # TS type management module
39└─ test                   # Module test cases    
40```
41
42## Constraints
43
44* Only the ArkCompiler bytecode files generated by ts2abc, which is the ArkCompiler JS frontend toolchain, can be run.
45* Only the ES2021 standard and strict modes are supported.
46* Functions cannot be dynamically created using strings, such as new Function("console.log(1);")).
47
48## Building
49
50```
51$./build.sh --product-name hispark_taurus_standard --build-target ark_js_host_linux_tools_packages
52```
53
54### Available APIs
55
56See [NAPI](https://gitee.com/openharmony/arkui_napi/blob/master/README.md).
57
58### Usage
59
60For details about how to generate JS bytecodes, see [Using the Toolchain](docs/using-the-toolchain.md).
61
62To run bytecodes: 
63```
64LD_LIBRARY_PATH=out/hispark_taurus/clang_x64/arkcompiler/ets_runtime:out/hispark_taurus/clang_x64/thirdparty/icu:prebuilts/clang/ohos/linux-x86_64/llvm/lib ./out/hispark_taurus/clang_x64/arkcompiler/ets_runtime/ark_js_vm helloworld.abc
65
66```
67
68For more information, see [ARK Runtime Usage Guide](https://gitee.com/openharmony/arkcompiler_ets_runtime/blob/master/
69docs/ARK-Runtime-Usage-Guide.md).
70
71## Repositories Involved
72
73[arkcompiler\_runtime\_core](https://gitee.com/openharmony/arkcompiler_runtime_core)
74
75**[arkcompiler\_ets\_runtime](https://gitee.com/openharmony/arkcompiler_ets_runtime)**
76
77[arkcompiler\_ets\_frontend](https://gitee.com/openharmony/arkcompiler_ets_frontend)
78