Commit Graph

51 Commits

Author SHA1 Message Date
openharmony_ci 571a2c44fc !1050 Fix TryLdGlobalByName lowering bug and add getUnmappedArgs lowering
Merge pull request !1050 from 许杰/lowering_bugfix
2022-04-19 07:45:02 +00:00
xujie c131a0d382 Fix TryLdGlobalByName lowering bug and add getUnmappedArgs lowering
rewrite LowerTryLdGlobalByName and add getUnmappedArgs lowering.

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

Signed-off-by: gin <xujie101@huawei.com>
Change-Id: I64c6d70dbc7bf9d39d57e2fafac600d84d26f391
2022-04-19 14:08:15 +08:00
getingke 39229d79c0 fixed for arm64 jscall
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I491578561614ced95073ee4b6975f8a917bebc6d
Signed-off-by: getingke <getingke@huawei.com>
2022-04-18 15:49:20 +08:00
zhengjiahuan eb5582bd24 Add more handlers for more bytecode in AOT slowpath
add handlers for bytecode DefineGetterSetterByValue,
LdObjByIndex, StObjByIndex, LdObjByValue, StObjByValue in AOT slowpath

https://gitee.com/openharmony/ark_js_runtime/issues/I52M76?from=project-issue

Signed-off-by: zhengjiahuan <zhengjiahuan@huawei.com>
Change-Id: Ib8bf09bb52b6cd9d2ca554db365e665d6ad4d036
2022-04-18 10:45:43 +08:00
zhaozhibo 504820705d Merge branch 'master' of gitee.com:openharmony/ark_js_runtime into master 2022-04-17 07:24:50 +00:00
zhaozhibo 398ac87a36 fix codeDex warning(3)
Signed-off-by: zhaozhibo <zhaozhibo3@huawei.com>
2022-04-17 15:23:43 +08:00
xujie cf0becfdba Add Slowpath Aot Lowering
Aot lowering for AsyncFunctionEnter, TypeOfDyn, ResumeGenerator,
GetResumeMode, DefineNCFuncDyn, DefineMethod

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I5b32726d41580bcb0d7baa9bed6b3941fef23384
2022-04-16 17:35:30 +08:00
openharmony_ci 1c4cfd2c8b !1004 Add lowering of define function dyn.
Merge pull request !1004 from luochuhao/definefunc
2022-04-16 08:09:25 +00:00
Hailiang Hu 21910d56d5 Bug fix for ReplaceHirToSubCfg
Remove noThrow param of ReplaceHirControlGate in IF_SUCCESS branch.

Issue: #I531SH

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Ibb2dc2da9bc76a1708c61c07002da20de21fa78a
2022-04-16 14:53:03 +08:00
luochuhao 08b2c27a2a Add lowering of define function dyn.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I52KRX
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I3a798b2c4be13bf12eb77806d5a32dc5e83a7416
2022-04-16 14:48:10 +08:00
Hailiang Hu 55d0b3b9a1 AOT Slowpath Refactor
Rename C_VALUE to NJS_VALUE, simplify using of RTSTUB_ID in
GetValueFromConstStringTable, rename LowerHirToMir to
ReplaceHirToSubCfg.

Issue: #I5311R

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Ib9b8ea04b090c21569e1bffa2b63dd0ebf843ef1
2022-04-16 10:40:07 +08:00
Hailiang Hu c089b204e8 AOT Refactor for CircuitBuilder and Slowpath
1. Remove low level CircuitBuilder, make flat of this interface.
2. Move some interface of LabelManager to CircuitBuilder, and rename to Environment.
3. Refactor some interface of MergeMirCircuit, LowerHirToCall,
   LowerHirToConditionCall and so on.

