Commit Graph

96 Commits

Author SHA1 Message Date
songzhengchao
2d4ed1ac84 Merge remote-tracking branch 'szc/FrameHandler2'
Change-Id: Icd0e4b9895cf1ecba52d1a6e39566fe0c93a3ae9
2022-06-16 16:52:49 +08:00
songzhengchao
083984ed9d 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
a8847d7c19 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
770c193286 Merge branch 'master' of gitee.com:openharmony/ark_js_runtime
Change-Id: I92c67c8e0c106177b9ae2ec3ea2aa31247c35023
2022-06-14 11:04:48 +08:00
songzhengchao
d8434ca48f 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
3710eb0946 Merge branch 'master' of gitee.com:openharmony/ark_js_runtime
Change-Id: Icab22a5939f3a284f016e147614eb83784a0ec48
2022-06-13 19:12:43 +08:00
openharmony_ci
43671492aa
!1531 Modify enable logic of certain runtime options.
Merge pull request !1531 from luochuhao/optioncombine
2022-06-13 06:00:29 +00:00
luochuhao
172f5642c7 Modify enable logic of certain runtime options.
Change condtion for File execution branch to whether file is AOT compiled or not.

Fix bug of setting bc debug handler entry while loading stub file.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5BBFH
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I5b6d47a1587631849f6c1e746473cb14b1d727a8
2022-06-13 12:15:03 +08:00
zhangyukun
fce035101e 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
d45b3095fc 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
sunzhe23
0959b86c63 Support stackless callnew for asm interpreter
description:
1 use JSCallDispatch implments call new
2 refactor js common call

issue: I5AKJU

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-06-08 13:28:04 +08:00
songzhengchao
dbd0a2c394 Merge remote-tracking branch 'szc/optimizedjsfunction'
Change-Id: I3451ce3ba039c43f4cebedbc6d5636bbf70d234c
2022-06-07 14:22:34 +08:00
zhangyukun
fcbd1a76a2 Fix rsp frame on arm64
1. get 32bits of argc
2. add ldur&stur to support signed offset
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5ASTO?from=project-issue

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Id4a6bad2977611939ef5fbece5ae5a862cab6e34
2022-06-06 21:10:30 +08:00
songzhengchao
f74d22da93 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
3d0305c4a7 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
077f38f689 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
sunzhe23
bf194f4c07 Refactor JSCall Dispatcher and implments asm getter/setter
description:
1 Refactor Call Dispatcher, and Regactor common call
2 use circuit IR implments getter/setter

issue: I59POB

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-05-30 16:14:30 +08:00
openharmony_ci
6890f93794
!1420 fix codex warning
Merge pull request !1420 from hjzhangcm/master
2022-05-25 03:45:13 +00:00
hjzhangcm
36781b6343 fix codex warning
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
Change-Id: I35a91de086b443e976116a6dd5955da244a8d144
2022-05-25 09:09:14 +08:00
sunzhe23
c18a83dbcc Fix some asm interpreter bug
description:
1 add align up for rodata section, incase movdqa crash
2 set gc leaf function attribute for no gc all
3 fix mega ic run slowpath bug for asm interpreter
4 remove trampoline unused code

issue: #I58VFA

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-05-24 19:36:38 +08:00
g00416891
2ad3adbc2a optimize ExecuteNative frame
Change-Id: I2431fb150c160d8dc51d20a8dcc7ace74e09aa5b
Signed-off-by: g00416891 <guobingbing3@huawei.com>
2022-05-23 15:22:18 +08:00
openharmony_ci
ce151ee143
!1370 fix codex warning file
Merge pull request !1370 from hjzhangcm/master
2022-05-22 01:12:24 +00:00
hjzhangcm
5b5e1717d8 fix codex warning
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-05-20 18:57:39 +08:00
wuzhefeng
9a69a5cf17 Remove/improve some unused data structures
Remove/improve some unused data structures like FrameConstants, which
should be moved to some arch-related places.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: If6699f5916e5c289375f97995c8e2570b081cda8
2022-05-20 00:38:25 -07:00
sunzhe23
6182223898 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
openharmony_ci
e565046c8c
!1269 Refactor asm interpreter call native
Merge pull request !1269 from 孙哲/master
2022-05-14 01:35:19 +00:00
sunzhe23
cd6eee5deb 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
openharmony_ci
7f8c5b20e0
!1282 The gn framework adapts to independent compilation
Merge pull request !1282 from 宋宏昊/master
2022-05-13 07:08:29 +00:00
songhao
9450ab2c4a Adapt to independent compilation
Signed-off-by: songhao <songhonghao@huawei.com>
2022-05-13 09:58:33 +08:00
zhangyukun
0090c76823 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
a066f70986 modify annotation of InterpretedFrame
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I1deb88080eb89e27252629d8501005d49fe76adf
2022-05-12 10:22:18 +08:00
lichenshuai
6a889927d9 Add new stackless stub
Add new stackless stub to syncronize asm interpreter with C interpreter.

