Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
docs/ | 12-May-2024 | - | 1,439 | 1,130 | ||
ecmascript/ | 12-May-2024 | - | 416,786 | 334,851 | ||
script/ | 12-May-2024 | - | 241 | 194 | ||
test/ | 12-May-2024 | - | 1,034,477 | 832,561 | ||
tools/circuit_viewer/ | 12-May-2024 | - | 6,359 | 5,669 | ||
.gitignore | D | 12-May-2024 | 165 | 18 | 17 | |
BUILD.gn | D | 12-May-2024 | 37 KiB | 1,185 | 1,077 | |
LICENSE | D | 12-May-2024 | 10.1 KiB | 177 | 150 | |
OAT.xml | D | 12-May-2024 | 12.3 KiB | 114 | 60 | |
README.md | D | 12-May-2024 | 3.2 KiB | 78 | 55 | |
README_zh.md | D | 12-May-2024 | 4 KiB | 88 | 65 | |
bundle.json | D | 12-May-2024 | 2.4 KiB | 80 | 79 | |
js_runtime_config.gni | D | 12-May-2024 | 3.7 KiB | 118 | 107 | |
libark_jsruntime.map | D | 12-May-2024 | 2.6 KiB | 91 | 85 |
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
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│ ├─ compiler # 编译器 30│ ├─ containers # 非ECMAScript标准容器类库 31│ ├─ debugger # 调试器 32│ ├─ dfx # 内存与性能分析工具 33│ ├─ ic # 内联缓存模块 34│ ├─ interpreter # 解释器 35│ ├─ jobs # 微任务队列 36│ ├─ js_api # 非ECMA标准对象模型 37│ ├─ js_vm # 命令行工具 38│ ├─ jspandafile # abc文件管理模块 39│ ├─ mem # 内存管理模块 40│ ├─ module # ECMAScript module模块 41│ ├─ napi # C++接口模块 42│ ├─ quick_fix # 快速修复命令行工具 43│ ├─ regexp # 正则引擎模块 44│ ├─ require # CommonJS规范module模块 45│ ├─ shared_mm # 共享内存管理模块 46│ ├─ snapshot # 快照模块 47│ ├─ stubs # runtime桩函数 48│ ├─ taskpool # 任务池 49│ ├─ tests # 单元测试用例 50│ ├─ ts_types # TS类型管理模块 51└─ test # 模块测试用例 52``` 53 54## 约束<a name="section119744591305"></a> 55 56* 仅支持运行方舟eTS编译器\(ts2abc或es2abc\)生成的方舟字节码文件 57* 只支持ES2021标准和严格模式(use strict) 58* 不支持通过字符串动态创建函数(比如new Function("console.log(1);")) 59 60## 编译构建<a name="section137768191623"></a> 61 62``` 63$./build.sh --product-name hispark_taurus_standard --build-target ark_js_host_linux_tools_packages 64``` 65 66### 接口说明<a name="section175841548124517"></a> 67 68NAPI接口说明参考[NAPI部件](https://gitee.com/openharmony/arkui_napi/blob/master/README_zh.md) 69 70### 使用说明<a name="section129654513264"></a> 71 72ArkTS生成字节码参考[方舟eTS编译器](docs/using-the-toolchain-zh.md) 73 74字节码执行: 75``` 76LD_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 77 78``` 79 80更多使用说明请参考:[方舟运行时使用指南](/docs/README_zh.md) 81 82## 相关仓<a name="section1371113476307"></a> 83 84[arkcompiler\_runtime\_core](https://gitee.com/openharmony/arkcompiler_runtime_core) 85 86**[arkcompiler\_ets\_runtime](https://gitee.com/openharmony/arkcompiler_ets_runtime)** 87 88[arkcompiler\_ets\_frontend](https://gitee.com/openharmony/arkcompiler_ets_frontend)