Commit Graph

30 Commits

Author SHA1 Message Date
ding 3ea50b760d AOT compiler supports file without type info
Add judement in DecodeTSTypes and GetGateType, to support compiling js
files in AOT.

Add pf_ as a member of BytecodeCircuitBuilder.

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5AZJV

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: Ia16039e0ba455c6618fec3691c3089067a508373
2022-06-07 14:21:04 +08:00
huoqingyi 837f960832 add type infer for more bytecodes
Change-Id: I2f25d587bd8309199480add290105b8f08dd04a3
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-05-30 21:06:45 +08:00
luochuhao 7522f51989 Add multi-abc-file support in stub compiler and aot compiler and related adaptation.
Use methodId of func in pandafile as index for each aot func in llvmModule.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I598P5
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I9646d6a80c8138744ebbd617837550b4661f27d3
2022-05-29 16:59:27 +08:00
taohong 4801aaebb1 refactor type infer
Signed-off-by: taohong <hongtao11@huawei.com>
Change-Id: I7805340a5b85a552a5da3d397e502838e9d8a3d9
2022-05-25 17:39:41 +08:00
dingwen 61b6782b65 Snapshot code optimization
Description:Snapshot code optimization include modify class name SnapShotSerialize to SnapShotHandler, delete some magic number, add interface to acquire global env and global const object index.
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I55CQ3

Signed-off-by: dingwen <dingwen6@huawei.com>
Change-Id: I338028c5cfd4f992095f2bded2956e33f275bb1b
2022-05-07 09:23:06 +08:00
luochuhao 86fda0792b Modify option source of stub compiler.
Using options in js runtime option list and delete stub compiler option.

Add path check for stub compiler generation phase.

Load stub file before loading of aot file.

Add runtime option for optimization level configuration.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I557Q2
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Ifbaa7a2dc4333310c62f1f8e230eefb7a2136ca5
2022-04-29 14:40:18 +08:00
dingwen 6636896a3e Support constpool serialize, global const and global env object reuse, string deduplication
Description:1.Support constpool serialize 2.Global const and global env
object reuse 3.String deduplication
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I54NF5

Signed-off-by: dingwen <dingwen6@huawei.com>
Change-Id: Ia05fb055b8e846a5437ff49d97e0141f72ee112e
2022-04-27 21:16:00 +08:00
ding 755f336a92 Add TS Aot Test Framework
Add TS Aot test framework: supprot running aot whole process test automatically and throwing error messages at each step.

Add tonumber, not, neg module test.

Fix assembler judement in RunPipeline

Add --snapshot-output-file option.

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: Ica09e907c1f03547c1ba80bf639a53d923c01a16
2022-04-25 21:28:10 +08:00
ding d8f0399789 Control whether to print compiler logs through JSRuntime Options
Add option log-compiled-methods to print the compiler(both stub and aot) in units of methods.

Add class CompilerLog.

Refactor some compiler logs.

Unie the log invoked way(COMPILER_LOG or COMPILER_OPTIONAL_LOG).

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I43ce61d0ba9d453713ab3e6349d07f6d9cde3e5e
2022-04-14 16:14:34 +08:00
dingwen 1c70dfbc78 Add snapshot generation step for aot compiler and testing entry of aot compiled function.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4ZOXH
Signed-off-by: dingwen <dingwen6@huawei.com>

Change-Id: I2a52b06453f48407c418e57b3ce62e710042768b
2022-04-10 14:59:33 +08:00
wengchangcheng 2e4dbad3a3 [part-1] support watch expression
1. delete unused execute arguments
2. support select execute entry
3. support get execute return value

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I51MKR

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I40139e2f4afa36ad7d169d7f6c367a62a40bf476
2022-04-09 22:53:42 +08:00
lijincheng 98e9ee462d Aot Lowering
1.lower GETNEXTPROPNAME_PREF_V8, COPYDATAPROPERTIES_PREF_V8_V8, CREATEOBJECTWITHEXCLUDEDKEYS_PREF_IMM16_V8_V8
      CREATEREGEXPWITHLITERAL_PREF_ID32_IMM8, STOWNBYVALUE_PREF_V8_V8, STOWNBYINDEX_PREF_V8_IMM32, STOWNBYNAME_PREF_ID32_V8
      DEFINEGENERATORFUNC_PREF_ID16_IMM16_V8, DEFINEASYNCFUNC_PREF_ID16_IMM16_V8, COPYMODULE_PREF_V8

2.move CompilationConfig to CircuitBuilder. Enable aot's ability to identify platform differences.

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I50KAB

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-04-07 10:30:33 +08:00
openharmony_ci e24a192e4a !931 Aot lowering
Merge pull request !931 from wanyanglan/master
2022-04-06 13:08:46 +00:00
wanyanglan 6f99c9a3f6 Aot Lowering
lower NEWOBJDYNRANGE_PREF_IMM16_V8, JEQZ_IMM8, JEQZ_IMM16, JNEZ_IMM8, JNEZ_IMM16

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I515NO

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: Ia8ebbb51f39cce5b3be69c1a39aa39a0cd74ad81
2022-04-06 17:29:14 +08:00
wengchangcheng 0b4981525d refactor stl container
1. using runtime container instead of stl container
2. change debugger line amd column type to int32_t

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I50NHW

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I0eb4651f17c6f6894f11de1ba904bcbe83a57db7
2022-04-06 16:05:22 +08:00
luochuhao 8c6f8ef20d Implement aot file generated step for aot compiler
Implement llvmIRGeneration Pass in aot compiler pipeline.

