• Home
Name Date Size #Lines LOC

..--

deps/12-May-2024-

scripts/12-May-2024-1,172966

src/12-May-2024-20,41616,107

templates/12-May-2024-829759

tests/12-May-2024-12,1109,401

tools/12-May-2024-224153

ts2abc/12-May-2024-2,8972,422

.gitignoreD12-May-202420 32

BUILD.gnD12-May-20249.7 KiB346301

README.mdD12-May-20241,004 2320

package-lock.jsonD12-May-2024215.7 KiB4,8914,890

package.jsonD12-May-20241.5 KiB5251

ts2abc_config.gniD12-May-20245.7 KiB187162

tsconfig.jsonD12-May-2024719 3131

webpack.config.jsD12-May-20242.2 KiB7957

README.md

1### ts2panda
2ts2panda aims to translate JavaScript source files into ARK bytecode which could be executed by the ARK runtime.
3
4The whole converter could be splited into several phases.
5* tsc(TypeScript compiler) automatically builds the AST for us
6* translate TypeScript AST into panda instruction arrays
7* apply several passes with the instruction arrays, including:
8    * [register allocator](doc/register_allocator.md)
9    * [intrinsic expander](doc/intrinsic_expander.md)
10    * [panda assembly dumper](doc/assembly_dumper.md)
11    * [panda binary dumper](doc/binary_dumper.md)
12
13### Run a case
14The whole ARK project needs to be built before running cases.
15#### dump panda binary
16```
17node --expose-gc ../../out/release/clang_x64/arkcompiler/ets_frontend/build/src/index.js <your/path/to/case_jsFile> <--> <--output> <output-filename>
18```
19#### dump panda assembly
20```
21node --expose-gc ../../out/release/clang_x64/arkcompiler/ets_frontend/build/src/index.js <your/path/to/case_jsFile> --dump-assembly
22```
23