Commit Graph

72 Commits

Author SHA1 Message Date
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
openharmony_ci 60f4974a42 !1269 Refactor asm interpreter call native
Merge pull request !1269 from 孙哲/master
2022-05-14 01:35:19 +00: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
openharmony_ci b2a7efbe58 !1282 The gn framework adapts to independent compilation
Merge pull request !1282 from 宋宏昊/master
2022-05-13 07:08:29 +00:00
songhao fdf3334e01 Adapt to independent compilation
Signed-off-by: songhao <songhonghao@huawei.com>
2022-05-13 09:58:33 +08: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
lichenshuai 7b9a1aa1f7 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 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
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 09715f883b !1119 Support calculate callsite sp for interpreter frame
Merge pull request !1119 from 孙哲/master
2022-04-25 12:06:25 +00: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
openharmony_ci 21553b47b7 !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 0e00e78a2d 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 528db23a05 Refactor leave&entry frame
issue: #I541LG

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-23 23:35:51 -07:00
guobingbing 1289f03e9d 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 e73e75786f 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 c01691c0bb entry frame adapter asm
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: Ied740af77e0f770e01f948c86b5f13d4877672ad
2022-04-15 18:23:40 +08:00
songzhengchao fb35927a32 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 589234007e FFI optimization for call params
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I61b820e91b85364e4f41d35ca0172ad059a1b916
2022-04-07 21:13:46 +08:00
lichenshuai fcda5bb413 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 3fa77c7aff 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 9c1f03b7be !748 Add Call Stub
Merge pull request !748 from 李晨帅/master
2022-03-16 04:57:48 +00:00
lichenshuai 915366d765 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 976cf3b3f7 !751 fix FastMul performance issues
Merge pull request !751 from 孙哲/master
2022-03-14 12:45:46 +00:00
sunzhe23 a44d68473a Fix FastMul performance issues
Description:
FastMul convert Int into Double, and lead to the result
call the double constructor of JSTaggedValue

Solution:
add Int Case for FastMul

Issue: #I4XK3U

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-13 22:00:52 -07:00
songzhengchao 44816cc3bc writebarrier marking fast path and Frame Refactor
1 writebarrier marking fast path
2 The design of Frame is unfriendly for low-level operations like ASM-interpreter and Compiler IR.

