• Home
Name Date Size #Lines LOC

..--

assembler/12-May-2024-15,72612,260

cmake/12-May-2024-2,8192,442

disassembler/12-May-2024-3,7652,965

docs/12-May-2024-4,6503,614

dprof/12-May-2024-1,7041,215

gn/12-May-2024-653573

isa/12-May-2024-4,5174,082

ldscripts/12-May-2024-483444

libpandabase/12-May-2024-29,29820,748

libpandafile/12-May-2024-16,37112,131

libziparchive/12-May-2024-1,142857

panda/12-May-2024-391309

pandastdlib/12-May-2024-780632

runtime/12-May-2024-96,27068,656

scripts/12-May-2024-1,303868

templates/12-May-2024-562456

tests/12-May-2024-195,615182,478

verification/12-May-2024-26,82620,602

.clang-formatD12-May-20243.7 KiB127125

.clang-tidyD12-May-20243.4 KiB7674

.gitattributesD12-May-2024127 76

.gitignoreD12-May-2024176 1716

.standalone_gnD12-May-2024872 2318

AUTHORSD12-May-20241.8 KiB136135

BUILD.gnD12-May-20243.6 KiB151136

CMakeLists.txtD12-May-20248.6 KiB241185

LICENSED12-May-202411.1 KiB203169

OAT.xmlD12-May-20249.8 KiB11662

README.mdD12-May-20249.2 KiB153124

README_zh.mdD12-May-20248.7 KiB153124

ark_config.gniD12-May-20245.9 KiB187165

bundle.jsonD12-May-2024826 3635

README.md

