Commit Graph

35 Commits

Author SHA1 Message Date
songzhengchao
6e422e5a77 Implement CallingConv to compatible with Fast-Stub/ASM-INT/AOT
1 Current ASM-INT(GHCC)/Fast-Stub(WebKit_jscc) set different FrameType to distinguish with CallingConv.It's more friendly to add callingConv flag in CallSignature class.
2 Fast-Stub/Aot CallingConv is WebKit_jscc while LLVM Backend don't support it on arm32. we'll add padding paramets to JS-Relative paramter is placed on stack.

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

Signed-off-by: songzhengchao <songzhengchao@huawei.com>
Change-Id: I93df6c1d605692941b1aa362ad4e07a202d76241
2022-03-29 11:51:39 +08:00
openharmony_ci
3d2ee6b22e
!897 fix compiler bug in arm32
Merge pull request !897 from wpy111/master
2022-03-28 13:58:03 +00:00
wupengyong
b9b80d1be5 reason:interpreterAsm compiler failure arm32
descripter:fix compiler bug

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

Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: Ia3a80d901cf99f11ed4f311a7a6df1742cfb1eaf
2022-03-28 15:41:14 +08:00
openharmony_ci
71a68a22c5
!898 fix getresumemode stub handle error
Merge pull request !898 from wanghuan2022/master
2022-03-26 09:23:55 +00:00
wanghuan
71db7bbec9 fix getresumemode stub handle error
description: fix getresumemode stub handle error

solution:
1.load offset error, should be GetIntptr;
2.get value from bitfield error because of lack of lsr;
3.set acc value error, should be build tagged.

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

Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I96a35d134d5441f040cbf42d4e8ab2be208f166f
2022-03-26 12:04:56 +08:00
wengchangcheng
e64122e200 add -Werror -Wextra gn flag for 'compiler'
1. ignore llvm warning
2. fix warning of compiler module

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

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I09774e431743a26ea366ed28e3276ff027ae0d31
2022-03-25 15:31:59 +08:00
wanghuan
4b00a5852a fix asm definefunc stub module error
description: fix asm definefunc stub module error

solution: Due to missing action to update module in definefunc stub, it makes a problem in StoreModuleValue. So add updating module to asm definefunc stub.

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

Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: Ifbe8daf4541210f77317898cfd40170fef7dd060
2022-03-24 14:30:33 +08:00
wanghuan
61361a7c3e [feature]add ldbigint and newlexenvwithname stub handle
description: add ldbigint and newlexenvwithname stub handle

reason: add ldbigint and newlexenvwithname stub handle

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

Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I301e7041939f189158058b371a34633bb6c133c2
2022-03-22 21:46:48 +08:00
openharmony_ci
5896b01d50
!790 fix try catch fail in Asminterpreter
Merge pull request !790 from wpy111/master
2022-03-22 07:08:07 +00: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
sunzhe23
edea2b49db Add Instruction asr to implement shr2dyn bytecode handler
Description:
1 Shr2Dyn should use llvm asr
2 Rewrite shr/shl/ashr/or/xor/and slow path stubs

Issues: I4YVHA

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-21 05:38:04 -07:00
zhangyukun
3fe8526362 Refactor bytecode dispatch of bytecode in asm interpreter
1. add HandleOverflow in unused positions of bcHandlers
2. add bytecode helper at the end of bcHandlers
3. Refactor Dispatch
Issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4YIQG?from=project-issue

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Id51d1f2cc3c86f8fa1a59f6e79024bef406f7a21
2022-03-21 16:16:51 +08:00
sunzhe23
e05044b20e Fix some binary option handlers bug for c-interpreter and asm-interpreter
Description:
1 Fix and/or/xor CastToUint32 bug
2 Fix asm interpreter shr overflow bug

Issues: I4YPC6

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-20 20:03:59 -07:00
luochuhao
905d0496dc Refactor ID definition and callSignature initialization mechanism of stubs
Refactor ID definition and callSignature initialization mechanism of runtime stub,
optimizer stub and bytecode handler stub,
reduce amount and complexity of macro used in calling those stubs.

Add stubDes struct to classify stubs both in AOT file generation phase
and AOT file loading phase.

Fix some circular dependency problems in including header files.

