107 Commits

Author SHA1 Message Date
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
g00416891 f11810349e New EcmaRuntimeCallInfo in stack pointer
Signed-off-by: g00416891 <guobingbing3@huawei.com>
Change-Id: I466a4107e6e073ffecea12e6986c112731d2d3bf
2022-07-05 14:54:43 +08: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
getingke 9f179d07e6 fixed for aarch64 aot test case
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I04c74548641655d66fcb0f10041ab87d7b4bf868
2022-06-23 16:46:13 +08:00
getingke 014d16dbec fixed for review by wuzhefeng
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I17859729a2fc2f2e951312e5cd4a21210e3a9024
2022-06-23 10:08:12 +08:00
getingke 39943ece43 fixed for aarch64 aot test case
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I17fe5a44b06d351d11fb02b77e375f9c9d54df17
2022-06-22 15:09:18 +08:00
songzhengchao 8975897bb1 Merge remote-tracking branch 'szc/FrameHandler2'
Change-Id: Icd0e4b9895cf1ecba52d1a6e39566fe0c93a3ae9
2022-06-16 16:52:49 +08:00
songzhengchao 621329220d Frame Handler refactor
Frame Handler directly operate frame(set
callsitesp/returnAddr/getPrevFrame,etc) which is hard to maintain.
Frames are operated by FrameIterator.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5CKVR?from=project-issue

Change-Id: Iba1c44c1ab1afec8b5bea0111f4e986b47cc8bc4
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2022-06-16 14:41:44 +08:00
songzhengchao 3b27785037 Code review
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5BSW4

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I7b822d9bf29d5978f3fdaab4f7aee103421319d4
2022-06-14 16:02:10 +08:00
songzhengchao 0ea2b9cb3c Merge branch 'master' of gitee.com:openharmony/ark_js_runtime
Change-Id: I92c67c8e0c106177b9ae2ec3ea2aa31247c35023
2022-06-14 11:04:48 +08:00
songzhengchao 3b2885585d Refactor Frame and add Iterator
The background of the problems is as follows:
1 Current iterator current Frame, visit previous Frame stackmap, it's hard to understand.
2 refactor llvm_stackmap_parser
3 refactor frameHandler, we should provider iterator to visit frame.

The solution of the problems is as follows:
1 FrameHandler Ietrator only visit current Frame stackmap
2 In the future, multiple vm may be existed such as multiple worker.while llvm_stackmap_parser is singleton which is not good, each vm should have one stackmap.
3. refactor frame add FrameIterator to visit frame

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I65988624ef42a28788a5268d898e37ebf752c901
2022-06-14 10:15:33 +08:00
songzhengchao 867eb5f85b Merge branch 'master' of gitee.com:openharmony/ark_js_runtime
Change-Id: Icab22a5939f3a284f016e147614eb83784a0ec48
2022-06-13 19:12:43 +08:00
zhangyukun 78b91bf542 adapt newobjdynrange on arm64
1. fix getthis on x64
2. adapt optimization of newobjdynrange on arm64
3. add bridge frame to support GC of setter and getter

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

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I09c5fc89b2486d0b9988d9bef0af65f77dc2f684
2022-06-12 16:54:24 +08:00
songzhengchao b4b4482475 refactor frameHandler
refactor frame add FrameIterator to visit frame

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ieb408a2334098043e504a8527aac008b8d0181a1
2022-06-11 20:47:30 +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
songzhengchao 045c51360a refactor llvm_stackmap_parser
In the future, multiple vm may be existed such as multiple worker.each
vm should have one stackmap, while llvm_stackmap_parser is singleton
which is not good.

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I7501c656f27a2fd34225928079f23a196e7f0bbf
2022-06-11 14:22:00 +08:00
songzhengchao 7918b740d1 Refactor FrameHandler Iterator
1 FrameHandler Ietrator only visit current Frame stackmap

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5BSW4?from=project-issue
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Id05e57d9dd8c00ff91c596fc2cbb1feabe3aa4da
2022-06-11 11:40:04 +08:00
openharmony_ci cabfe1a62e !1345 Implement Prologue refactor and Add mulitple Optimized Frame In LLVM 12.0.1
Merge pull request !1345 from songzhengchao/optimizedjsfunction
2022-06-07 13:49:24 +00:00
songzhengchao dfb9eeaa92 Revert "debug"
This reverts commit dd4c6e829b.

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Iafb4e81981e7b3eef79672684aa4dfc8e75f791a
2022-06-07 15:57:19 +08:00
Rtangyu 8ca37dcb29 JS stack printing supports native method pointer printing
Implement JS stack printing and support native method pointer printing

