Commit Graph

85 Commits

Author SHA1 Message Date
ZhenyuPan 186ca3976d Fix compiling issue when compile SDK on MacOS
related issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5DRV5

Signed-off-by: ZhenyuPan <panzhenyu1@huawei.com>
Change-Id: I16ec64a1549305976d048a7c86f3eba2b140d8e8
2022-06-23 17:24:30 +08:00
yingguofeng@huawei.com 86432994a8 It need to earse object from TaggedQueue when pop
Description:Memory leaked in window's Testing Application

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5DF7W?from=project-issue
Change-Id: I8d24df9152688512e8d479cf7a91bab205c409c8
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-06-22 09:36:41 +08:00
openharmony_ci 63ed734dd7 !1596 adjust pool size and related vm-memory according to physical memory
Merge pull request !1596 from lukai/master
2022-06-20 13:43:57 +00:00
lukai 7b695c2ae5 adjust pool size and related vm-memory according to physical memory
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5CCG0?from=project-issue

Signed-off-by: lukai <lukai25@huawei.com>
Change-Id: I46bf3a11ef509ece55b45edc92bb7cb68c100dfa
2022-06-18 14:38:43 +08:00
openharmony_ci 54da079ea6 !1560 Refactor Frame Iterator
Merge pull request !1560 from songzhengchao/FrameHandler
2022-06-14 13:55:33 +00:00
songzhengchao 867eb5f85b Merge branch 'master' of gitee.com:openharmony/ark_js_runtime
Change-Id: Icab22a5939f3a284f016e147614eb83784a0ec48
2022-06-13 19:12:43 +08:00
lukai d098277ade Use weak reference instead of strong reference for ArkNativeObject::SetNativePointer
Use weak reference instead of strong reference for SetNativePointer.
And in period of gc updating reference, if the related js object is free, "Finalize" callback will be called to release c++ memory.

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

Signed-off-by: lukai <lukai25@huawei.com>
Change-Id: Ibb04cf2efa0c7e1fe719eda5e95cb62938e661e0
2022-06-12 20:58:51 +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
sunzhe23 10ebc065d8 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
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
yingguofeng@huawei.com 73689999ed Add jsnapi interface CopyableGlobal
issue:https://gitee.com/openharmony/arkui_ace_engine/pulls/2628

Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
Change-Id: I28bcfa69f47d9b239d1cd37f8bbd34c82a0c8da9
2022-05-31 22:14:22 +08:00
openharmony_ci 36f7ae1897 !1447 support memory params configuration
Merge pull request !1447 from lukai/master
2022-05-31 03:30:30 +00:00
lukai 1a5e085031 support memory parameters configuration
1. heap configuration including heapSize and space capaticity
2. other parameters such as gcThreadNum, longPauseTime.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I59HYO?from=project-issue

Signed-off-by: lukai <lukai25@huawei.com>
Change-Id: If3bfe7338ae0712809d9750fef3bbbb14017223f
2022-05-30 17:22:08 +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
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
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
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
openharmony_ci bebf03b2a5 !1271 exception handler supports rsp frame
Merge pull request !1271 from zhangyukun8/master
2022-05-13 03:01:45 +00: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
luochuhao 1a370607c9 Delete duplicated co stub generation and related conditional code.
Adapt call.S to current EcmaRuntimeCallInfo change.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I56JF1
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: I117c6b088a82b15c2afcb18b4a74f47bfd705545
2022-05-12 17:24:57 +08:00
wuzhefeng 662f2b78a6 Refactor Compilation Framework Part-2
1. Rename IR builder to improve the readability.
2. Remove redundant Headers to decouple the relationships of components.

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

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: I0c8da6cd55bb8e7f33421ba846bab89bd5e06c55
2022-05-11 04:28:10 -07: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
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
openharmony_ci ff44193d07 !1171 Modify option source of stub compiler
Merge pull request !1171 from luochuhao/modifyoption
2022-04-30 00:57:37 +00:00
luochuhao 86fda0792b Modify option source of stub compiler.
Using options in js runtime option list and delete stub compiler option.

Add path check for stub compiler generation phase.

Load stub file before loading of aot file.

Add runtime option for optimization level configuration.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I557Q2
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: Ifbaa7a2dc4333310c62f1f8e230eefb7a2136ca5
2022-04-29 14:40:18 +08:00
wanghuan 18792a746a move interpreter helper stubs from common stub to bc stub
desc: move interpreter helper stubs from common stub to bc stub, beacuse these stubs' signatures are the same and need not construct frame pointer like bc stub.

solu:
1. delete old helper stub define in common stub, and add new helper stub define in bc stub.
2. add new targetKind in CallSignature to distinguish helper and normal stub in loading stub.
3. delete argc in stub define.

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I556K1
Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I46224e4568b45794aa1bac97682afc41696d5faa
2022-04-28 21:14:18 +08:00
Yuqiang Xian 5925e8ff44 Fix some terminologies used in concurrent marker and sweeper.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I54NZF

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
Change-Id: I2d398290ff7c0febffa7eb15bac78a4c3d9bc6a1
2022-04-27 18:28:18 +08:00
wanghuan 4d249dcb87 add asmInter Debugger
desc: add asmInter debugger to support ide debug.

