• Home
Name Date Size #Lines LOC

..--

abc2program/07-Sep-2024-5,4394,031

arkplatform/07-Sep-2024-413279

assembler/07-Sep-2024-22,89517,481

bytecode_optimizer/07-Sep-2024-10,5247,930

cmake/07-Sep-2024-3,9013,440

compiler/07-Sep-2024-73,75756,963

disassembler/07-Sep-2024-7,5205,514

docs/07-Sep-2024-8,5966,666

gn/07-Sep-2024-1,6701,469

isa/07-Sep-2024-3,0852,675

ldscripts/07-Sep-2024-457418

libark_defect_scan_aux/07-Sep-2024-4,6353,651

libpandabase/07-Sep-2024-29,44920,954

libpandafile/07-Sep-2024-20,86715,878

libziparchive/07-Sep-2024-1,300962

panda/07-Sep-2024-348271

pandastdlib/07-Sep-2024-707548

platforms/07-Sep-2024-4,0242,629

plugins/ecmascript/tests/07-Sep-2024-11881

scripts/07-Sep-2024-2,0571,473

static_core/07-Sep-2024-1,344,9841,093,845

templates/07-Sep-2024-959738

tests/07-Sep-2024-253,333231,985

verifier/07-Sep-2024-2,0671,462

.clang-formatD07-Sep-20243.7 KiB127125

.clang-tidyD07-Sep-20243.4 KiB7674

.gitattributesD07-Sep-2024341 108

.gitignoreD07-Sep-2024994 3837

.standalone_gnD07-Sep-2024877 2318

AUTHORSD07-Sep-20241.8 KiB137136

BUILD.gnD07-Sep-202410.6 KiB380337

CMakeLists.txtD07-Sep-202413.3 KiB367290

CODEOWNERSD07-Sep-2024663 1916

LICENSED07-Sep-202410.5 KiB192160

OAT.xmlD07-Sep-20245.4 KiB7524

README.mdD07-Sep-20246.3 KiB10881

README_zh.mdD07-Sep-20245.6 KiB10581

ark_config.gniD07-Sep-20248.1 KiB270228

ark_root.gniD07-Sep-20241,015 2925

bundle.jsonD07-Sep-20247.1 KiB182181

