Go to file
openharmony_ci 426ec9b91d
!786 Fix module literal problem in literal tag verification
Merge pull request !786 from OneYuan/module_literal
2023-12-12 11:22:35 +00:00
arkplatform Fix arkplatform unit tests for jsnapi 2023-12-08 11:47:13 +03:00
assembler !478 [新需求]: 添加ECMA2022class相关新字节码9条 2023-12-03 15:08:53 +00:00
bytecode_optimizer Fix codecheck of unit tests 2023-08-16 15:47:13 +08:00
cmake Update runtime_core code 2022-07-17 10:20:32 +08:00
compiler !436 Delete abandoned testing code 2023-09-08 02:08:16 +00:00
disassembler !478 [新需求]: 添加ECMA2022class相关新字节码9条 2023-12-03 15:08:53 +00:00
docs Remove unused code 2022-11-28 21:08:24 +08:00
gn disable backward cfi for arkcompiler 2023-05-08 22:22:11 +08:00
isa make version control realized 2023-12-03 13:32:56 +00:00
ldscripts Update runtime_core code 2022-07-17 10:20:32 +08:00
libark_defect_scan_aux 添加ECMA2022class相关新字节码9条 2023-12-02 19:12:44 +08:00
libpandabase Add judgement for ~MapPtr 2023-08-14 18:35:04 +08:00
libpandafile make version control realized 2023-12-03 13:32:56 +00:00
libziparchive Update gn of libz to static link 2023-12-05 17:25:23 +08:00
panda Descriptor: Modify for ark standalone build 2022-11-16 09:40:31 +08:00
pandastdlib Update runtime_core code 2022-07-17 10:20:32 +08:00
platforms Fix compile error on ubuntu 22.04 / gcc-12 / libstdc++-12-dev 2023-07-04 20:41:34 +08:00
plugins/ecmascript/tests Remove unused code 2022-11-28 21:08:24 +08:00
scripts Update runtime_core code 2022-07-17 10:20:32 +08:00
static_core !793 Update test262, ets ignore lists 2023-12-12 08:40:07 +00:00
templates Remove unused code 2022-11-28 21:08:24 +08:00
tests Modify threeParty library as dynamic dependency 2023-02-08 15:29:31 +08:00
verifier Fix module literal problem in literal tag verification 2023-12-09 09:25:44 +00:00
.clang-format copyright update 2022-03-25 13:17:51 +03:00
.clang-tidy copyright update 2022-03-25 13:17:51 +03:00
.gitattributes Remove .gitignore and .gitattributes files 2023-10-23 17:52:59 +03:00
.gitignore [ArkTS] "undefined" ISA int and compiler support 2023-11-17 11:32:09 +03:00
.standalone_gn copyright update 2022-03-25 13:17:51 +03:00
ark_config.gni to change the dependency on libsec_shared to libsec_static in android 32bit sdk lib 2023-06-12 17:17:23 +08:00
ark_root.gni Output log to Hilog for Device 2023-05-30 15:13:45 +08:00
AUTHORS Update runtime_core code 2022-07-17 10:20:32 +08:00
BUILD.gn !786 Fix module literal problem in literal tag verification 2023-12-12 11:22:35 +00:00
bundle.json !714 Include jsnapi in arkplatform 2023-12-06 07:24:43 +00:00
CMakeLists.txt Update runtime_core code 2022-07-17 10:20:32 +08:00
CODEOWNERS Add CODEOWNERS for arkplatform 2023-11-28 11:04:10 +03:00
LICENSE Fix codecheck warnings 2022-08-01 10:18:19 +08:00
OAT.xml Fix codecheck warnings 2023-11-10 12:49:53 +08:00
README_zh.md Update external links in docs 2023-03-21 11:00:33 +08:00
README.md Update external links in docs 2023-03-21 11:00:33 +08:00
static_vm_config.gni Enable compilation of static vm 2023-11-28 11:55:01 +03:00

Runtime Core

Introduction

As 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.