issue:https://gitee.com/openharmony/arkui_napi/issues/I5AOZC

Signed-off-by: Rtangyu <rentangyu@huawei.com>
2022-06-07 14:33:17 +08:00
songzhengchao e189c888a0 Merge remote-tracking branch 'szc/optimizedjsfunction'
Change-Id: I3451ce3ba039c43f4cebedbc6d5636bbf70d234c
2022-06-07 14:22:34 +08:00
songzhengchao dd4c6e829b debug
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ie19553066c5f038237c2f06b42dd2b2a64721a8e
2022-06-06 10:05:14 +08:00
songzhengchao ea9f7cc660 bug fix framehander should update optimizedReturnAddr_
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I78c1b054ca527f5fa3dd5f15a699114be9352ad3
2022-06-03 19:59:09 +08:00
songzhengchao 69ac5a27a9 Implement Prologue refactor and Add mulitple Optimized Frame In LLVM 12.0.1
1 refactor prologue reserve dynamic slots which is setted by LLVM IR
2 callsiteSp is calculated by current function's callee saved registers size
3 and Add mulitple Optimized Frame:
OPTIMIZED_JS_FUNCTION_FRAME:argv[n-1],..., argv[0], argc, ...., returnaddr, Fp, type. this frame need to visit args and stackmap.
OPTIMIZED_ASM_FRAME: jscall/jsentry construct frame which is implemented by assemble, this frame is only link to previou frame, it don't need to visit args and stackmap

4 stackmap support parse const pool and llvm patch add deopt interface LLVMBuildCall3

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5AJ9U
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ie6a0067169805cc6043ea94936dd578489b56c7b
2022-06-03 15:51:19 +08:00
lichenshuai a724508c73 Delete RSP macro and .S file
Rsp is used in future work, therefore .S file should be deleted.

Issue: #I5AGW3

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ib1fb140d40d259bc4519fbf547857e5f80e9ee0c
2022-06-02 10:32:46 +08:00
lichenshuai a6bc94829b Fix C Interpreter Bug When Enabling rsp
Add case when ECMASCRIPT_ENABLE_ASM_INTERPRETER_RSP_STACK is true and asm-interpreter is false.

Issue: #I59UEB

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ib0eb125dfdc7e0cdc34109fe810efd48861d443c
2022-05-30 10:16:13 +08:00
openharmony_ci aca7a57b0a !1376 Fix 262 of rsp on x64
Merge pull request !1376 from zhangyukun8/master
2022-05-23 11:24:51 +00:00
zhangyukun 9f15b59632 Fix 262 of rsp on x64
1. skip builtin frame and asm interpreter entry frame when upframe
2. skip push args when argc is 0
3. check thread exception, rather not ret value
4. deal with fp when entry Execute
5. deal with call class Constructor
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I58I4H?from=project-issue

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I874f1437d5d21a8cf50a8d9ca73d7a92007f1bab
2022-05-23 18:42:48 +08:00
g00416891 ff9ad604fe optimize ExecuteNative frame
Change-Id: I2431fb150c160d8dc51d20a8dcc7ace74e09aa5b
Signed-off-by: g00416891 <guobingbing3@huawei.com>
2022-05-23 15:22:18 +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
wengchangcheng 5585fc331a Descriptor: crash when death cycle
details: add default branch when frame type error
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I57Y8Q

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I857076e33f6b30d4fede33edf7e058cfba39b22f
2022-05-17 22:51:14 +08:00
zhangyukun 6e0a576021 Fix rsp frame callnative and generator
1. adaptor GetNumArgs
2. fix callnative irange
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I57PDZ?from=project-issue

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Ib9a07e2e05fae93eb169e69e79f0c91acca37600
2022-05-16 21:08:38 +08:00
sunzhe23 b2c4eeff24 Fix frame handler preInterpretedFrame bug
description:
preInterpretedFrame should skip non-interpreted frame first

