15 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
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
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 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
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 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
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
yingguofeng@huawei.com 3379f227fd Bugfix:Launcher application crash caused by large object updating null pointer
Add judgment null pointer

https: //gitee.com/openharmony/ark_js_runtime/issues/I54MFV?from=project-issue
Change-Id: If05f7dc1372d3d56acd59811cef1e51fb507bf94
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-04-26 09:09:59 +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
yingguofeng@huawei.com 07f3ca8f17 Memory map allocator implementation
Two memory blocks can be allocated: default region size and huge object size

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

Change-Id: I734213cfe43fc04638d4fd97d4cf4c04f7485875
Signed-off-by: yingguofeng@huawei.com <yingguofeng@huawei.com>
2022-04-21 22:32:21 +08:00
lukai d23dfb2033 Add Memory Tag for Js Heap
Issue: https://gitee.com/openharmony/ark_js_runtime/issues/I4VRCY?from=project-issue
Signed-off-by: lukai <lukai25@huawei.com>

Change-Id: I3ccf5ecfc55282092c799e2b427515f037fabca4
2022-03-01 15:09:13 +08:00
dingwen 87e9f4ff3c Modify RegionFactory and Chunk
Description:Divide RegionFactory into HeapRegionAllocator and
NativeAreaAllocator,use ChunkVector replace some unreasonable CVector.
issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4TRB8

Signed-off-by: dingwen <dingwen6@huawei.com>
2022-02-21 15:22:01 +08:00