Merge several articles on development examples, environment installation and compilation, and tool use, update compilation commands, and add aot-related tool introduction issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I6JK9W Signed-off-by: changjiaxing <changjiaxing2@huawei.com> Change-Id: I7aca4d148effa8a72fa61197b670f24d7cd9078e
17 KiB
Using the Toolchain
The ARK front-end tools use the command line interaction mode and convert JS code into ARK bytecodes that can run on ARK runtime. The toolchain supports Windows, Linux, and macOS.
JS Bytecode Compiler
Front-end tools, converting JS source code into ARK bytecode, can be built by specifying the --build-target
with ark_ts2abc
.
Build tools:
$ $ ./build.sh --product-name rk3568 --build-target ark_ts2abc_build
Install node
and npm
, then use tools:
$ cd out/rk3568/clang_x64/arkcompiler/ets_frontend/build
$ npm install
$ node --expose-gc src/index.js [option] file.js
Assembler ark_asm
The ark_asm assembler converts the text ARK bytecode file into a bytecode file in binary format.
Command:
ark_asm [Option] Input file Output file
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 [Option] Input file Output file
Specifies the path of the debug information output file. The default value is std::cout. |
|
Input file: ARK bytecodes in binary format
Output file: ARK bytecodes in text format