1 writebarrier marking flag is get by jsthread.threadStateBitField_
2 Refactor the Frame design by introducing Aligned struct

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I8fae1af0ce3c898909f088f8963f08c2f48dba8e
2022-03-12 18:11:38 +08:00
wupengyong 756a285093 reason:enable interpreterAsm Gc
Description:save leaveframe on thread leaveframe and save pc before callruntime

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

Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: I770f18facaeb7e62f5dc02f280828a8f6a420b6f
2022-03-11 12:46:57 +08:00
songzhengchao cea3ac020f Refactor Frame layout
This PR refactors the design of Frame by introducing aligned struct,
which is more friendly for ASM-Interpreter and Compiler IRs. Meanwhile,
to facilitate debugging

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I18d85bacc3a71baddea668e22d433103d2842bc5
2022-03-10 20:36:10 +08:00
wuzhefeng 566eaabd96 Refactor JSThread layout and introduce macro for debugging
This PR refactors the design of JSThread by introducing aligned struct,
which is more friendly for ASM-Interpreter and Compiler IRs. Meanwhile,
to facilitate debugging, a macro enable_bytrace is introduced to control
the lib dependencies of ark-js-runtime.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I56835deec5d372d7c827ded26544a87766f29002
2022-03-10 00:25:35 -08:00
getingke 4890007d7d fixed for review comment by wuzhefeng
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: Id76ea68552d31eb67fa87edaed2ec33ef18af3fe
2022-03-09 16:17:24 +08:00
songzhengchao 9b6965c724 delete patchpointid replace with return address
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I1a92f226571273e9ecdd713a378ad977a2f4667f
2022-03-08 17:28:21 +08:00
getingke 664e65e92e fixed for rename ecma_asm_defines.h to asm_defines.h
issue:[Add JSFunction EntryFrame & LeaveFrame for arm32](https://gitee.com/openharmony/ark_js_runtime/issues/I4WRJP?from=project-issue)

Signed-off-by: getingke <getingke@huawei.com>
Change-Id: Ieab12fd91b479147a1f4243b261acad028f23f86
2022-03-08 11:22:25 +08:00
getingke ce112c3182 fixed for arm32 js frame
issue:[Add JSFunction EntryFrame & LeaveFrame for arm32](https://gitee.com/openharmony/ark_js_runtime/issues/I4WRJP?from=project-issue)
Signed-off-by: getingke <getingke@huawei.com>

Change-Id: If65fd5064fa3c626f8f0ae3bae550465414af5e7
2022-03-08 11:01:20 +08:00
ding c2ad32ebcc Stackless optimalize new operation, including BuiltinsConstructor new and the most common new with callType is HAVE_THIS
Signed-off-by: ding <dingding5@huawei.com>
2022-03-01 20:10:20 +08:00
songzhengchao 2f99abd413 CallRuntimeTrampoline brige support aarch64
Description:
a Use two Bridge function, "InvokeJSFunctionEntry" and "CallRuntimeTrampoline" to Adapter the calling convention of Aot JSFunction & Runtime Stub, then Construct the Entry Frame in "InvokeJSFunctionEntry", Leave Frame in "CallRuntimeTrampoline"
b modify LLVM Calling Conversion, prologue push callee-saved gpr registers --> callee-saved fp/simd/SVE regs --> prev_fp, prev_lr .finally update x29 pointer to prev_fp

issue:https://gitee.com/openharmony/ark_js_runtime/pulls/630

Change-Id: I1df498f411e03c9887c4cad97bf82371c0b5f01a
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2022-03-01 11:07:25 +08:00
zhangyukun ad7195057a Sync code from c_asm_interpreter to master
Use Stub to impl handlers of bytecodes and use tail call to impl
dispatch of handlers of bytecodes

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I7afabdc40ddfa11345aa1029059514aa4f55b9f8
2022-02-22 17:01:18 +08:00
getingke a8d17968e1 fixed for compile error
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: Ia0a640d5dceb07faf18e8b383fde76fd272948f3
2022-02-21 17:13:33 +08:00
getingke 6b0d824f67 fixed for compile error
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I238ddacee3b8c64a877676c601b5ae8594fc1328
2022-02-21 16:21:09 +08:00
songzhengchao 4cb6be66ed fixed for arm64 test mod.abc slowpath ok
add set thread current sp when leave aot frame

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I18813879c9512a91f7f38ae07b211190d2e6daed
2022-02-18 17:58:06 +08:00
wanyanglan 01a613ecac independent running ts aot
ts aot should be a separate part that needs to generate the
corresponding file before executing xxx.abc and should not
depend on the execution of xxx.abc

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

Signed-off-by: wanyanglan <wanyanglan1@huawei.com>
Change-Id: I4ed7d7ee5528dcb479e08486f332a48c16ea88d7
2022-01-26 15:22:50 +08:00
songzhengchao a34e803eba review modify
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: If645dd22a900cebb06c355d921389e90a2e516dc
2022-01-24 20:31:38 +08:00
songzhengchao f7471106c0 code review
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: If2256b755c72dd5d6e3fd9f054ec98eab62ad204
2022-01-24 19:32:02 +08:00
songzhengchao 7c7ca08440 code review modify
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I1523067831240b65a442cf392327c5df4708a130
2022-01-24 15:36:24 +08:00
songzhengchao 23aba2a1bb frame refactor
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Ic35799a8e6c61e51f72b0fa19d63ea1720033481
2022-01-22 16:46:01 +08:00
songzhengchao a47e416b84 review code
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: Idea8ce99572460a1a6a8f923d9eb1ecbb272db24
2022-01-14 16:29:22 +08:00
wuzhefeng 5720a01a3a Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Ic990c5f11caeb3075033719a13e759baaf6dfefb
2022-01-13 00:26:00 -08:00
songzhengchao 532ec5c128 codedex clean
Change-Id: I439a70ae2fa6fcf6bb57bf37763cf4068abadd9a
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
2022-01-01 11:19:16 +08:00
songzhengchao 0a5ec1abb2 review code
Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I3fd21354d4c3080bee86351e2281183d8d42355a
2022-01-01 11:17:15 +08:00