mirror of
https://github.com/openharmony/ark_ts2abc.git
synced 2026-07-01 09:24:57 -04:00
d035862fba
Signed-off-by: wanyanglan <wanyanglan1@huawei.com> Change-Id: I3f5f1ddb0ff30ce85c8cccace6d78b7030cff2c6
970 B
970 B
ts2panda
ts2panda aims to translate JavaScript source files into ARK bytecode which could be executed by the ARK runtime.
The whole converter could be splited into several phases.
- tsc(TypeScript compiler) automatically builds the AST for us
- translate TypeScript AST into panda instruction arrays
- apply several passes with the instruction arrays, including:
Run a case
The whole ARK project needs to be built before running cases.
dump panda binary
node --expose-gc ../../out/release/clang_x64/ark/ark/build/src/index.js <your/path/to/case_jsFile> <--> <--output> <output-filename>
dump panda assembly
node --expose-gc ../../out/release/clang_x64/ark/ark/build/src/index.js <your/path/to/case_jsFile> --dump-assembly