add version isolation for metadata write path Created-by: fanglou Commit-by: fanglou Merged-by: openharmony_ci Description: ### Issue https://gitcode.com/openharmony/arkcompiler_runtime_core/issues/12503 ### 描述/Description add version isolation for metadata write path ### 原因/Reason add version isolation for metadata write path ### 修改方案/Scheme add version isolation for metadata write path ### **[测试项](https://gitee.com/openharmony/arkcompiler_runtime_core/wikis)** ##### **一、 Runtime Core UT(Release/Debug)** - [ ] 已通过 - [ ] 不涉及,无需验证 1. Host 2. Device ##### **二、Verifier测试** - [ ] 已通过 - [ ] 不涉及,无需验证 ##### **三、Fuzz编译测试** - [ ] 已通过 - [ ] 不涉及,无需验证 ##### **四、64位RK编译** - [ ] 已通过 - [ ] 不涉及,无需验证 ##### **五、编译mac平台sdk** - [ ] 已通过 - [ ] 不涉及,无需验证 ##### **六、指令/abc格式修改自检,需联系下方邮箱,同步至相关领域** **重要:涉及runtime_core仓abc2program、libpandafile、isa目录下的修改,必须提供一个编译helloworld项目的hap包给对应领域,并联系下方邮箱** - [ ] 涉及,已同步 - [ ] 不涉及 **Email:** wutao185@huawei.com ##### **七、Panda_Guard版本号变更自检** - [ ] 涉及,**涉及请联系邮箱:** wutao185@huawei.com - [ ] 不涉及 ##### **八、兼容性测试(指令生成、文件格式修改时)** 1. 小版本兼容性测试 <!-- 修改导致新abc无法运行在老镜像上时,需新增版本号 --> - [ ] 已增加版本号 - [ ] 已通过 - [ ] 不涉及,无需验证 2. 大版本兼容性测试 <!-- 配置target-api-version时,生成的abc需要能在对应版本运行--> - [ ] 已通过 - [ ] 不涉及,无需验证 3. es2abc版本兼容性测试 <!-- 新版本es2abc编译的老版本API的abc文件,应能被老版本es2abc正常识别和处理--> **说明:如PR涉及版本控制用例的变更,需同步检查修改对其他分支的影响,并确认是否要同步受影响的分支** - [ ] 涉及,变更影响 API/字节码 版本, 需同步修改到其他分支 - [ ] 涉及,变更影响 API/字节码 版本, 无需同步到其他分支 - [ ] 不涉及,变更不涉及 API/字节码 版本 ##### **九、是否已执行L0用例 - [ ] 已验证 - [ ] 不涉及。如不涉及,请写明理由 See merge request: openharmony/arkcompiler_runtime_core!14800
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:
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 rk3568 --build-target arkcompiler/runtime_core:ark_host_linux_tools_packages
Windows platform
$ ./build.sh --product-name rk3568 --build-target arkcompiler/runtime_core:ark_host_windows_tools_packages
Mac platform
$ ./build.sh --product-name rk3568 --build-target arkcompiler/runtime_core:ark_host_mac_tools_packages
Guidelines
Usage Guidelines
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.
