• Home
Name Date Size #Lines LOC

..--

common_components/22-Oct-2025-40,35330,516

compiler_service/22-Oct-2025-6,4954,804

docs/22-Oct-2025-1,4571,149

ecmascript/22-Oct-2025-847,414693,339

etc/22-Oct-2025-5045

script/22-Oct-2025-508395

test/22-Oct-2025-300,665229,107

tools/22-Oct-2025-10,0618,740

.gitignoreD22-Oct-2025259 2322

BUILD.gnD22-Oct-202570.6 KiB2,0771,914

CODEOWNERSD22-Oct-2025613 1714

LICENSED22-Oct-202510.1 KiB177150

OAT.xmlD22-Oct-20256.4 KiB9137

README.mdD22-Oct-20254.6 KiB10581

README_zh.mdD22-Oct-20254.9 KiB10380

REVIEWERSD22-Oct-20254.1 KiB6661

bundle.jsonD22-Oct-20253.9 KiB114113

hisysevent.yamlD22-Oct-20257 KiB10789

js_runtime_config.gniD22-Oct-202510.9 KiB382326

libark_jsruntime.mapD22-Oct-202521.3 KiB452445

README.md

1# ArkCompiler JS Runtime
2
3- [ArkCompiler JS Runtime](#ArkCompiler_JS_Runtime)
4    - [Introduction](#Introduction)
5  - [Directory Structure](#Directory_Structure)
6  - [Constraints](#Constraints)
7  - [Building](#Building)
8    - [Available APIs](#Available_APIs)
9    - [Usage](#Usage)
10  - [Repositories Involved](#Repositories_Involved)
11
12### Introduction
13
14ArkCompiler 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.
15
16For more information, see [ArkCompiler JS Runtime](https://gitee.com/openharmony/docs/blob/master/en/readme/ARK-Runtime-Subsystem.md).
17
18**ArkCompiler JS Runtime architecture**
19
20![](/docs/figures/en-us_image_ark-js-arch.png)
21
22## Directory Structure
23
24```
25/arkcompiler/ets_runtime
26├─ ecmascript             # Implementation of ArkCompiler JS Runtime, including the ECMAScript library, interpreter, and memory management
27│   ├─ base               # Base helper class
28│   ├─ builtins           # ECMAScript libraries
29│   ├─ checkpoint         # Virtual machine safepoint
30│   ├─ compiler           # JS compiler
31│   ├─ containers         # Non-ECMAScript containers
32│   ├─ daemon             # Shared GC concurrent thread
33│   ├─ debugger           # JS debugger
34│   ├─ deoptimizer        # Compiler deoptimization
35│   ├─ dfx                # Memory and profiling tool
36│   ├─ extractortool      # Sourcemap parsing
37│   ├─ ic                 # Inline cache module
38│   ├─ interpreter        # JS interpreter
39│   ├─ intl               # Internationalization
40│   ├─ jit                # Jit compiler
41│   ├─ jobs               # Queue of jobs
42│   ├─ js_api             # Non-ecma standard object model
43│   ├─ js_type_metadata   # Object layout file
44│   ├─ js_vm              # Command line tool
45│   ├─ jspandafile        # abc file management module
46│   ├─ mem                # Memory management module
47│   ├─ module             # ECMAScript module
48│   ├─ napi               # C++ API module
49│   ├─ ohos               # System-related logic
50│   ├─ patch              # Cold patch, hot patch
51│   ├─ pgo_profiler       # A performance analyzer based on profile-guided optimization (pgo), used for performance analysis and optimization
52│   ├─ platform           # Cross-platform processing
53│   ├─ quick_fix          # Quickly fix the command-line tool
54│   ├─ regexp             # Regular expression engine module
55│   ├─ require            # Commonjs module specification
56│   ├─ sdk                # Integration of sdk tools
57│   ├─ serializer         # Serialization
58│   ├─ shared_mm          # Shared memory management module
59│   ├─ shared_objects     # Implementation of shared objects
60│   ├─ snapshot           # Snapshot module
61│   ├─ stackmap           # Location information of active variables
62│   ├─ stubs              # Runtime stub functions
63│   ├─ taskpool           # Task pool
64│   ├─ tests              # Unit test cases
65│   ├─ ts_types           # TS type management module
66└─ test                   # Module test cases
67```
68
69## Constraints
70
71* Only the ArkCompiler bytecode files generated by ts2abc, which is the ArkCompiler JS frontend toolchain, can be run.
72* Only the ES2021 standard and strict modes are supported.
73* Functions cannot be dynamically created using strings, such as new Function("console.log(1);")).
74
75## Building
76
77```
78$./build.sh --product-name hispark_taurus_standard --build-target ark_js_host_linux_tools_packages
79```
80
81### Available APIs
82
83See [NAPI](https://gitee.com/openharmony/arkui_napi/blob/master/README.md).
84
85### Usage
86
87For details about how to generate JS bytecodes, see [Using the Toolchain](docs/using-the-toolchain.md).
88
89To run bytecodes:
90```
91LD_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
92
93```
94
95For more information, see [ARK Runtime Usage Guide](https://gitee.com/openharmony/arkcompiler_ets_runtime/blob/master/
96docs/ARK-Runtime-Usage-Guide.md).
97
98## Repositories Involved
99
100[arkcompiler\_runtime\_core](https://gitee.com/openharmony/arkcompiler_runtime_core)
101
102**[arkcompiler\_ets\_runtime](https://gitee.com/openharmony/arkcompiler_ets_runtime)**
103
104[arkcompiler\_ets\_frontend](https://gitee.com/openharmony/arkcompiler_ets_frontend)
105

README_zh.md

1# 方舟eTS运行时部件<a name="ZH-CN_TOPIC_0000001183610495"></a>
2
3- [方舟eTS运行时部件<a name="ZH-CN_TOPIC_0000001183610495"></a>](#方舟eTS运行时部件)
4    - [简介<a name="section190813718209"></a>](#简介)
5  - [目录<a name="section161941989596"></a>](#目录)
6  - [约束<a name="section119744591305"></a>](#约束)
7  - [编译构建<a name="section137768191623"></a>](#编译构建)
8    - [接口说明<a name="section175841548124517"></a>](#接口说明)
9    - [使用说明<a name="section129654513264"></a>](#使用说明)
10  - [相关仓<a name="section1371113476307"></a>](#相关仓)
11
12### 简介<a name="section190813718209"></a>
13
14方舟eTS运行时是OpenHarmony上默认的ArkTS语言运行时。支持Ecmascript规范定义的标准库和高效container容器库,提供完备的C++交互ArkTS NAPI和各种高性能的垃圾回收器,驱动着万物互联时代的OpenHarmony应用程序。
15
16更多信息请参考:[方舟运行时子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/ARK-Runtime-Subsystem-zh.md)
17
18**图1** 方舟eTS运行时部件架构图:
19
20![](/docs/figures/zh-cn_image_ark-ts-arch.png)
21
22## 目录<a name="section161941989596"></a>
23
24```
25/arkcompiler/ets_runtime
26├─ ecmascript             # 方舟ArkTS运行时实现,包括ECMAScript标准库、解释器、内存管理等
27│   ├─ base               # 基础帮助类
28│   ├─ builtins           # ECMAScript标准库
29│   ├─ checkpoint         # 虚拟机安全点
30│   ├─ compiler           # 编译器
31│   ├─ containers         # 非ECMAScript标准容器类库
32│   ├─ daemon             # Shared GC并发线程名
33│   ├─ debugger           # 调试器
34│   ├─ deoptimizer        # 编译器逆优化
35│   ├─ dfx                # 内存与性能分析工具
36│   ├─ extractortool      # sourcemap解析
37│   ├─ ic                 # 内联缓存模块
38│   ├─ interpreter        # 解释器
39│   ├─ intl               # 国际化
40│   ├─ jit                # jit编译器
41│   ├─ jobs               # 微任务队列
42│   ├─ js_api             # 非ECMA标准对象模型
43│   ├─ js_type_metadata   # 对象布局文件
44│   ├─ js_vm              # 命令行工具
45│   ├─ jspandafile        # abc文件管理模块
46│   ├─ mem                # 内存管理模块
47│   ├─ module             # ECMAScript module模块
48│   ├─ napi               # C++接口模块
49│   ├─ ohos               # 系统相关逻辑
50│   ├─ patch              # 冷、热补丁
51│   ├─ pgo_profiler       # 基于 Profile-Guided Optimization (PGO) 的性能分析器,用于性能分析与优化
52│   ├─ platform           # 跨平台处理
53│   ├─ quick_fix          # 快速修复命令行工具
54│   ├─ regexp             # 正则引擎模块
55│   ├─ require            # CommonJS规范module模块
56│   ├─ sdk                # sdk工具集成
57│   ├─ serializer         # 序列化
58│   ├─ shared_mm          # 共享内存管理模块
59│   ├─ shared_objects     # 共享对象实现
60│   ├─ snapshot           # 快照模块
61│   ├─ stackmap           # 活跃变量的位置信息
62│   ├─ stubs              # runtime桩函数
63│   ├─ taskpool           # 任务池
64│   ├─ tests              # 单元测试用例
65│   ├─ ts_types           # TS类型管理模块
66└─ test                   # 模块测试用例
67```
68
69## 约束<a name="section119744591305"></a>
70
71* 仅支持运行方舟eTS编译器\(ts2abc或es2abc\)生成的方舟字节码文件
72* 只支持ES2021标准和严格模式(use strict)
73* 不支持通过字符串动态创建函数(比如new Function("console.log(1);"))
74
75## 编译构建<a name="section137768191623"></a>
76
77```
78$./build.sh --product-name hispark_taurus_standard --build-target ark_js_host_linux_tools_packages
79```
80
81### 接口说明<a name="section175841548124517"></a>
82
83NAPI接口说明参考[NAPI部件](https://gitee.com/openharmony/arkui_napi/blob/master/README_zh.md)
84
85### 使用说明<a name="section129654513264"></a>
86
87ArkTS生成字节码参考[方舟eTS编译器]( https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/README_zh.md#%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E)
88
89字节码执行:
90```
91LD_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
92
93```
94
95更多使用说明请参考:[方舟运行时使用指南](/docs/README_zh.md)
96
97## 相关仓<a name="section1371113476307"></a>
98
99[arkcompiler\_runtime\_core](https://gitee.com/openharmony/arkcompiler_runtime_core)
100
101**[arkcompiler\_ets\_runtime](https://gitee.com/openharmony/arkcompiler_ets_runtime)**
102
103[arkcompiler\_ets\_frontend](https://gitee.com/openharmony/arkcompiler_ets_frontend)