Issue: #I52VPJ

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Ib8f20e7137c8006a0735cefea9fe243513744652
2022-04-15 21:01:01 +08:00
lijincheng 249e7bd21f Bugfix in Aot
1.Fix bugs found in AOT Running Debug
2.Change GetObjectFromConstPool to " callRuntime LoadValueFromConstantStringTable "
   in lowering for getting correct string in constpool when in-value-gate in irbuilder is "StringId"

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-04-15 14:31:41 +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
zhaozhibo 71f2d7e0eb Merge branch 'master' of gitee.com:openharmony/ark_js_runtime into master 2022-04-14 02:57:27 +00:00
zhaozhibo a57029dc79 fix codeDex warning.
Signed-off-by: zhaozhibo <zhaozhibo3@huawei.com>
2022-04-14 10:56:51 +08:00
getingke ef35c0cad8 Lowering these call opcode of bytecode:
CALLARG0DYN_PREF_V8
CALLARG1DYN_PREF_V8_V8
CALLARGS2DYN_PREF_V8_V8_V8
CALLARGS3DYN_PREF_V8_V8_V8_V8
CALLITHISRANGEDYN_PREF_IMM16_V8
CALLIRANGEDYN_PREF_IMM16_V8

when function need call another js function, it will lowering to call "JSCall" trampoline function
JSCall trampoline function will check calltarget function, then correct the arguments, finally jump
the native or optimized code address of the target function

https://gitee.com/openharmony/ark_js_runtime/issues/I52KN7?from=project-issue

Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I6be3f130b211ca7c51a557f9ace4bd20d46c4d04
2022-04-13 19:25:06 +08:00
huoqingyi 059d3e7ab6 Add Aot SlowpathLowering
Change-Id: Ie2399770c5e2d3b38b40a4b50d4ff57d23d6d1b4
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-04-12 21:38:05 +08:00
openharmony_ci 2df453bef0 !980 Modify for helloworld demo on AOT framework
Merge pull request !980 from luochuhao/helloworld
2022-04-12 06:35:24 +00:00
luochuhao 89e18a6381 Modify for helloworld demo on AOT framework
Adaptation on serialization and deserialization of snapshot file is needed,
for providing string constant table.

Tweak on callarg1dyn runtime stub.

Adjust initialization sequence of tsloader and global constant to cope with snapshot
deserilization.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I527BJ
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I20a82dd0dbeec368b4ff93db4cca8d0ffbdb6717
2022-04-12 13:50:09 +08:00
lijincheng d4f442fdd2 Aot Lowering
1.lower LDLEXVARDYN_PREF_IMM4_IMM4, LDLEXVARDYN_PREF_IMM8_IMM8, LDLEXVARDYN_PREF_IMM16_IMM16
        STLEXVARDYN_PREF_IMM4_IMM4_V8, STLEXVARDYN_PREF_IMM8_IMM8_V8, STLEXVARDYN_PREF_IMM16_IMM16_V8
        NEWLEXENVDYN_PREF_IMM16

2.bugfix Fix the adaptation bug of "ARCH" in llvmIrbuilder, and some other lowering bugs found in LLVMCodegen Test.

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-04-12 11:04:31 +08:00
taohong b82a13c5f1 Add STLETTOGLOBALRECORD etc slow path
Add STLETTOGLOBALRECORD bytecode slow path

Signed-off-by: hongtao <hongtao11@huawei.com>
Change-Id: Ie0f504b67b8fd8b9e1e339acdfb1831fbdeba601
2022-04-11 20:47:16 +08:00
wanyanglan 6ec13ebf1f Aot Lowering
lowering LDSUPERBYVALUE_PREF_V8_V8, STSUPERBYVALUE_PREF_V8_V8,
TRYSTGLOBALBYNAME_PREF_ID32, STCONSTTOGLOBALRECORD_PREF_ID32,
LDFUNCTION_PREF

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I3bff9dda0bd4455fdf9348f47586f1097287c0e2
2022-04-11 09:14:11 +08:00
Hailiang Hu c071531719 Add AOT Slowpath Lowering
Lowering for NEWLEXENVDYN, NEWLEXENVWITHNAMEDYN, POPLEXENVDYN.