Figure 1 ArkCompiler Runtime Core architecture diagram

ArkCompiler Runtime Core Arch

For more information, see: ARK Runtime Subsystem.

Directory Structure

├── 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.
├── bytecode_optimizer      # Bytecode optimizer, further optimize the ARK bytecode to generate optimized bytecode file in binary format (*.abc).
├── cmake                   # Cmake script that contains the toolchain files and common cmake functions used to define the build and test targets.
├── compiler                # Compiler including IR(intermediate representation) and passes for bytecode optimization. See docs/ir_format.md.
├── cross_values            # Cross values generator.
├── disassembler            # Disassembler that converts an ARK bytecode file in binary format (*.abc) into an ARK bytecode file in text format (*.pa).
├── docs                    # Language frontend, ARK file format, and runtime design documents.
├── dprof                   # Data used to collect the profiling data for ARK runtime.
├── gn                      # GN templates and configuration files.
├── irtoc                   # IR to code tool, aims to compile a manually created IR to the target code.
├── isa                     # Bytecode ISA description file YAML, Ruby scripts and templates.
├── ldscripts               # Linker scripts used to place ELF sections larger than 4 GB in a non-PIE executable file.
├── libark_defect_scan_aux  # Vulnerability defect scanning tool for ARK bytecode file in binary format (*.abc).
├── libpandabase            # Basic ArkCompiler runtime library, including logs, synchronization primitives, and common data structure.
├── libpandafile            # Source code repository of ARK bytecode files (*.abc) in binary format.
├── libziparchive           # Provides APIs for reading and using zip files implemented by zlib.
├── panda                   # CLI tool used to execute ARK bytecode files in binary format(*.abc).
├── pandastdlib             # Standard libraries wrote by the ARK assembler.
├── platforms               # Platform related utilities.
├── plugins                 # Language-dependent plugins.
├── quickener               # Quickener tool.
├── runtime                 # ARK runtime command module.
├── scripts                 # CI Scripts.
├── templates               # Ruby templates and scripts used to process command line options, loggers, error messages, and events.
├── tests                   # Test cases.
└── verification            # Bytecode verifier. See docs/bc_verification.

Building

Linux platform

$ ./build.sh --product-name hispark_taurus_standard --build-target ark_host_linux_tools_packages

Windows platform

$ ./build.sh --product-name hispark_taurus_standard --build-target ark_host_windows_tools_packages

Mac platform

$ ./build.sh --product-name hispark_taurus_standard --build-target ark_host_mac_tools_packages

Guidelines

Usage Guidelines

Assembler ark_asm

The ark_asm assembler converts the text ARK bytecode file into a bytecode file in binary format.

Command:

ark_asm [Options] Input file Output file

Supported options:

Option Description
--dump-scopes Save the result to a JSON file to support the debug mode in Visual Studio Code.
--help Display help information.
--log-file Specify the log file output path after log printing is enabled.
--optimize Enable compilation optimization.
--size-stat Collect statistics and print ARK bytecode information after conversion.
--verbose Enable log printing.
--version Print version info, including file format version and minimum supported file format version.

Input file: ARK bytecodes in text format

Output file: ARK bytecodes in binary format

Disassembler ark_disasm

The ark_disasm disassembler converts binary ARK bytecodes into readable text ARK bytecodes.

Command:

ark_disasm [Options] Input file Output file

Supported options:

Option Description
--debug Enable the function for printing debug information.
--debug-file Specify the path of the debug information output file. The default is std::cout.
--help Display help information.
--quiet Enable all of the "--skip-*" flags.
--skip-string-literals Replace string literals with their respective id's, thus shortening emitted code size.
--verbose Enable log printing.
--version Print version info, including file format version and minimum supported file format version.

Input file: ARK bytecodes in binary format

Output file: ARK bytecodes in text format

For more information, please see: ARK Runtime Usage Guide.

Repositories Involved

arkcompiler_runtime_core

arkcompiler_ets_runtime

arkcompiler_ets_frontend