static_vm_config.gniD07-Sep-2024811 2320

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  - [Building](#building)
7  - [Guidelines](#guidelines)
8    - [Usage Guidelines<a name="section1312121216216"></a>](#usage-guidelines)
9      - [Disassembler ark\_disasm](#disassembler-ark_disasm)
10  - [Repositories Involved<a name="section1371113476307"></a>](#repositories-involved)
11
12## Introduction<a name="section11660541593"></a>
13
14As a common module of language runtime in OpenHarmony, ArkCompiler Runtime Core consists of language-independent basic runtime libraries, including ArkCompiler File, Tooling, Base and ISA. ArkCompiler File provides bytecodes and information required for executing bytecodes. Tooling supports runtime debugger. Base is responsible for implementing platform related utilities. ISA provides common instruction set architecture that is language-independent.
15
16**Figure 1** ArkCompiler Runtime Core architecture diagram:
17
18![ArkCompiler Runtime Core Arch](docs/images/runtime_core_arch.png)
19
20For more information, see: [ARK Runtime Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/ARK-Runtime-Subsystem.md).
21
22## Directory Structure<a name="section161941989596"></a>
23
24```
25├── assembler               # Assembler that converts an ARK bytecode file in text format (*.pa) into a bytecode file in binary format (*.abc). For details about the format, see docs/assembly_format.md and docs/file_format.md.
26├── bytecode_optimizer      # Bytecode optimizer, further optimize the ARK bytecode to generate optimized bytecode file in binary format (*.abc).
27├── cmake                   # Cmake script that contains the toolchain files and common cmake functions used to define the build and test targets.
28├── compiler                # Compiler including IR(intermediate representation) and passes for bytecode optimization. See docs/ir_format.md.
29├── cross_values            # Cross values generator.
30├── disassembler            # Disassembler that converts an ARK bytecode file in binary format (*.abc) into an ARK bytecode file in text format (*.pa).
31├── docs                    # Language frontend, ARK file format, and runtime design documents.
32├── dprof                   # Data used to collect the profiling data for ARK runtime.
33├── gn                      # GN templates and configuration files.
34├── irtoc                   # IR to code tool, aims to compile a manually created IR to the target code.
35├── isa                     # Bytecode ISA description file YAML, Ruby scripts and templates.
36├── ldscripts               # Linker scripts used to place ELF sections larger than 4 GB in a non-PIE executable file.
37├── libark_defect_scan_aux  # Vulnerability defect scanning tool for ARK bytecode file in binary format (*.abc).
38├── libpandabase            # Basic ArkCompiler runtime library, including logs, synchronization primitives, and common data structure.
39├── libpandafile            # Source code repository of ARK bytecode files (*.abc) in binary format.
40├── libziparchive           # Provides APIs for reading and using zip files implemented by zlib.
41├── panda                   # CLI tool used to execute ARK bytecode files in binary format(*.abc).
42├── pandastdlib             # Standard libraries wrote by the ARK assembler.
43├── platforms               # Platform related utilities.
44├── plugins                 # Language-dependent plugins.
45├── quickener               # Quickener tool.
46├── runtime                 # ARK runtime command module.
47├── scripts                 # CI Scripts.
48├── templates               # Ruby templates and scripts used to process command line options, loggers, error messages, and events.
49├── tests                   # Test cases.
50└── verification            # Bytecode verifier. See docs/bc_verification.
51```
52
53## Building
54
55**Linux platform**
56```
57$ ./build.sh --product-name hispark_taurus_standard --build-target ark_host_linux_tools_packages
58```
59**Windows platform**
60```
61$ ./build.sh --product-name hispark_taurus_standard --build-target ark_host_windows_tools_packages
62```
63**Mac platform**
64```
65$ ./build.sh --product-name hispark_taurus_standard --build-target ark_host_mac_tools_packages
66```
67
68## Guidelines
69
70### Usage Guidelines<a name="section1312121216216"></a>
71
72#### Disassembler ark\_disasm
73
74The ark\_disasm disassembler converts binary ARK bytecodes into readable text ARK bytecodes.
75
76Command:
77
78```
79ark_disasm [Options] Input file Output file
80```
81
82Supported options:
83
84| Option                 | Description                                                                                  |
85|------------------------|----------------------------------------------------------------------------------------------|
86| --debug                | Enable the function for printing debug information.                                          |
87| --debug-file           | Specify the path of the debug information output file. The default is `std::cout`.           |
88| --help                 | Display help information.                                                                    |
89| --quiet                | Enable all of the "--skip-\*" flags.                                                         |
90| --skip-string-literals | Replace string literals with their respective id's, thus shortening emitted code size.       |
91| --verbose              | Enable log printing.                                                                         |
92| --version              | Print version info, including file format version and minimum supported file format version. |
93
94Input file: ARK bytecodes in binary format
95
96Output file: ARK bytecodes in text format
97
98
99For more information, please see: [ARK Runtime Usage Guide](https://gitee.com/openharmony/arkcompiler_ets_runtime/blob/master/docs/README.md).
100
101## Repositories Involved<a name="section1371113476307"></a>
102
103**[arkcompiler\_runtime\_core](https://gitee.com/openharmony/arkcompiler_runtime_core)**
104
105[arkcompiler\_ets\_runtime](https://gitee.com/openharmony/arkcompiler_ets_runtime)
106
107[arkcompiler\_ets\_frontend](https://gitee.com/openharmony/arkcompiler_ets_frontend)
108

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  - [编译构建](#编译构建)
7  - [说明](#说明)
8    - [使用说明<a name="section1312121216216"></a>](#使用说明)
9      - [反汇编器工具概述](#反汇编器工具概述)
10  - [相关仓<a name="section1371113476307"></a>](#相关仓)
11
12## 简介<a name="section11660541593"></a>
13
14方舟编译器运行时公共组件(ArkCompiler Runtime Core)是OpenHarmony中语言运行时的公共组件。主要由与语言无关的基础运行库组成,包含承载字节码以及执行字节码所需要相关信息的ArkCompiler File文件组件、支持运行时调试的Debugger Tooling工具组件、提供不同系统平台公共接口的ArkCompiler Base基础库组件、以及与语言无关的公共指令集体系结构ISA等。
15
16**图1** 方舟编译器运行时公共组件架构图:
17
18![方舟编译器运行时公共组件架构图](docs/images/runtime_core_arch.png)
19
20更多信息请参考:[方舟运行时子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/ARK-Runtime-Subsystem-zh.md)
21
22## 目录<a name="section161941989596"></a>
23
24```
25/arkcompiler/runtime_core
26├── assembler               # 汇编器,将文本格式的方舟字节码文件(*.pa)转换为二进制格式的字节码文件(*.abc),具体格式见:docs/assembly_format.mddocs/file_format.md
27├── bytecode_optimizer      # 字节码优化器,对方舟字节码进行进一步优化生成带优化的字节码文件(*.abc)
28├── cmake                   # Cmake脚本,包含工具链文件和用于定义构建和测试目标的常用cmake函数
29├── compiler                # 编译器,主要包含用于字节码优化的IR和passes等,更多信息可参:docs/ir_format.md
30├── cross_values            # 交叉值生成器
31├── disassembler            # 反汇编器,将二进制格式的方舟字节码文件(*.abc)转换为文本格式的方舟字节码文件(*.pa)
32├── docs                    # 包含语言前端、方舟文件格式和运行时的设计文档
33├── dprof                   # 用于ArkCompiler运行时收集profile数据
34├── gn                      # GN模板和配置文件
35├── irtoc                   # IR to code工具,将手工创建的IR编译为目标代码,具体可以参考:docs/irtoc.md
36├── isa                     # 字节码ISA描述文件YAML,ruby脚本和模板
37├── ldscripts               # 包含链接器脚本,用于在非PIE可执行文件中放置4GB以上的ELF section
38├── libark_defect_scan_aux  # 提供二进制格式方舟字节码文件(*.abc)的漏洞扫描接口
39├── libpandabase            # ArkCompiler运行时基本库,包含:日志、同步原语、公共数据结构等
40├── libpandafile            # 二进制格式的方舟字节码文件(*.abc)源码仓
41├── libziparchive           # 提供基于zlib库实现的读写压缩文件接口
42├── panda                   # CLI工具,用于执行方舟字节码文件(*.abc)
43├── pandastdlib             # 通过方舟汇编语言编写的标准库
44├── platforms               # 与系统平台相关的基础接口实现
45├── plugins                 # 部分与语言相关的插件
46├── quickener               # 加速器
47├── runtime                 # ArkCompiler运行时公共组件
48├── scripts                 # CI脚本
49├── templates               # ruby模板和脚本,处理包括:命令行选项、日志组件、错误消息、事件等
50├── tests                   # 测试用例
51└── verification            # 字节码验证器,具体可以参考:docs/bc_verification
52```
53
54## 编译构建
55**Linux平台**
56```
57$ ./build.sh --product-name hispark_taurus_standard --build-target ark_host_linux_tools_packages
58```
59**Windows平台**
60```
61$ ./build.sh --product-name hispark_taurus_standard --build-target ark_host_windows_tools_packages
62```
63**Mac平台**
64```
65$ ./build.sh --product-name hispark_taurus_standard --build-target ark_host_mac_tools_packages
66```
67
68## 说明
69### 使用说明<a name="section1312121216216"></a>
70
71#### 反汇编器工具概述
72
73工具名称为ark\_disasm,用于将二进制格式的方舟字节码文件转换为文本格式的方舟字节码文件。
74
75命令行格式:
76
77```
78ark_disasm [选项] 输入文件 输出文件
79```
80
81| 选项 | 描述 |
82|------------------------|----------------------------------|
83| --debug                | 使能调试信息 |
84| --debug-file           | 调试信息输出文件路径,默认为std::cout |
85| --help                 | 帮助提示 |
86| --quiet                | 使能所有"--skip-\*"选项 |
87| --skip-string-literals | 跳过对字符串字面量的反汇编 |
88| --verbose              | 增加输出文件的注释信息 |
89| --version              | 打印版本信息,包括当前和所支持的最低的文件格式版本 |
90
91输入文件:二进制格式的方舟字节码
92
93输出文件:文本格式的方舟字节码
94
95
96更多使用说明请参考:[方舟运行时使用指南](https://gitee.com/openharmony/arkcompiler_ets_runtime/blob/master/docs/README_zh.md)
97
98## 相关仓<a name="section1371113476307"></a>
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