Rename and reconstruct LLVMStubModule and LLVMModuleAssembler class. Move aot code infos
related to describe current (code size, begin addr, entry offset of each func etc.)  AOT
snippet and corresponding serialization/deserialization func to NEW class called AotCodeInfo.
Move functions related to file reading/writing to NEW class called AotFileManager.

Add new call opcode in circuit IR to differentiate call into common stubs and call into
runtime interfaces without GC.

Adapt js runtime option for above changes.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4ZDY5
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: If0ab5927ad2551fe5567d1c7b18540fbcc38bc15
2022-03-24 15:44:26 +08:00
openharmony_ci 9614384797 !815 Fix code review from issue
Merge pull request !815 from songzhengchao/reviewcode0321
2022-03-22 08:36:13 +00:00
songzhengchao 718b37beb0 Fix code review from issue
bool variable shoule assign value;
code delete reduant ";" and " ";
class construct function signal parameter shoule add explicit;
function declare return void when caller don't need return value;
and etc

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4YXYH?from=project-issue
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I59e26d49f94e98a4cced7a5852df3029a5544d47
2022-03-22 14:25:18 +08:00
xujie 261cd01813 Fix Compile Issue
Change slowpath_lowering macro RUNTIME_CALL_ID to RTSTUB_ID and
passmanager Interface getCurrent to GetInstance, add lamda reg and
LowerHirToCall.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4YXJT

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: Ib58afdbdbac109c2f3c35e8a6f195aa4995464b5
2022-03-22 11:08:48 +08:00
wengchangcheng fbf3c4a035 share constpool, and modify some code refactor
1. cache constpool in ecma vm
2. use JSPandaFile instead of panda_file::File
3. make GenerateProgram as a static function
4. add a singleton of JSPandaFileManager::GetInstance()

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4WZVV

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: Ic7ccd66764c3a020e575d4046e1792475d45be6b
2022-03-21 21:46:25 +08:00
wanyanglan fd4c928922 Add information such as instruction immediate, method_id, string_id, etc.
The lowering slow path requires not only the vreg information of the
instruction, but also other information such as string id, method id, etc.

For each bytecode instruction, collect the various information stored in
the instruction, and use the information as the input of the gate, and
in the lowering stage, take out the required information from the gate.

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WQR5

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I42ef36554b0b88ce3e1cd0f593e8ce9e924b83e0
2022-03-15 11:02:40 +08:00
冷昌晶 5d171dd75f Merge branch 'master' of gitee.com:openharmony/ark_js_runtime into master 2022-03-08 21:35:20 +08:00
lengchangjing e0d459287f Merge branch 'master' of https://gitee.com/leng-changjing/ark_js_runtime_option 2022-03-07 22:42:06 +08:00
lengchangjing 48e2da7c31 Merge branch 'master' of https://gitee.com/leng-changjing/ark_js_runtime_option 2022-03-07 22:39:05 +08:00
wanyanglan 4f42916899 circuit gate fill in the specific ts type
The type of the circuit gate of the current ts aot is JS_ANY, which does
not bring the data type of the ts itself. It is necessary to fill in the
type information of the ts with the gate to facilitate the type derivation.

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4WLE8

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I5c72e3a918650840847fc965eafbb13b9475acd2
2022-03-07 19:54:28 +08:00
wengchangcheng 65ce5ee62d fix jspandafile of framework file and aot info
1. delete unused logic of framework pandafile
2. refactor native pointer callback
3. fix bug of generate aot info

https://gitee.com/openharmony/ark_js_runtime/issues/I4VSSL

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I3ba318a0bc2c0e95afff6473ff106bc8b5c9dfe4
2022-03-04 15:29:27 +08:00
wengchangcheng 7c7b0e5097 fix actor bug
modify actor for app start

issue:https://gitee.com/openharmony/js_worker_module/issues/I4SMW8

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: Iad48f3173a963c4290701a708f41832359c88b02
2022-03-02 15:33:19 +08:00
xujie 4a570a093c Refactoring of Slowpath Lowering
In order to make the framework code structure clearer and more readable,
it encapsulates multiple calling interfaces, uses clearer variable names,
and draws a comparison diagram before and after lowering, so that
developers can better understand the code.

issue: https://e.gitee.com/open_harmony/dashboard?issue=I4U02P

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: Ied4933d8eac5e4b7b50c894ae496d7cf8d1ff1b0
2022-02-17 20:05:40 +08:00
xujie fb4de0245a Implement frame of generic lowering(HIR To MIR)
Replace all JS_BYTECODE in HIR. In order to simplify the code
implementation, no type judgment is made on the input, and the
slowpath is directly implemented by calling the trampoline function
without affecting the original function. For complex function
implementation, directly encapsulate the entire interpreted code as
a trampoline function.

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: Icd24f7cebb496e4376170784ce1e2e2ef1a7ee71
2022-02-16 09:21:41 +08:00
Hailiang Hu 44d74f7b9c Add AOT Pass Manager
Modify aot compiler main process to pass manager, as to compile file by
file.

Add PassData to manage data interact between passes, PassRunner to
execute every pass that is registered on specific order.

Issue: I4SW05

Change-Id: I5b83b84880c7375e26e1c47e02c9943bfefc647a
Signed-off-by: Hailiang Hu <allenpas@huawei.com>
2022-02-11 09:35:52 +08:00