issue: I57JNT

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-05-15 22:28:16 -07:00
sunzhe23 1984b8f251 Refactor asm interpreter call native
description:
use builtin frame refactor call native

issue: #I573S8

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-05-13 05:12:06 -07:00
zhangyukun ae2a7e5d9b exception handler supports rsp frame
1.add lastFp_ into GlueData to restore rsp in exception handler
2.add AsmInterpreterEntryFrame to exit Execute when use rsp
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5733D?from=project-issue
Signed-off-by: zhangyukun <zhangyukun8@huawei.com>

Change-Id: Ia3c9301f3854b7d9cfb46dabbae82186b86348a3
2022-05-12 20:44:21 +08:00
guobingbing d8699d3ab9 modify annotation of InterpretedFrame
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I1deb88080eb89e27252629d8501005d49fe76adf
2022-05-12 10:22:18 +08:00
guobingbing d91e970f3a fix frame handler cached function & pc bug
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: Icf4a8ae482fb0bfde28282050876ca33b72d2c6d
2022-05-10 20:33:27 +08:00
zhangyukun 48a3816571 Fix assembler rsp frame of x64 platform
1.Fix Andq error due to sign-extended of imm32
2.Enable asmInter option should be loaded before init stack
3.separate leave frame with interpreter frame
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I56IZ4?from=project-issue

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I7bb4b5de71aab7dc8c6b657c70f97d738ebe1c2e
2022-05-10 10:18:14 +08:00
sunzhe23 c874c75894 Refactor asm interpreted frame
description:
1 remove macro ECMASCRIPT_COMPILE_ASM_INTERPRETER
2 add asm native frame type

issue: I569XH

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-05-08 20:40:24 -07:00
zhangyukun 25daaf26ef constuct entry frame of execute with rsp
1. add fp to support discontinuous frame gc and resume rsp
2. assemble execute and impl entry frame with rsp
3. use assembler to refactor .s
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I52BQE?from=project-issue

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I6966672dc065d63144fe7fa145ab76571189d540
2022-05-07 14:13:50 +08:00
hjzhangcm 3d42158184 fix codex waring
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-05-05 17:03:02 +08:00
openharmony_ci 70a73aac4f !1188 refactor class FrameHandler
Merge pull request !1188 from guobingbing/optimize
2022-05-04 07:24:17 +00:00
guobingbing 129ebdbf25 refactor class FrameHandler
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I9f3ff0c04d34a31a34f21da637689eb61d4166f1
2022-05-04 10:36:44 +08:00
openharmony_ci 272cf6664d !1155 Refactor the GC related components - Part 4
Merge pull request !1155 from klooer/master
2022-04-30 09:45:48 +00:00
Yuqiang Xian c7e278f057 Tidy-up Heap class; re-organize the public methods by categories and add descriptions.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I551ZU

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-04-28 16:10:59 +08:00
sunzhe23 86a4019e1e BugFix for callNative's leave frame
description:
callNative build the wrong leave frame, witch will case gc crashed

issue: I55401

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-27 20:04:19 -07:00
openharmony_ci a22dcd4032 !1143 get prev interpreted frame of entry frame
Merge pull request !1143 from guobingbing/adapter-asm
2022-04-26 09:34:00 +00:00
guobingbing 3fcd42ecff get prev interpreted frame of entry frame
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I6ed03ae55878790d4576499515a5973a700cd1ff
2022-04-26 15:59:03 +08:00
sunzhe23 ad20a51cca Support calculate callsite sp for asm Interpreter
description:
Add SaveCurrentFrame for interpreter handler call stub and
get get callsite sp when gc run

issue: I54IMV

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-25 01:03:33 -07:00
sunzhe23 528db23a05 Refactor leave&entry frame
issue: #I541LG

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-23 23:35:51 -07:00