Commit Graph

276 Commits

Author SHA1 Message Date
openharmony_ci 41865d03ba !1577 Optimize the finalizationRegistry interface code according to the review
Merge pull request !1577 from 小马奔腾/master
2022-06-14 09:31:04 +00:00
openharmony_ci 80173b7bfb !1549 Use weak reference instead of strong reference for SetNativePointer
Merge pull request !1549 from lukai/master
2022-06-14 08:46:36 +00:00
hjzhangcm bd009036d8 fix codex warning issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5C3XK
Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-06-14 10:38:06 +08:00
xdmal de8cddd1fe Optimize the finalizationRegistry interface code according to the review
Optimize the finalizationRegistry interface code according to the review

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

Signed-off-by: xdmal <maxiaodong16@huawei.com>
2022-06-13 16:08:00 +08:00
Yuqiang Xian b600b13b9e Fix typos in comments.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I590Z8

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-06-13 11:56:25 +08:00
Yuqiang Xian ec35dbada7 Merge remote-tracking branch 'oh/master' 2022-06-13 11:49:01 +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
getingke c958b9a873 Merge branch 'master' of https://gitee.com/openharmony/ark_js_runtime into aot_call_asmInterpreter
Signed-off-by: getingke <getingke@huawei.com>
Change-Id: I04892b95ea6e8188213f615769f0f199a511e9cb
2022-06-10 09:17:20 +08:00
openharmony_ci 671065ee6e !1522 Optmize smart gc params
Merge pull request !1522 from xiongluo/reduce_params
2022-06-09 12:52:56 +00:00
openharmony_ci a6f3b2b8a6 !1177 Require function realization
Merge pull request !1177 from DaiHN/require
2022-06-09 12:51:21 +00:00
xiongluo 7d12ac2836 optimize smart gc params
merge bool params and reduce param number

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

Signed-off-by: xiongluo <xiongluo@huawei.com>
2022-06-09 20:05:08 +08:00
openharmony_ci 56c822e058 !1544 Fix compiling issues on Mac included by continuous integration
Merge pull request !1544 from Pan Zhenyu/master
2022-06-09 09:48:45 +00:00
yingguofeng@huawei.com 4b0201248b Description:The feature of "tag" in ark heap has been invalidated by a previous PR.
Resolution:Revert modification

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5BIW5?from=project-issue
Change-Id: I827dbc48d6334c3c0ea45f1f939727bdff130e2c
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-06-09 15:34:35 +08:00
ZhenyuPan 7927740103 fix compilation bug on MacOS
related issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5BISH

Signed-off-by: ZhenyuPan <panzhenyu1@huawei.com>
Change-Id: I95002c034de569dad5a8dd5f6e66b0654e124826
2022-06-09 15:27:58 +08:00
getingke 62d97885f8 fixed for aot call asm interpreter
Change-Id: I052dfa2e8849b5a9645bac4389099266efd5047e
Signed-off-by: getingke <getingke@huawei.com>
2022-06-09 11:28:11 +08:00
Yuqiang Xian 9a35d504b2 Merge remote-tracking branch 'oh/master' 2022-06-08 11:21:28 +08:00
DaiH eee606c334 Support CommonJS's module export function
------------------------------------------
    1. Support CommonJS's module export function
    2. Related test cases
    issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5590V

Signed-off-by: DaiH <daihuina1@huawei.com>
Change-Id: I18968f6a6b971fbe833d91ef98813964cc8292c9
2022-06-08 10:59:06 +08:00
Yuqiang Xian 00934aa1d6 Rename RegionSpaceType to RegionSpaceFlag to better distinguish the name from that in Space class.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I590Z8

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-06-08 09:32:50 +08:00
Yuqiang Xian 9398651bdf Split region flag type declaration into separated Space type and GC flags.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I590Z8

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-06-07 17:10:37 +08:00
openharmony_ci 9d0b4b7e43 !1490 Invalid Object And mem map oom
Merge pull request !1490 from yingguofeng/master
2022-06-07 08:21:07 +00:00
openharmony_ci 11895598b5 !1435 Add smart gc interface
Merge pull request !1435 from xiongluo/smart_gc
2022-06-07 07:58:35 +00:00
xiongluo 0a218f7bb7 add smart gc interface and change gc params
add interface to change gc params
close concurrent sweep and mark in background
limit the post task num