Issue: #I54DXV

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ie6bef96e4ecd692d5a32a13eaa719859424c4b24
2022-05-11 09:09:09 +08:00
sunzhe23
91188e72df 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
4b39ba412b 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
guobingbing
9bef6eef18 refactor class FrameHandler
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I9f3ff0c04d34a31a34f21da637689eb61d4166f1
2022-05-04 10:36:44 +08:00
openharmony_ci
10df7b2d21
!1119 Support calculate callsite sp for interpreter frame
Merge pull request !1119 from 孙哲/master
2022-04-25 12:06:25 +00:00
sunzhe23
5b1c57291d 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
openharmony_ci
a311c83f4b
!1049 Bytecode_circuit_builder SUB2DYN_PREF_V8 bug fix
Merge pull request !1049 from songzhengchao/ts_sub
2022-04-24 10:02:10 +00:00
songzhengchao
1fec05e99b Bytecode_circuit_builder SUB2DYN_PREF_V8 bug fix
1 add ts_sub test
2 modify int to taggedvalue

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Idc51011528bd34c29faf0ffbb36cd225b2b91302
2022-04-24 15:14:09 +08:00
sunzhe23
c589aa831e Refactor leave&entry frame
issue: #I541LG

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-23 23:35:51 -07:00
guobingbing
2aa8816a83 check return use pc instead of FrameType
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I628701d6ad08b7a6dbbf762383f198b25c403930
2022-04-21 16:21:35 +08:00
songzhengchao
4036b0598e Merge remote-tracking branch 'szc/proxy0413'
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I2a370b8803299c88109cbeb0f799acbdda53c2e9
2022-04-16 10:59:11 +08:00
guobingbing
aeacc821fa entry frame adapter asm
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: Ied740af77e0f770e01f948c86b5f13d4877672ad
2022-04-15 18:23:40 +08:00
songzhengchao
2eb673cbff Implement Proxy Lowering on x86
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.

JSCall(glue, argc, calltarget, ....)
then proxy call(glue, argc, callTarget, argv[])
        if proxy->GetHandler is function
            tail call JSCall(glue, argc, callTarget, argv); // consider performance
        else
            //Call(trap, handler, «target, thisArgument, argArray»)
            call CreateArrayFromList(glue, argc, argv[]) ---> arrHandle  // maybe trigger GC, construct OptimizedWithArgvLeaveFrame, visitor argv[0]..argv[argc-1]
            call JSCall(glue, argc, method, argv[])
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I52T6B?from=project-issue

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I994aae1eb9cbf51982348ae6e203c24c326f617e
2022-04-15 16:39:42 +08:00
guobingbing
96190e252b FFI optimization for call params
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I61b820e91b85364e4f41d35ca0172ad059a1b916
2022-04-07 21:13:46 +08:00
lichenshuai
cfc0b0b12f Add AsmInterpreterFrame
Add AsmInterpreterFrame for ASM.

Issue: #I4YF9X

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: I4efc781a9fca90de4a0aed5b6a91a8122cfa16ab
2022-03-30 10:51:05 +08:00
wupengyong
3b4fca1521 reason:try catch fail
description:fix try catch fail in AsmInterpreter

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

Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: Iac9ae06b46091950c8d93c14201b05a7a9492421
2022-03-22 11:30:26 +08:00
openharmony_ci
f1af474f0e
!748 Add Call Stub
Merge pull request !748 from 李晨帅/master
2022-03-16 04:57:48 +00:00
lichenshuai
e6b8f48f69 Add Call Stub
Change several structures for call stub.

Related issue: #I4XK12

Signed-off-by: lichenshuai <lichenshuai@huawei.com>
Change-Id: Ie7389ff96c619451304a3f0d352b271310c4b73e
2022-03-15 17:36:58 +08:00
openharmony_ci
9333cafe69
!751 fix FastMul performance issues
Merge pull request !751 from 孙哲/master
2022-03-14 12:45:46 +00:00