Issue: I51VGS

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: I001c7bd23c03d2dbc0a1647a652c289204a8dc92
2022-04-09 19:35:17 +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
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
luochuhao bef0e1d1fd Adaptation for aot framework helloworld test.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4ZL8V
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I32bf175d4aea43dab2d408ea0347a14a4b5903cb
2022-04-02 15:29:44 +08:00
huoqingyi 6bb92a49fe add slowpath lowering
Change-Id: I30a39267c112b1bf0fa4068ae4e50e643241fcd5
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-04-01 17:19:25 +08:00
wuzhefeng 1e2aa2a487 Refactor Code
Because there are some redundant/unused/improper functions, this PR
remove them and improve the readability.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Ifa08f33a2819f3113234fdbf3ee2bb0e976d4071
2022-03-31 16:16:31 -07:00
Hailiang Hu aa0510f7da Refactor slowpath lowering, add module related lowering
Share GateAccessor and CircuitBuilder in SlowPathLowering,
clear temporary used label manager after every lowering,
then it can reduce the repeating code.
Add lowering of LDMODULEVAR, GETMODULENAMESPACE, and so on.

Issue: I5003A
Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: I3e4021511c72c91c3ad5246a022d230aa3215368
2022-03-29 17:04:06 +08:00
lijincheng c5e2c97cb9 bugfix for slowpathlowering
Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-03-28 19:14:37 +08:00
lijincheng b9486a89ca add slowpathlowering to 7 bytecodes
Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-03-28 15:29:41 +08:00
Hailiang Hu 8654c7f121 Add throw related lowering, binary operator lowering
Throw lowering: THROWIFNOTOBJECT, THROWUNDEFINEDIFHOLE, strengthen HirToThrowCall.
Binary operator lowering: SHL2DYN, SHR2DYN, ASHR2DYN, ASHR2DYN, OR2DYN, XOR2DYN,
DELOBJPROP, EXPDYN, ISINDYN, INSTANCEOFDYN, STRICTNOTEQDYN, STRICTEQDYN.
And add LowerHirToFastCall to support lowering without exception.

Issue: I4ZGAD

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Ibd679f70181a20013ea551a247a108e789c28451
2022-03-25 11:07:40 +08:00
lijincheng 867175f50a fix compile error
Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-03-23 10:54:09 +08:00
openharmony_ci 7f8893b26a !799 Add Slowpath Lowering ToNumber NegDyn NotDyn
Merge pull request !799 from dingding/slow_lowering
2022-03-22 07:14:14 +00: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
ding a5a45f7c12 Add Slowpath Lowering ToNumber NegDyn NotDyn
Add three slowpath lowering implements: ToNumber, NegDyn and NotDyn

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: Ib9c0af870ce7ba859e44e7f7c357200989f1b637
2022-03-22 09:50:13 +08:00
xujie 2ff12ff3c5 Add Iterator And Arithmetic Related Lowering
lowering HIR related to iterator and arithmetic, including GetPropIterator,
IterNext, CloseIterator, IncDyn, DecDyn are supported.

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I6dd2d5e77e6eb2d894284b9525f54844a8a119fb
2022-03-21 20:32:13 +08:00
wanyanglan 2e316aed49 Aot lowering
support LDGLOBALTHIS_PREF, LDSYMBOL_PREF, LDGLOBAL_PREF,
SUB2DYN_PREF_V8, MUL2DYN_PREF_V8, DIV2DYN_PREF_V8, MOD2DYN_PREF_V8,
EQDYN_PREF_V8, NOTEQDYN_PREF_V8, LESSDYN_PREF_V8, LESSEQDYN_PREF_V8,
GREATERDYN_PREF_V8, GREATEREQDYN_PREF_V8

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: Ie0edb4c9ecc79fae29b1365783dbadb1f8d6451f
2022-03-19 15:02:08 +08:00
wuzhefeng aa44e06513 Fix compilation errors
Because there are some macros that trigger compilation errors when
compiling stub-compiler and aot-compiler. The root cause is that several
classes declarations are missing from the associated macros. This PR
fixes the issues via adding the lost classes to the macros. Besides, we
also rename the FastStub to CommonStubs in order to make the stub-arch
more readable.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I16263fef7deeadf8a9ce4e5252a6e9898a7742bc
2022-03-18 18:17:21 -07:00
openharmony_ci d1fab2d5ea !792 Refactor of runtime stub, optimizer stub and bytecode handler define mechanism
Merge pull request !792 from luochuhao/stubmoduleModify
2022-03-18 15:14:45 +00:00
luochuhao c705ce054b Refactor ID definition and callSignature initialization mechanism of stubs
Refactor ID definition and callSignature initialization mechanism of runtime stub,
optimizer stub and bytecode handler stub,
reduce amount and complexity of macro used in calling those stubs.