issue:https://gitee.com/openharmony/ability_ability_runtime/issues/I59N1V

Signed-off-by: xiongluo <xiongluo@huawei.com>
2022-06-07 14:33:15 +08:00
openharmony_ci 225df7058a !1506 add statsUpdate and lastObjectId event
Merge pull request !1506 from Riachel/master
2022-06-07 04:26:00 +00:00
Riachel 557c07bb07 Descriptor: support heapprofiler domain
details:
1. add statsUpdate event
2. add lastObjectId event
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5AUJA

Signed-off-by: Riachel <caolili14@huawei.com>
2022-06-07 11:29:50 +08:00
Yuqiang Xian 34c428f16a Re-organize the region flags.
1) Separate the space type flags from the GC related flags;
2) the space type flags should be exclusive with each other, hence we shouldn't make them denoted
   by specific dedicated bits respectively, because in that way we can't avoid multiple bits being set,
   which is not what we expect.
3) the GC related flags are kept using dedicated flag bit for now. Going forward we should continuouslly
   improve this, e.g., to check if some of these flags are also exclusive with each other, and to better
   separate them from the space type flags with separately declared types, etc.
4) The judgement of whether an object is containted in the heap is _somehow_ improved, but as mentioned
   in the code comments, it's still not safe and accurate enough, be careful when using it.

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

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-06-06 17:23:27 +08:00
openharmony_ci d94412392b !1493 fix codex warning
Merge pull request !1493 from hjzhangcm/master
2022-06-06 04:15:17 +00:00
hjzhangcm 6741c67039 describe:fix codex warning
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5AM6L

Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
2022-06-06 11:27:19 +08:00
yingguofeng@huawei.com c0d7f5d528 Description:1、0x06 is judge to forward address.
2、Mem Pool capacity cause oom in multi worker

Resolution:1、Modify INVALID_OBJECT from 0x06 to 0x05
2、Auto adapter mem pool capacity according to physics memory

Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5AKVH?from=project-issue
Change-Id: If09a2cc792d27cd14a8e7ed88af192a78bab8356
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-06-06 10:14:54 +08:00
chenqi 666eb6b8bd Add Containers List And LinkedList
Description
    1.To ensure the high performance of container classes, List and LinkedList is provided in ark.
    2.modify Copyright 2021->2022.
    3.fix containers.
Related issue
    #I58XA9:Add Containers List And LinkedList.

Signed-off-by: chenqi <chenqi151@huawei.com>
2022-06-02 17:02:40 +08:00
Yuqiang Xian c492d6a7bc Merge remote-tracking branch 'oh/master' 2022-06-02 00:31:44 +08:00
Yuqiang Xian 5c889882e9 The region object and its interfaces should be safer and more robust to its users.
Currently there's an "implicit" assumption wide spread in a lot of places in the code,
that the region object is allocated in the JS heap together with the associated region
memory it manages (i.e., the C++ region object itself is treated as the header of the
associated memory region), but after all, from a normal user's perspective, it's still
a normal C++ object, and thus introduces a lot of confusions and it's very easy to
break the system with usages which are not "implicitly" expected.

This patch tries to relax the assumption / limitation, and the mostly affected usage case
is snapshot serialization / deserialization, which is refactored to not rely on that
implicit assumption.

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

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-06-02 00:04:59 +08:00
openharmony_ci 7e3af05fb1 !1442 Add WeakRef and FinalizationRegistry interfaces
Merge pull request !1442 from 小马奔腾/master
2022-06-01 15:07:08 +00:00
xdmal a4062881d1 Add WeakRef and FinalizationRegistry interfaces
Add WeakRef and FinalizationRegistry interfaces

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

