Commit Graph

77 Commits

Author SHA1 Message Date
huoqingyi 007856c303 add aot test
Change-Id: I96638a944dad910a5c3973d1408eeb78dc04ea2f
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-05-19 08:11:57 +08:00
ding 36a1c21412 Fix aot newobjdynrange, Add relevant testcase, Some aot Refactor
1.Fix aot newobjdynrange by call JSFunction::Construct.

2.Add native new test case(new non-native constructor depends on
`defineclass`).

3.Add StackAssertScope in debug mode.

4.Delete retired `call` code in runtime_stubs.

5.Refactor GetArg from macros to inline function in RuntimeStubs.

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: Ic89b98af11f2e2fc97aaeba1704d27a95d2c0c7b
2022-05-17 15:49:53 +08:00
Hailiang Hu 29e19f9d28 AOT Lowering bug fix for getiterator
Add exception branch that lost in orginal code.

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

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: I2debcaff48c9e383e3410605812e455da7a7a2e0
2022-05-17 10:38:17 +08:00
openharmony_ci b1771d6fae !1298 AOT Lowering bug fix for DefineClassWithBuffer
Merge pull request !1298 from Hailiang/aot_lowering
2022-05-16 07:55:22 +00:00
Hailiang Hu ae1b67c849 AOT Lowering bug fix for DefineClassWithBuffer
Remove ResolvClass, instead of using CloneClassFromTemplate to resolve.

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

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: I57f846a02d8c6fcef6215e03fa5abea961329f20
2022-05-16 15:10:21 +08:00
huoqingyi 109ffbc3f6 add TS AOT test
Change-Id: If34d759412a9419edcb7838e9697b57fc4ec36d8
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-05-16 08:30:50 +08:00
wuzhefeng bf8671a948 Refactor Compilation Framework Part-3
There are many similar "call" in the CircuitBuilder and most of them can
be merged or removed. Merge the similar ones and remove the redundant
ones to improve the maintainability and readability.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Ie575580a5d4d3eae67eff49efd8df126d96db48f
2022-05-14 20:21:38 -07:00
lijincheng 8f044ab349 Bugfixs for definefunc and ThrowUndefinedIfHole
1.Avoid always calling RuntimeStub ThrowUndefinedIfHole by default;
2. Fix Value wires error in definefunc, and fix call.s optimizedcalloptimized error
3. Refactoring ReplaceHirToThrowCall in slowpathlowering;

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-05-14 12:33:29 +08:00
haotuo ce8509bd43 add aottests for definegettersetterbyvalue/stobjbyvalue/stobjbyindex/ldobjbyvalue/ldobjbyindex
Signed-off-by: haotuo <haotuo@huawei.com>
Change-Id: I72d9eb08da42a11a962e1e36d4b9e0941338dfce
2022-05-11 22:47:41 +08:00
luochuhao 657e887afd Link and update JSfunction and constpool info in aot execution phase.
Remove unnecessary jsruntime option setting in CreateEcmaVMWithScope.

Tweak llvm lib path in ecmascript/compiler/tests/BUILD.gn.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I563DZ
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I740db8d7dd6d406adda05333edfff50bbc505cc6
2022-05-09 15:31:18 +08:00
openharmony_ci 69c829438e !1235 AOT Lowering bug fix for throwundefindeifhole, newlexenv and poplexenv
Merge pull request !1235 from Hailiang/aot_lowering
2022-05-08 03:41:43 +00:00
Hailiang Hu f532af41e1 AOT Lowering bug fix for newlexenv and poplexenv
1. Add SetCurrentLabel on build loop to fix newlexenv and poplexenv test compile.
2. Add value input on CallRuntime to fix throwundefindeifhole lowering.

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

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: I5a4e9e026b86038153212bc6fa97cad8a54fbaea
2022-05-07 21:16:07 +08:00
xujie 9d0a24d52c Fix Aot Ldfunction Case Bug
1. Set CodeEntry for generator func.
2. Delete Interpreter Frame setup step for LowerDefineGeneratorFunc

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I5f12075d170c35c7f69d601d6f46502b4e653f1b
2022-05-07 16:45:20 +08:00
lijincheng e328dded9f Add Aot Lowering CopyRestArgs
1.Add aot lowering for bytecode: COPYRESTARGS_PREF_IMM16
2.Add test case fot bytecode: COPYRESTARGS_PREF_IMM16

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-05-06 20:57:28 +08:00
xujie 8bf3c232f0 Code Rectification of Aot Lowering
1. The unified callruntime parameter type is tagged.
2. Remove the glue parameter contained in callruntime.
3. Add Ldbigint support in bytecode circuitbuilder.

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: If6fb9047dcb6f109e7c2e379415a968d438cb3ff
2022-05-06 17:24:11 +08:00
openharmony_ci 4054ac0418 !1212 Fix Some Aot bugs About Env And GC
Merge pull request !1212 from 许杰/env_gc_bugfix
2022-05-06 06:14:40 +00:00
xujie acfb4fba5b Fix Some Aot bugs About Env And GC
1.ify the way to get/set lexicalenv for Aot.
2.oved first interpreter entry frame

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I5fce320bba016d3f0ea71df4668b1e0121bd857f
2022-05-06 11:33:04 +08:00
Hailiang Hu 36fba2f7ee AOT Lowering bug fix for getiterator
1. Update depend after CallRuntime to fix RunStateGatesCheck.
2. Remove fast path at ThrowIfNotObject to fix RunStateGatesCheck.

