98 Commits

Author SHA1 Message Date
wanyanglan a2ec8c761d Add two HIRs RESTORE_REGISTER, SAVE_REGISTER to support generator command
Context is not saved when processing SUSPENDGENERATOR and RESUMEGENERASTOR
instructions, and contextual execution cannot be restored.
1、Add SAVE_REGISTER HIR for saving context
2、RESTORE_REGISTER HIR for restoring context

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I16b73390c6f7ae7c295f0aa1a9c9df538c2a4fec
2022-07-09 16:22:55 +08:00
openharmony_ci 981db37b8e !1726 fixed for assermbler stubs bug in mobile phone
Merge pull request !1726 from getingke/fix_aarch64_aottest
2022-07-07 02:18:36 +00:00
wengchangcheng cd90e396a7 Descriptor: ark hilog refactor
details:
1. use hilog in ohos device
2. use panda logger in host
issue:  https://gitee.com/openharmony/ark_js_runtime/issues/I5FR5J

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I6f5de00751154bdb6aac3101515961a3a4432e80
2022-07-06 22:55:49 +08:00
getingke d314d02335 fixed for proxy bug
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I6bd8842e81a7cce061190fff86345b98bb5b660e
2022-07-06 09:53:50 +08:00
openharmony_ci 344adcb4e6 !1727 Fix ReplaceHirToSubCfg in the multi-lowering
Merge pull request !1727 from dingding/fix_ReplaceHirToSubCfg
2022-07-04 12:01:00 +00:00
huoqingyi 5905b54c34 Fix bugs in ts aot
Description:
1.Fix the bug that Circuit IR args gates do not match the function args of the abc file.
2.Add class ArgumentAccessor to handle args gates of Circuit IR.
3.Modify to set the AOT function entry when constpool is being parsed.
4.For functions sharing the same instructions, add a map to collect duplicate infomation. The key of the map is the current method and the value is the first method with the same nstructions to be translated.

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

Change-Id: I08e48444eb22c4fc2841e1cdae44b90286de84ac
Signed-off-by: huoqingyi <huoqingyi@huawei.com>
2022-07-04 16:19:11 +08:00
ding b36d77eb7e Fix ReplaceHirToSubCfg in the multi-lowering
After add type-lowering, some JSBytecode hirs may have been lowered in
advance. Need handle the scenario.

issue://gitee.com/openharmony/ark_js_runtime/issues/I5FCPW

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: If17a3d137bd91e034ca0a614aeac2f8ac73b6f10
2022-07-04 14:14:15 +08:00
openharmony_ci e0acde7a42 !1690 Put bcStubEntries as offset 0 of glueData
Merge pull request !1690 from 孙哲/master
2022-07-01 09:03:58 +00:00
sunzhe23 1dc1ca0b72 Put bcStubEntries as Offset 0 of glueData
description:
optimize arm performance, interpreter bc dispatch can reduce one instruction

Issue: #I5EM5W

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-07-01 16:21:10 +08:00
openharmony_ci cc2e18da3a !1397 Support lexenv in TSAOT
Merge pull request !1397 from 许杰/env_support
2022-06-30 08:39:15 +00:00
xujie 690ca22d2a Support Lexenv In TSAOT
1. Support lexical env when running tsaot
2. fix getunmappedargs and copyrestargs bugs

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: Ia78ea4d89654d6924c0dee6f491cdf1e4fe718ee
2022-06-30 14:01:26 +08:00
lijincheng 5a438070a4 bugfix for jscall noncallable and ldbigint
1.fix non jstaggedvalue message noncallable id, and wrong glue register in x64

2.fix wrong constpool id using in ldbigint

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-06-30 10:16:17 +08:00
lijincheng 9e3b4029bd Bugfixs for Copyrestargs, CallIRangeDyn, GetUnmappedArgs and ThrowIfNotObject
1.For callee func with variable-length arguments,Aot only receive the first one in variable-length arguments.
  So Change to get all args from OptimizedJsFunctionFrame in JsCall
2.Add path to get all args from OptimizedJsFunctionFrame to GetUnmappedArgs.
3.Fix ThrowIfNotObject error found in aottest case getiterator.ts
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I57L70

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-06-18 11:44:38 +08:00
xujie 6430e8f31e TSAOT Exception Handler
1. Throw JS exception in tsaot
2. Print bcoffset when occur JS exception

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: I046d76c092a399354ddcdedd859f0c1e622387c2
2022-06-11 16:36:16 +08:00
ding 8bfd16debf Refactor GateType
1.Change the implementation of gateType from enum to class.
2.Add some base type opeartions between GateType and GlobalTSTypeRef to simplify the code.
3.Delete class GateTypeCoder
4.Extract GlobalTSTypeRef as an independent file.

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

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I3d80595ebccc9ac942af9b9bcc67c0974bb9b712
2022-06-09 17:32:43 +08:00
lijincheng b4f461f0bc Bugfixs for AsyncFunctionReject and Poplexenv
1.Fix phi state error and parameter type error in LLVM due to wrong value-wires

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

Signed-off-by: lijincheng <lijincheng13@huawei.com>
2022-06-01 12:58:45 +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
wanyanglan cf1d64253b Fix Aot stownbynamewithnameset,stownbyvaluewithnameset Case log
1. Proper construction of circuit IR diagram
2. The method names of anonymous functions are not stripped of the "#" string.

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: Ic1406d293c669386b5456b16cd62991ad4ea6c22
2022-05-23 15:31:49 +08:00
hjzhangcm 88830ed881 fix mastter warning
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-05-20 09:20:01 +08:00
hjzhangcm 7749f58a59 add test case for JSLocale and modify the file where the ICU configuration is located
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-05-19 11:36:54 +08:00
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