Signed-off-by: xdmal <maxiaodong16@huawei.com>
2022-06-01 20:59:20 +08:00
Yuqiang Xian 03e1ff5f35 Redesign the region flag setting and fix potential bugs within it.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I590Z8

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-06-01 11:38:56 +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
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
Yuqiang Xian d60310edee Fix issues after merging latest changes for snapshot enhancement.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I590Z8

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-05-30 13:34:42 +08:00
Yuqiang Xian aec17d740f Merge remote-tracking branch 'oh/master' 2022-05-30 12:09:58 +08:00
openharmony_ci e14867e3d5 !1418 Snapshot support multiSpcae and multiFiles
Merge pull request !1418 from dingwen/master
2022-05-29 16:51:43 +00:00
openharmony_ci 80f810fc8f !1432 Add multi-abc-file support in stub compiler and aot compiler and related adaptation.
Merge pull request !1432 from luochuhao/unifycomandbc
2022-05-29 15:40:52 +00: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
yingguofeng@huawei.com a38b774573 Description: The change of hole tag cause that nullptr to be judged as a heap object
Solution: Ensure that all fileds of heap object(includes free object) are not nullptr

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

Change-Id: I062c3a7b9289de9efbb123ec62716fa554d2cb1d
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-05-28 19:18:54 +08:00
dingwen 2add907c4f Snapshot support multiSpcae and multiFiles
Description:allcate object to different space and support serialize
multi files
ISSUE:https://gitee.com/openharmony/ark_js_runtime/issues/I592G1

Signed-off-by: dingwen <dingwen6@huawei.com>
Change-Id: I5483566fd049d692cd19beece830957615d851c2
2022-05-28 09:43:38 +08:00
Yuqiang Xian 86472a91e0 Add a flag in Region object to describe whether the associated region space is reclaimed or not.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I590Z8

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-05-25 16:51:56 +08:00
Yuqiang Xian daf51dae0f Refactor Heap Region class.
1) Get rid of the dependency on "Space";
2) Fix a bug in RegionFlags definition, and tidy it up.
3) Fix the flag check logic to make it support multi-bit test;
4) Clean-up some logic to determine if a region or an object is valid / alive;

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

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-05-24 16:28:00 +08:00
Yuqiang Xian 2cd44957ab Follow-up: Clean-up remaining issues for mem management code.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I590Z8

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-05-24 16:27:17 +08:00
openharmony_ci 0b5e0e6aa6 !1395 Add Container Vector
Merge pull request !1395 from shisan_forwork/push_vector
2022-05-23 14:57:23 +00:00
shisan_forwork 5adb25b225 Add Container Vector
Description
   To ensure the high performance of container classes, vector is
   provided in ark.
Related issue
   #I4XCD9:add container vector

Signed-off-by: shisan_forwork <chengjunxiong@huawei.com>
2022-05-23 20:40:25 +08:00
linxiang 56d94b906b 1. huge space region reclaim need after weakReference update.
2. thread_local variable should move to ecma_vm instance.

Signed-off-by: linxiang <linxiang8@huawei.com>
Change-Id: Ic22a392c3f385d123880e449533532feb3b135ec
2022-05-23 14:39:33 +08:00
lukai 2d18a42fcf Fix enumerateRegion problems in multi-thread
if in async-clear thread get currentRegion == nullptr, and at the same time js-thread add newRegion to this space, then segmentfault happens.So we judge if currentRegion is nullptr in advance

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

Signed-off-by: lukai <lukai25@huawei.com>
Change-Id: I8a2691158b08d87b0e5d12aeed06567f270de1bf
2022-05-19 20:21:00 +08:00