Issue: #I55UCM

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: Id5730022e7f0a5e6c09ffe25b26d1b2a6fb89154
2022-05-05 15:17:48 +08:00
openharmony_ci 4002b645a0 !1140 bc lowering add case
Merge pull request !1140 from songzhengchao/code0426
2022-04-29 05:20:26 +00:00
songzhengchao 9dd88414c1 BC Lowering test
bc: LDFUNCTION_PREF、STSUPERBYVALUE_PREF_V8_V8、LDSUPERBYVALUE_PREF_V8_V8、STCONSTTOGLOBALRECORD_PREF_ID32、STGLOBALVAR_PREF_ID32、DIV2DYN_PREF_V8
MOD2DYN_PREF_V8
EQDYN_PREF_V8
NOTEQDYN_PREF_V8
LESSDYN_PREF_V8
LESSEQDYN_PREF_V8
GREATERDYN_PREF_V8
GREATEREQDYN_PREF_V8
MUL2DYN_PREF_V8
SUB2DYN_PREF_V8
add bc lowering test

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ibf7a1be6212e12ac81db2c30a0f687d92dee3b6f
2022-04-29 09:25:12 +08:00
lijincheng da747b6123 Aot Test Case and Fix bugs in Lowering
1.Add aot test case: CreateEmptyArray and CreateEmptyObject and add them to Aot UT-Test.
2.fix "thisobj and input args" bug of callIThisRangeDyn.
3.Update LowerLdGlobalVar and LowerLdObjByName in lowering.
4.fix "callruntime" bug in lowering of LowerStObjByIndex.

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-04-28 14:15:11 +08:00
taohong d1bd1c9d29 test ldglobalvar && stlettoglobalrecord
Signed-off-by: taohong <hongtao11@huawei.com>
Change-Id: Iaab862583e6ba5505b0c87665292f410d53905f4
2022-04-27 16:12:05 +08:00
luochuhao 90a5373327 First run of an TSAOT-define function Demo.
Record idx in const pool of aot function in llvmmodule and aotcodeinfo.

Tweak code in circuit builder for slowpath lowering scenario where
constpool is null.

New JSFunction object for main function in AOT file and new JSFunction object
for each defined function in lowerDefineFuncDyn.

Fix bug in call.S after JSMethod refactor.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I545X0
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Ie6448f8740caddf79c3b9ed3385ba5739c7eb76b
2022-04-25 12:00:12 +08:00
openharmony_ci 344648dc57 !1079 aot bugfix
Merge pull request !1079 from 许杰/aot_bugfix
2022-04-22 16:41:35 +00:00
xujie f88624fb7d Fix Aot Bug While Calling LoadValueFromConstantStringTable
convert c value arg to taggedValue arg.

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5436K
Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I5b71a68b06a60725f8bf2b5b8aa3a2e9c83ad75d
2022-04-22 14:36:39 +08:00
songzhengchao ecf5fd6eb0 Refactor Logical shift operation
the logical shift does't care signed/unsigned.sometime using UINTxx/Intxx, which is very confusing.

logical operation don't distinguish with int/uint and remove Archxx function

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Idaf71b46227917d2cb08c35118e71c2a66b79fd3
2022-04-21 20:08:23 +08:00
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