Add stubDes struct to classify stubs both in AOT file generation phase
and AOT file loading phase.

Fix some circular dependency problems in including header files.

Fix certain inline function declaration and definition format problems, which could lead to
compiling errors.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4VMLD?from=project-issue
Test: stubTest(unit test), richards with asm interpreter enabled
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Ibd5fcd963347b97f8dec227f3245d2064463b0b0
2022-03-18 22:01:52 +08:00
Hailiang Hu e12e961b3e Add throw related lowering
Support GET_EXCEPTION, THROWDYN_PREF, THROWCONSTASSIGNMENT_PREF_V8, and so on.

Issue: I4XZXC

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Ide2fff6dad1f9d7312db4b6133649a5fb651b14b
2022-03-18 15:16:46 +08:00
xujie 71bf2ff5c5 Add AOT call lowering and refactor trampoline function
lowering HIR related to call, including CallArg0Dyn, CallArg1Dyn, CallArgs2Dyn, CallArgs3Dyn,
CallIThisRangeDyn, CallSpreadDyn,CallIRangeDyn. Currently only native call are supported.
Inline slowpath function in trampoline file.

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I4525f62c5b9307adb5cf323352695e4db98fae1b
2022-03-16 15:38:07 +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
sunzhe23 57fe644984 refactor runtime trampoline id
Description:
add runtime_trace for runtime trampoline
mov runtime_trampolines.cpp info cmascript/trampoline/
rename FAST_STUB_ID as RUNTIME_CALL_ID

issue: #I4XBC9

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-11 02:17:24 -08:00
Hailiang Hu e452f01e53 AOT lowering
Add lower hir to condition call, get iterator lower

Issue: I4WKOZ

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Ieb78a3ef0bebc35f7edd4224b55393c44bbbeee2
2022-03-08 18:49:48 +08:00
wanyanglan 37d1f2b515 Aot lowering
lowering  LDLEXENVDYN_PREF, LDA_STR_ID32, STGLOBALVAR_PREF_ID32 and
TRYLDGLOBALBYNAME_PREF_ID32

issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4UAZJ?from=project-issue

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: Icd7538c2187257099e846761426f07a1996f77c5
2022-03-03 19:57:10 +08:00
Hailiang Hu c8643f01cf SlowPath lowering support more HIR to MIR
Readjustment lowering code style, support CREATEITERRESULTOBJ,
CREATEITERRESULTOBJ, ASYNCFUNCTIONAWAITUNCAUGHT, and so on.

Issue: I4V5YQ

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: I22f9c600ba25a9aa0d78adedd17ef249260b9e01
2022-02-24 20:17:49 +08:00
openharmony_ci eadd4e967a !570 Refactoring of Slowpath Lowering
Merge pull request !570 from 许杰/RefactorLowering
2022-02-17 14:01:59 +00:00