1# Runtime Core<a name="EN-US_TOPIC_0000001138850082"></a>
2
3- [Runtime Core<a name="EN-US_TOPIC_0000001138850082"></a>](#runtime-core)
4  - [Introduction<a name="section11660541593"></a>](#introduction)
5  - [Directory Structure<a name="section161941989596"></a>](#directory-structure)
6  - [Usage Guidelines<a name="section1312121216216"></a>](#usage-guidelines)
7    - [Assembler ark\_asm](#assembler-ark_asm)
8    - [Disassembler ark\_disasm](#disassembler-ark_disasm)
9  - [Repositories Involved<a name="section1371113476307"></a>](#repositories-involved)
10
11## Introduction<a name="section11660541593"></a>
12
13As a common module of ARK runtime, Runtime Core consists of some basic language-irrelevant runtime libraries, including ARK File, Tooling, and ARK Base. ARK File provides bytecodes and information required for executing bytecodes. Tooling supports Debugger. ARK Base is responsible for implementing platform related utilities.
14
15For more infomation, see: [ARK Runtime Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/ARK-Runtime-Subsystem.md).
16
17## Directory Structure<a name="section161941989596"></a>
18
19```
20/ark/runtime_core
21├── assembler             # Assembler that converts an ARK bytecode file (*.pa) in text format into a bytecode file (*.abc) in binary format. For details about the format, see docs/assembly_format.md and docs/file_format.md.
22├── cmake                 # cmake script that contains the toolchain files and common cmake functions used to define the build and test targets.
23├── CMakeLists.txt        # cmake main entry file.
24├── disassembler          # Disassembler that converts an ARK bytecode file (*.abc) in binary format into an ARK bytecode file (*.pa) in text format.
25├── docs                  # Language frontend, ARK file format, and runtime design documents.
26├── dprof                 # Data used to collect the profiling data for ARK runtime.
27├── gn                    # GN templates and configuration files.
28├── isa                   # Bytecode ISA description file YAML, and Ruby scripts and templates.
29├── ldscripts             # Linker scripts used to place ELF sections larger than 4 GB in a non-PIE executable file.
30├── libpandabase          # Basic ARK runtime library, including logs, synchronization primitives, and common data structure.
31├── libpandafile          # Source code repository of ARK bytecode files (*.abc) in binary format.
32├── libziparchive         # provides APIs for reading and using zip files implemented by miniz.
33├── panda                 # CLI tool used to execute ARK bytecode files (*.abc).
34├── pandastdlib           # Standard libraries wrote by the ARK assembler.
35├── runtime               # ARK runtime command module.
36├── scripts               # CI scripts.
37├── templates             # Ruby templates and scripts used to process command line options, loggers, error messages, and events.
38├── tests                 # UT test cases.
39└── verification          # Bytecode verifier. See docs/bc_verification.
40
41```
42
43## Usage Guidelines<a name="section1312121216216"></a>
44
45### Assembler ark\_asm
46
47The ark\_asm assembler converts the text ARK bytecode file into a bytecode file in binary format.
48
49Command:
50
51```
52ark_asm [Option] Input file Output file
53```
54
55<a name="table11141827153017"></a>
56<table><thead align="left"><tr id="row101462717303"><th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.1"><p id="p51552743010"><a name="p51552743010"></a><a name="p51552743010"></a>Option</p>
57</th>
58<th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.2"><p id="p11592710304"><a name="p11592710304"></a><a name="p11592710304"></a>Description</p>
59</th>
60</tr>
61</thead>
62<tbody><tr id="row2015172763014"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p171592710306"><a name="p171592710306"></a><a name="p171592710306"></a>--dump-scopes</p>
63</td>
64<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p13151527133011"><a name="p13151527133011"></a><a name="p13151527133011"></a>Saves the result to a JSON file to support the debug mode in Visual Studio Code.</p>
65</td>
66</tr>
67<tr id="row1015527173015"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p1615182712308"><a name="p1615182712308"></a><a name="p1615182712308"></a>--help</p>
68</td>
69<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p9556101593120"><a name="p9556101593120"></a><a name="p9556101593120"></a>Displays help information.</p>
70</td>
71</tr>
72<tr id="row1015112763020"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p1815182733012"><a name="p1815182733012"></a><a name="p1815182733012"></a>--log-file</p>
73</td>
74<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p1615627173019"><a name="p1615627173019"></a><a name="p1615627173019"></a>Specifies the log file output path after log printing is enabled.</p>
75</td>
76</tr>
77<tr id="row131515277307"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p111572716304"><a name="p111572716304"></a><a name="p111572716304"></a>--optimize</p>
78</td>
79<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p25842312319"><a name="p25842312319"></a><a name="p25842312319"></a>Enables compilation optimization.</p>
80</td>
81</tr>
82<tr id="row1815112753020"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p2151927193015"><a name="p2151927193015"></a><a name="p2151927193015"></a>--size-stat</p>
83</td>
84<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p1715312588115"><a name="p1715312588115"></a><a name="p1715312588115"></a>Collects statistics on and prints ARK bytecode information after conversion.</p>
85</td>
86</tr>
87<tr id="row1915182703012"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p17151527133017"><a name="p17151527133017"></a><a name="p17151527133017"></a>--verbose</p>
88</td>
89<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p15761152983113"><a name="p15761152983113"></a><a name="p15761152983113"></a>Enables log printing.</p>
90</td>
91</tr>
92</tbody>
93</table>
94
95Input file: ARK bytecodes in text format
96
97Output file: ARK bytecodes in binary format
98
99### Disassembler ark\_disasm
100
101The ark\_disasm disassembler converts binary ARK bytecodes into readable text ARK bytecodes.
102
103Command:
104
105```
106ark_disasm [Option] Input file Output file
107```
108
109<a name="table125062517328"></a>
110<table><thead align="left"><tr id="row125182553217"><th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.1"><p id="p175162514327"><a name="p175162514327"></a><a name="p175162514327"></a>Option</p>
111</th>
112<th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.2"><p id="p6512255324"><a name="p6512255324"></a><a name="p6512255324"></a>Description</p>
113</th>
114</tr>
115</thead>
116<tbody><tr id="row5511825103218"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p45172513326"><a name="p45172513326"></a><a name="p45172513326"></a>--debug</p>
117</td>
118<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p1245695053215"><a name="p1245695053215"></a><a name="p1245695053215"></a>Enables the function for printing debug information.</p>
119</td>
120</tr>
121<tr id="row951112515321"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p451192515323"><a name="p451192515323"></a><a name="p451192515323"></a>--debug-file</p>
122</td>
123<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p175142583210"><a name="p175142583210"></a><a name="p175142583210"></a>Specifies the path of the debug information output file. The default value is <strong id="b1486165094613"><a name="b1486165094613"></a><a name="b1486165094613"></a>std::cout</strong>.</p>
124</td>
125</tr>
126<tr id="row45116253325"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p85116259328"><a name="p85116259328"></a><a name="p85116259328"></a>--help</p>
127</td>
128<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p1348135833214"><a name="p1348135833214"></a><a name="p1348135833214"></a>Displays help information.</p>
129</td>
130</tr>
131<tr id="row194197407327"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p154205401325"><a name="p154205401325"></a><a name="p154205401325"></a>--verbose</p>
132</td>
133<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p369871173312"><a name="p369871173312"></a><a name="p369871173312"></a>Outputs the comments of the output file.</p>
134</td>
135</tr>
136</tbody>
137</table>
138
139Input file: ARK bytecodes in binary format
140
141Output file: ARK bytecodes in text format
142
143
144For more infomation, please see: [ARK Runtime Usage Guide](https://gitee.com/openharmony/ark_js_runtime/blob/master/docs/ARK-Runtime-Usage-Guide.md).
145
146## Repositories Involved<a name="section1371113476307"></a>
147
148**[ark\_runtime\_core](https://gitee.com/openharmony/ark_runtime_core)**
149
150[ark\_js\_runtime](https://gitee.com/openharmony/ark_js_runtime)
151
152[ark\_ts2abc](https://gitee.com/openharmony/ark_ts2abc)
153

README_zh.md

1# 方舟运行时公共组件<a name="ZH-CN_TOPIC_0000001138850082"></a>
2
3- [方舟运行时公共组件<a name="ZH-CN_TOPIC_0000001138850082"></a>](#方舟运行时公共组件)
4  - [简介<a name="section11660541593"></a>](#简介)
5  - [目录<a name="section161941989596"></a>](#目录)
6  - [使用说明<a name="section1312121216216"></a>](#使用说明)
7    - [汇编器工具概述](#汇编器工具概述)
8    - [反汇编器工具概述](#反汇编器工具概述)
9  - [相关仓<a name="section1371113476307"></a>](#相关仓)
10
11## 简介<a name="section11660541593"></a>
12
13Runtime Core组件是方舟运行时的公共组件,主要包括一些语言无关的基础运行库,包含承载字节码以及执行字节码所需要相关信息的ARK File、支持Debugger的Tooling、负责系统平台公共基础接口的ARK Base等。
14
15更多信息请参考:[方舟运行时子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/ARK-Runtime-Subsystem-zh.md)
16
17## 目录<a name="section161941989596"></a>
18
19```
20/ark/runtime_core
21├── assembler             # 汇编器,将文本格式的方舟字节码文件(*.pa)转换为二进制格式的字节码文件(*.abc),具体格式见:docs/assembly_format.mddocs/file_format.md
22├── cmake                 # cmake脚本,包含工具链文件和用于定义构建和测试目标的常用cmake函数
23├── CMakeLists.txt        # cmake主入口文件
24├── disassembler          # 反汇编器,将二进制格式的方舟字节码文件(*.abc)转换为文本格式的方舟字节码文件(*.pa)
25├── docs                  # 包含语言前端、方舟文件格式和运行时的设计文档
26├── dprof                 # 用于ARK运行时搜集profile数据
27├── gn                    # GN模板和配置文件
28├── isa                   # 字节码ISA描述文件YAML,和ruby脚本和模板
29├── ldscripts             # 包含链接器脚本,用于在非PIE可执行文件中放置4GB以上的ELF section
30├── libpandabase          # ARK运行时基本库,包含:日志、同步原语、公共数据结构等
31├── libpandafile          # 二进制格式的方舟字节码文件(*.abc)源码仓
32├── libziparchive         # 提供读取和使用miniz的ZIP压缩文件的API
33├── panda                 # CLI工具,用于执行方舟字节码文件(*.abc)
34├── pandastdlib           # 通过方舟汇编编写的标准库
35├── runtime               # ARK运行时公共组件
36├── scripts               # CI脚本
37├── templates             # ruby模板和脚本,处理包括:命令行选项、记录器组件、错误消息、事件等
38├── tests                 # UT用例
39└── verification          # 字节码验证器,具体可以参考 docs/bc_verification
40
41```
42
43## 使用说明<a name="section1312121216216"></a>
44
45### 汇编器工具概述
46
47工具名称为ark\_asm,用于将文本格式的方舟字节码文件转换为二进制格式的方舟字节码文件。
48
49命令行格式:
50
51```
52ark_asm [选项] 输入文件 输出文件
53```
54
55<a name="table11141827153017"></a>
56<table><thead align="left"><tr id="row101462717303"><th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.1"><p id="p51552743010"><a name="p51552743010"></a><a name="p51552743010"></a>选项</p>
57</th>
58<th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.2"><p id="p11592710304"><a name="p11592710304"></a><a name="p11592710304"></a>描述</p>
59</th>
60</tr>
61</thead>
62<tbody><tr id="row2015172763014"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p171592710306"><a name="p171592710306"></a><a name="p171592710306"></a>--dump-scopes</p>
63</td>
64<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p13151527133011"><a name="p13151527133011"></a><a name="p13151527133011"></a>将结果保存到json文件中,以支持在VS Code中的debug模式</p>
65</td>
66</tr>
67<tr id="row1015527173015"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p1615182712308"><a name="p1615182712308"></a><a name="p1615182712308"></a>--help</p>
68</td>
69<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p9556101593120"><a name="p9556101593120"></a><a name="p9556101593120"></a>帮助提示</p>
70</td>
71</tr>
72<tr id="row1015112763020"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p1815182733012"><a name="p1815182733012"></a><a name="p1815182733012"></a>--log-file</p>
73</td>
74<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p1615627173019"><a name="p1615627173019"></a><a name="p1615627173019"></a>使能log打印后,指定log文件输出路径</p>
75</td>
76</tr>
77<tr id="row131515277307"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p111572716304"><a name="p111572716304"></a><a name="p111572716304"></a>--optimize</p>
78</td>
79<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p25842312319"><a name="p25842312319"></a><a name="p25842312319"></a>使能编译优化</p>
80</td>
81</tr>
82<tr id="row1815112753020"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p2151927193015"><a name="p2151927193015"></a><a name="p2151927193015"></a>--size-stat</p>
83</td>
84<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p1715312588115"><a name="p1715312588115"></a><a name="p1715312588115"></a>统计并打印出转换后方舟字节码信息</p>
85</td>
86</tr>
87<tr id="row1915182703012"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p17151527133017"><a name="p17151527133017"></a><a name="p17151527133017"></a>--verbose</p>
88</td>
89<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p15761152983113"><a name="p15761152983113"></a><a name="p15761152983113"></a>使能log打印</p>
90</td>
91</tr>
92</tbody>
93</table>
94
95输入文件:文本格式的方舟字节码
96
97输出文件:二进制格式的方舟字节码
98
99### 反汇编器工具概述
100
101工具名称为ark\_disasm,用于将二进制格式的方舟字节码文件转换为文本格式的方舟字节码文件。
102
103命令行格式:
104
105```
106ark_disasm [选项] 输入文件 输出文件
107```
108
109<a name="table125062517328"></a>
110<table><thead align="left"><tr id="row125182553217"><th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.1"><p id="p175162514327"><a name="p175162514327"></a><a name="p175162514327"></a>选项</p>
111</th>
112<th class="cellrowborder" valign="top" width="50%" id="mcps1.1.3.1.2"><p id="p6512255324"><a name="p6512255324"></a><a name="p6512255324"></a>描述</p>
113</th>
114</tr>
115</thead>
116<tbody><tr id="row5511825103218"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p45172513326"><a name="p45172513326"></a><a name="p45172513326"></a>--debug</p>
117</td>
118<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p1245695053215"><a name="p1245695053215"></a><a name="p1245695053215"></a>使能调试信息</p>
119</td>
120</tr>
121<tr id="row951112515321"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p451192515323"><a name="p451192515323"></a><a name="p451192515323"></a>--debug-file</p>
122</td>
123<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p175142583210"><a name="p175142583210"></a><a name="p175142583210"></a>调试信息输出文件路径,默认为std::cout</p>
124</td>
125</tr>
126<tr id="row45116253325"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p85116259328"><a name="p85116259328"></a><a name="p85116259328"></a>--help</p>
127</td>
128<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p1348135833214"><a name="p1348135833214"></a><a name="p1348135833214"></a>帮助提示</p>
129</td>
130</tr>
131<tr id="row194197407327"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.1 "><p id="p154205401325"><a name="p154205401325"></a><a name="p154205401325"></a>--verbose</p>
132</td>
133<td class="cellrowborder" valign="top" width="50%" headers="mcps1.1.3.1.2 "><p id="p369871173312"><a name="p369871173312"></a><a name="p369871173312"></a>增加输出文件的注释信息</p>
134</td>
135</tr>
136</tbody>
137</table>
138
139输入文件:二进制格式的方舟字节码
140
141输出文件:文本格式的方舟字节码
142
143
144更多使用说明请参考:[方舟运行时使用指南](https://gitee.com/openharmony/ark_js_runtime/blob/master/docs/ARK-Runtime-Usage-Guide-zh.md)
145
146## 相关仓<a name="section1371113476307"></a>
147
148**[ark\_runtime\_core](https://gitee.com/openharmony/ark_runtime_core)**
149
150[ark\_js\_runtime](https://gitee.com/openharmony/ark_js_runtime)
151
152[ark\_ts2abc](https://gitee.com/openharmony/ark_ts2abc)
153