• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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