20 Commits

Author SHA1 Message Date
wengchangcheng cd90e396a7 Descriptor: ark hilog refactor
details:
1. use hilog in ohos device
2. use panda logger in host
issue:  https://gitee.com/openharmony/ark_js_runtime/issues/I5FR5J

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
Change-Id: I6f5de00751154bdb6aac3101515961a3a4432e80
2022-07-06 22:55:49 +08:00
dingwen fe5bf496b6 gc bugfix for MergeRSetForConcurrentSweeping
Description:Delele the invoke of MergeRSetForConcurrentSweeping() when localspace merge
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I5CR1D

Signed-off-by: dingwen <dingwen6@huawei.com>
Change-Id: I5779151d6029bb2eb7e6a4f2b864eafce910c42b
2022-06-17 12:14:18 +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
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
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
Yuqiang Xian aec17d740f Merge remote-tracking branch 'oh/master' 2022-05-30 12:09:58 +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
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
lukai cdcd46b347 fix concurrent sweep bugs
Both concurrentSweep thread and js thread will operate remember set, which leads to competition.

Use two remembersets, one for concurrentSweep, one for js thread

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

Signed-off-by: lukai <lukai25@huawei.com>
Change-Id: Ie86ead2e5f5dfaf47c9830a56d158711b0ba9147
2022-05-15 19:42:58 +08:00
Yuqiang Xian 42bbb16a55 Get rid of "Heap" class / instance dependency from "Space" base class.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I55HWI

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
2022-05-05 20:14:16 +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
Yuqiang Xian 91c54d3b74 Fix several typos in the code.
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I54NZF

Signed-off-by: Yuqiang Xian <xianyuqiang@huawei.com>
Change-Id: I51002ec27cbbb46263a104e6e19c5e354dcbc189
2022-04-27 18:28:18 +08:00
yingguofeng@huawei.com aeb8531377 Bitmap Refactor
Refactor the markbitmap used to mark objects and the rememberset used to record cross generational references

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

Change-Id: Icc4ac21219b5b7514b77291e436f79cf286515b2
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-04-22 10:28:36 +08:00
xiongluo ae86ac820b Fix OOM and crash problem in triggering gc
1. Trigger GC before huge space and sparse expanding.
2. Avoid triggering concurrent mark twice.
3. Add unittest to check huge objects can be allocated frequently.

Signed-off-by: xiongluo <xiongluo@huawei.com>
2022-04-12 17:01:09 -10:00
wuzhefeng 034c425bea Refactor redundant codes
Remove redundant codes, like the variables that have the same
functionality. Besides, Some variables and functions' names are improper
and should be renamed in order to improve the readability.

issues: I50D00

Signed-off-by: wuzhefeng <wuzhefeng1@huawei.com>
Change-Id: Iecb75cd924167d53b4f12c572f18a8b9e3a9c0a7
2022-03-29 23:49:20 -07:00
xujie 479b7c3785 Clean Code For CodeHub Issues #96-#123 And #250-#264
According to the problems pointed out by the issuer and the
specifications compiled by Huawei, modify the non-compliant
parts of jsruntime.

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

Signed-off-by: xujie <xujie101@huawei.com>
Change-Id: Iceb771dfd9f3aa9017205068fc50ab1a63aae08b
2022-03-21 17:09:19 +08:00
yingguofeng@huawei.com de5ce040c0 Bugfix:Fix application bug that found by monkey testing
Description:The Type of Size field in FreeObject modified to JSTaggedValue. Nonmovable And HugeObject Space OOM bugfix

issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4VE6U
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
Change-Id: If4f046d26500e6d7635a3b6e7e7b1c5817027f08
2022-02-26 18:39:47 +08:00
yingguofeng@huawei.com 12e27e6863 Heap code refactoring
Delete MemManager class. The allocation function move to heap.cpp. The Space
manage Allocator.

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

Change-Id: I03cef52d9a1c86b07323de1e19ead53fe6daaf99
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-02-25 16:03:15 +08:00