diff --git a/common_components/heap/allocator/region_manager.cpp b/common_components/heap/allocator/region_manager.cpp index feee6f3bf1798f694320fb0196362cdc04b2dd12..f0cd52bb54de5b9cf5fb64c8e30e231d453a9762 100755 --- a/common_components/heap/allocator/region_manager.cpp +++ b/common_components/heap/allocator/region_manager.cpp @@ -622,7 +622,8 @@ static void FixRecentRegion(TraceCollector& collector, RegionDesc* region) // use fixline to skip new region after fix // visit object before fix line to avoid race condition with mutator bool isLargeOrFixRegion = region->IsLargeRegion() || region->IsFixedRegion(); - region->VisitAllObjectsBeforeFix([&collector, region, isLargeOrFixRegion](BaseObject* object) { + bool isPinnedRegion = region->IsPinnedRegion(); + region->VisitAllObjectsBeforeFix([&collector, region, isLargeOrFixRegion, isPinnedRegion](BaseObject* object) { if (region->IsNewObjectSinceForward(object)) { // handle dead objects in tl-regions for concurrent gc. if (collector.IsToVersion(object)) { @@ -638,6 +639,9 @@ static void FixRecentRegion(TraceCollector& collector, RegionDesc* region) // large/fix region is no need to fillfreeobject. return; } + if( isPinnedRegion) { + return; + } FillFreeObject(object, RegionSpace::GetAllocSize(*object)); DLOG(FIX, "skip dead obj %p<%p>(%zu)", object, object->GetTypeInfo(), object->GetSize()); } @@ -699,7 +703,8 @@ void RegionManager::FixFixedRegionList(TraceCollector& collector, RegionList& li static void FixRegion(TraceCollector& collector, RegionDesc* region) { bool isLargeRegion = region->IsLargeRegion(); - region->VisitAllObjects([&collector, isLargeRegion](BaseObject* object) { + bool isPinedRegion = region->IsPinnedRegion(); + region->VisitAllObjects([&collector, isLargeRegion, isPinedRegion](BaseObject* object) { if (collector.IsSurvivedObject(object)) { collector.FixObjectRefFields(object); } else { @@ -707,6 +712,9 @@ static void FixRegion(TraceCollector& collector, RegionDesc* region) // large region is no need to fillfreeobject. return; } + if (isPinedRegion) { + return; + } FillFreeObject(object, RegionSpace::GetAllocSize(*object)); DLOG(FIX, "fix: skip dead obj %p<%p>(%zu)", object, object->GetTypeInfo(), object->GetSize()); } @@ -760,14 +768,6 @@ void RegionManager::FixPinnedRegionList(TraceCollector& collector, RegionList& l size_t garbageSize = 0; RegionDesc* region = list.GetHeadRegion(); while (region != nullptr) { - if (region->GetLiveByteCount() == 0) { - RegionDesc* del = region; - region = region->GetNextRegion(); - list.DeleteRegion(del); - - garbageSize += CollectRegion(del); - continue; - } DLOG(REGION, "fix region %p@%#zx+%zu", region, region->GetRegionStart(), region->GetLiveByteCount()); FixRegion(collector, region); region = region->GetNextRegion(); diff --git a/common_components/heap/allocator/region_manager.h b/common_components/heap/allocator/region_manager.h index 422f941dc87d3a779bd5dff124c23d1837dfa3f3..41cfaf29b7a12fc1b3990ae576218ed7e003416e 100755 --- a/common_components/heap/allocator/region_manager.h +++ b/common_components/heap/allocator/region_manager.h @@ -152,7 +152,7 @@ public: uintptr_t AllocPinned(size_t size, bool allowGC = true) { uintptr_t addr = 0; - if (!allowGC || size > FIXED_PINNED_THRESHOLD) { + if (true) { DLOG(ALLOC, "alloc pinned obj 0x%zx(%zu)", addr, size); return AllocNextFitPinned(size); } diff --git a/common_components/heap/verification.cpp b/common_components/heap/verification.cpp index 440ec9715e8fee035e24ca6408754007755f9df0..6fbf6a0097431823532606cea48746db2083f0d6 100755 --- a/common_components/heap/verification.cpp +++ b/common_components/heap/verification.cpp @@ -364,15 +364,6 @@ public: } else { refObj = field.GetTargetObject(); } - // If it is forwarded, its toVersion must have been traversed during - // EnumRoot, so it must have been marked. There is no need for me to - // check it, nor to push it into the mark stack. - if (refObj->IsForwarded()) { - auto toObj = refObj->GetForwardingPointer(); - bool find = markSet.find(toObj) != markSet.end(); - CHECKF(find) << "not found to version obj in markSet"; - return; - } visitor.VerifyRef(obj, field);