25 Star 25 Fork 96

OpenHarmony / arkcompiler_ets_frontend

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

ets_frontend

Introduction

ets_frontend is a front-end tool in the ARK Runtime Subsystem. Combined with the ace-ets2bundle component, it supports converting ETS files into ARK bytecode files.

For more information, see: ARK Runtime Subsystem.

Directory Structure

/arkcompiler/ets_frontend/
├── test262            # scripts for configuration and running Test262
├── testTs             # system test cases
├── es2panda
    ├── aot            # logical entry
    ├── binder         # info binding
    ├── compiler       # compiling logic
    ├── ir             # Bytecode generation
    ├── lexer          # lexical analysis
    ├── parser         # syntax parsing, AST generation
    ├── scripts        # script directory
    ├── test           # test directory
    ├── typescript     # typescript support
    └── util           # tool directory
├── ts2panda
    ├── scripts        # dependency scripts
    ├── src            # source code directory
    ├── templates      # ruby templates
    ├── tests          # unit test cases
    ├── tools          # tools provided by ts2abc
    └── ts2abc         # ts2abc source code

Build

ets_frontend uses the command line interaction mode and converts JS code into ARK bytecode files that can be run on an ARK runtime system. ets_frontend supports Windows, Linux, and macOS. Front-end tools, converting JS source code into ARK bytecode, can be built by specifying the --build-target with ets_frontend_build on Linux.

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

Usage Guidelines

Usage For Es2panda

convert JS to ARK bytecode via es2abc

$ cd out/hispark_taurus/clang_x64/ark/ark/
$ ./es2abc [options] file.js

If no parameter is specified for [options], an ARK binary file is generated by default.

Option

Description

Value Range

Default Value

--debug-info

Provides debug information.

-

-

--debugger-evaluate-expression

Evaluates base64 style expression in debugger

-

-

--dump-assembly

Outputs an assembly file.

-

-

--dump-ast

Prints the parsed AST(Abstract Syntax Tree)

-

-

--dump-debug-info

Prints debug Info

-

-

--dump-literal-buffer

Prints the content of literal buffer

-

-

--dump-size-stat

Displays statistics about bytecodes.

-

-

--extension

Specifies input file type

['js', 'ts', 'as']

-

--help

Displays help information.

-

-

--module

Compiles the code based on the ecmascript standard module.

-

-

--opt-level

Specifies the level for compilation optimization.

['0', '1', '2']

0

--output

Specifies the path of the output file.

-

-

--parse-only

Parse the input file only

-

-

--thread

Specifies the number of threads used to generate bytecode

0-Number of threads supported by your machine

0

Usage For Ts2panda

Install node and npm

convert JS to ARK bytecode

$ cd out/hispark_taurus/clang_x64/ark/ark/build
$ npm install
$ node --expose-gc src/index.js [options] file.js

If no parameter is specified for [options], an ARK binary file is generated by default.

Option

Abbreviation

Description

Value Range

Default Value

--commonjs

-c

Compiles the code based on the commonjs.

-

-

--modules

-m

Compiles the code based on the ecmascript standard module.

-

-

--debug-log

-l

Enables the log function.

-

-

--dump-assembly

-a

Outputs an assembly file.

-

-

--debug

-d

Provides debug information.

-

-

--show-statistics

-s

Displays statistics about bytecodes.

-

-

--output

-o

Specifies the path of the output file.

-

-

--timeout

-t

Specifies the timeout threshold.

-

-

--opt-log-level

-

Specifies the log level for compilation optimization.

['debug', 'info', 'error', 'fatal']

error

--opt-level

-

Specifies the level for compilation optimization.

-

1

--help

-h

Displays help information.

-

-

--bc-version

-v

Outputs the current bytecode version.

-

-

--bc-min-version

-

Outputs the lowest bytecode version supported.

-

-

--included-files

-i

The list of dependent files

-

-

--record-type

-p

Record type info

-

true

--dts-type-record

-q

Record type info for .d.ts files

-

false

--debug-type

-g

Print type-related log

-

false

--output-type

-

Set output type

-

false

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

Repositories Involved

arkcompiler_runtime_core

arkcompiler_ets_runtime

arkcompiler_ets_frontend

About

ts2abc组件是方舟平台的一个组件,其作为方舟编译器中JavaScript语言的前端工具,支持将JavaScript文件转换为方舟字节码文件 expand collapse
Apache-2.0
Cancel

Releases

No release

OpenHarmony

Contributors

All

Activities

Load More
can not load any more
1
https://git.oschina.net/openharmony/arkcompiler_ets_frontend.git
git@git.oschina.net:openharmony/arkcompiler_ets_frontend.git
openharmony
arkcompiler_ets_frontend
arkcompiler_ets_frontend
master

Search