Fix certain inline function declaration and definition format problems, which could lead to
compiling errors.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4VMLD?from=project-issue
Test: stubTest(unit test), richards with asm interpreter enabled
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Ibd5fcd963347b97f8dec227f3245d2064463b0b0
2022-03-18 22:01:52 +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
sunzhe23
22a2321ee1 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
sunzhe23
8aa1664de5 refactor runtime trampoline id
Description:
add runtime_trace for runtime trampoline
mov runtime_trampolines.cpp info cmascript/trampoline/
rename FAST_STUB_ID as RUNTIME_CALL_ID

issue: #I4XBC9

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-11 02:17:24 -08:00
wupengyong
db0aa88cac 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
y00576111
6dc6688270 EcmaScript Standard Module Implementation
Delete the existing module implementation and
re implement the module function according to the ECMA 2018 specification

issue: #I4NZQT [https://gitee.com/openharmony/ark_ts2abc/issues/I4NZQT]

Signed-off-by: y00576111 <yaojian16@huawei.com>
Change-Id: I8d381db7f8bf2f3d6b2a5c21cbc3cbab1aef0b9b
2022-03-10 19:10:42 +08:00
wuzhefeng
ab93e17d09 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
openharmony_ci
2e2d105ef3
!683 Add stub name log of asm interpreter
Merge pull request !683 from zhangyukun8/master
2022-03-09 08:47:24 +00:00
zhangyukun
b981d1ab15 Add stub name log of asm interpreter
In debug mode, print stub name of asm interpreter stub to
help us find which stub exists the problem
Add new DebugPrint format to support print int32 value

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Iae39213572de99cc4089a172092184399ba8c5d0
2022-03-09 15:16:09 +08:00
sunzhe23
56d8ac665d Related issue: #I4WXHG
Modifications:
1 rewrite Add/Stub2Dyn
2 bytecode Inc/Dec use .rodata store a float 1.0 and crashed on amd64.
  close double label for Inc/Dec on amd64

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-08 05:16:27 -08:00
sunzhe23
c2a41bbddd Related issue: #I4WNBB
Modifications:
Add overflow handling for DoubleToInt

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-03-07 03:35:48 -08:00
wanghuan
c82b5e1003 add rest stub handle
Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I4588693b1dd362cb1e8ca6c18892c10cee77d73e
2022-03-04 10:17:52 +08:00
wupengyong
699c5a0f62 fix ptr cast to taggedvalue
Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: If7ee291d9b705277d815ddf19973622f7ff78ca0
2022-03-02 11:12:53 +08:00
Mingliang Zeng
f433c7efed Related issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4VSUH
Modifications:

* Rename StubMachineType to VariableType
* Remove the information about signed/unsigned
* VariableType is a class that bundled MachineType and GateType (not an enumerator anymore)

Signed-off-by: Mingliang Zeng <zengmingliang1@huawei.com>
2022-03-01 18:54:11 +08:00
openharmony_ci
877b24e726
!630 CallRuntimeTrampoline brige support aarch64
Merge pull request !630 from songzhengchao/js_function_entry_frame0224
2022-03-01 06:52:59 +00:00
songzhengchao
b2ef46bebe 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
hjzhangcm
6875a70511 Handle compile alarms
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-03-01 09:47:35 +08:00
wupengyong
05a33528c5 modify call runtime
Signed-off-by: wupengyong <wupengyong@huawei.com>
Change-Id: Iae4050f3e61ba9e76cfedcdff00748c7d78d6ecd
2022-02-26 09:43:43 +08:00
zhangyukun
7f3106ba5f Fix kinds of operands of HandleCmp dismatch
MachineType::ARCH is equal to MachineType::I32 on 32 bits platform and
MachineType::I64 on 64 bits platform

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I41dfc96c5dacc0b2108dc90730500f2bc51ecd24
2022-02-24 16:15:13 +08:00
zhangyukun
b44595f8cc Fix generating .m error in debug mode
1. Add machineType when return type is FLEX
2. Cmp ops should have the same op type

Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: I3c0e417b8f9cd7f792e3ff909bf1fab8afabb238
2022-02-24 11:15:32 +08:00
zhangyukun
3b881fa018 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