solu:
1.add bc debugger stub entry;
2.check is or not debug mode in runInternal and switch release to debug or debug to release.

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I53Z4V
Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I3f61bed8b4e17c43d22b5e6f103fe897cd8b41c1
2022-04-25 21:38:27 +08:00
lifansheng a725676a6c Runtime architecture adjustment
Description
  Cut out most of the initialization logic in Runtime::Create and disconnect the
  inheritance relationship of most classes such as JSThread.
Issue:
  #I53418: Runtime architecture adjustment

Signed-off-by: lifansheng <lifansheng1@huawei.com>
Change-Id: Ib9c1a40354f77d32e515e23334e7f4b4a4fa3259
2022-04-21 14:37:31 +08:00
guobingbing 1f447ab652 add DoStackOverflowCheck for app crash after reboot many times
Signed-off-by: guobingbing <guobingbing3@huawei.com>
Change-Id: I6b144c0b86b5c2b48bae8cf513d67e5e537eaf7b
2022-04-19 17:44:54 +08:00
ding d8f0399789 Control whether to print compiler logs through JSRuntime Options
Add option log-compiled-methods to print the compiler(both stub and aot) in units of methods.

Add class CompilerLog.

Refactor some compiler logs.

Unie the log invoked way(COMPILER_LOG or COMPILER_OPTIONAL_LOG).

Signed-off-by: ding <dingding5@huawei.com>
Change-Id: I43ce61d0ba9d453713ab3e6349d07f6d9cde3e5e
2022-04-14 16:14:34 +08:00
openharmony_ci b072df04f1 !988 fix codeDex warning.
Merge pull request !988 from zhaozhibo/master
2022-04-14 07:39:17 +00:00
openharmony_ci 91c467cb6b !984 Add X64 assembler
Merge pull request !984 from 孙哲/master
2022-04-14 05:54:27 +00:00
sunzhe23 44d2430c3c Add x64 assembler
1 Implements x64 assembler
2 Add Asm code generator framework
3 Generating AsmInterCallRuntime with the x64 assembler

issue: #I52Ak6

Signed-off-by: sunzhe23 <sunzhe23@huawei.com>
2022-04-13 22:01:24 -07:00
zhaozhibo a57029dc79 fix codeDex warning.
Signed-off-by: zhaozhibo <zhaozhibo3@huawei.com>
2022-04-14 10:56:51 +08:00
Hailiang Hu c071531719 Add AOT Slowpath Lowering
Lowering for NEWLEXENVDYN, NEWLEXENVWITHNAMEDYN, POPLEXENVDYN.

Issue: I51VGS

Signed-off-by: Hailiang Hu <allenpas@huawei.com>
Change-Id: I001c7bd23c03d2dbc0a1647a652c289204a8dc92
2022-04-09 19:35:17 +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
openharmony_ci b078ee5425 !948 [part-1] delete inl.h, move the definition to the declare head file
Merge pull request !948 from changcheng/fix_inl_head_files_part1
2022-04-07 11:30:16 +00:00
zhangyukun 9139ca09c7 Add dispatch of call of x64 and construct frame with rsp in .S
1. use stub to dispatch fast,slow and native paths
2. use rsp to construct frame of x64
https://gitee.com/openharmony/ark_js_runtime/issues/I51G9L?from=project-issue
Signed-off-by: zhangyukun <zhangyukun8@huawei.com>
Change-Id: Ib80540df5dbe531f155e5dd9fce556a207171494

Change-Id: I31e6705dd5555a0c2a9070a7ce73b26f77caef80
2022-04-07 14:32:38 +08:00
wengchangcheng 4e08cec6ee [part-1] delete "*-inl.h" of newest codex rule
move the definition to the declare head file

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

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: Ieeb0ec96281cda51d0bebd6a2e771fc8d4078306
2022-04-07 14:14:49 +08:00
wanghuan 5ec124e5bb refactor load stub in jsthread
description: refactor load stub in jsthread

solution:
1.change bcstub、costub、rtstub's name;
2.refactor load stub code, encapsulate adjust bcstub function according define or option

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

Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I8ff0192ff2c20f1625b4dea124532e8b9a0aa3e0
2022-03-28 18:02:36 +08:00
luochuhao 8c6f8ef20d Implement aot file generated step for aot compiler
Implement llvmIRGeneration Pass in aot compiler pipeline.

Rename and reconstruct LLVMStubModule and LLVMModuleAssembler class. Move aot code infos
related to describe current (code size, begin addr, entry offset of each func etc.)  AOT
snippet and corresponding serialization/deserialization func to NEW class called AotCodeInfo.
Move functions related to file reading/writing to NEW class called AotFileManager.

Add new call opcode in circuit IR to differentiate call into common stubs and call into
runtime interfaces without GC.

Adapt js runtime option for above changes.

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4ZDY5
Signed-off-by: luochuhao <luochuhao@huawei.com>
Change-Id: If0ab5927ad2551fe5567d1c7b18540fbcc38bc15
2022-03-24 15:44:26 +08:00
wanghuan fa743ada82 [bug]fix compile error in js_thread.cpp
description: fix compile error in js_thread.cpp

reason: The reason is comparison of integers of different signs 'size_t' and 'int'. So change 'size_t' to 'int'.

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

Signed-off-by: wanghuan <wanghuan80@huawei.com>
Change-Id: I350301b7004b7d0a83597c7ac71d986edd2a8f08
2022-03-21 19:38:45 +08:00
zhangyukun bb4208eef7 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
hjzhangcm 4fdd5c2e56 Handling Codex alarms
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-03-21 11:44:04 +08:00