Fix shared obj size in deserialize

Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAH6UD

Signed-off-by: chentianyu <chentianyu31@huawei.com>
Change-Id: I9f8fee6cee453fbba76b450c19ea5a4b035512cc
This commit is contained in:
chentianyu 2024-08-01 16:10:57 +08:00
parent 7cf3dcb977
commit 24eccbc65d

View File

@ -614,6 +614,7 @@ Region *BaseDeserializer::AllocateMultiSharedRegion(SharedSparseSpace *space, si
} else {
region->SetHighWaterMark(region->GetEnd() - regionRemainSizeVector[regionRemainSizeIndex_++]);
}
region->IncreaseAliveObject(region->GetAllocatedBytes());
regionVector_.push_back(region);
allocateRegions.push_back(region);
regionNum--;
@ -681,6 +682,10 @@ void BaseDeserializer::AllocateToSharedOldSpace(size_t sOldSpaceSize)
Region *region = AllocateMultiSharedRegion(space, sOldSpaceSize, sOldRegionIndex_);
sOldSpaceBeginAddr_ = region->GetBegin();
} else {
if (thread_->IsSharedConcurrentMarkingOrFinished()) {
Region *region = Region::ObjectAddressToRange(object);
region->IncreaseAliveObject(sOldSpaceSize);
}
FreeObject::FillFreeObject(sheap_, object, sOldSpaceSize);
sOldSpaceBeginAddr_ = object;
}
@ -694,6 +699,10 @@ void BaseDeserializer::AllocateToSharedNonMovableSpace(size_t sNonMovableSpaceSi
Region *region = AllocateMultiSharedRegion(space, sNonMovableSpaceSize, sNonMovableRegionIndex_);
sNonMovableSpaceBeginAddr_ = region->GetBegin();
} else {
if (thread_->IsSharedConcurrentMarkingOrFinished()) {
Region *region = Region::ObjectAddressToRange(object);
region->IncreaseAliveObject(sNonMovableSpaceSize);
}
FreeObject::FillFreeObject(sheap_, object, sNonMovableSpaceSize);
sNonMovableSpaceBeginAddr_ = object;
}