Index: src/heap/mark-compact.cc |
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
index 0e8014014dbd612bf68bcfe0236f668312b1d81b..16dc3505f41ef484ec80c58225a891053534b55f 100644 |
--- a/src/heap/mark-compact.cc |
+++ b/src/heap/mark-compact.cc |
@@ -3502,14 +3502,21 @@ bool MarkCompactCollector::VisitLiveObjects(MemoryChunk* page, |
#endif // VERIFY_HEAP |
LiveObjectIterator<kBlackObjects> it(page); |
- HeapObject* object = NULL; |
- while ((object = it.Next()) != NULL) { |
+ HeapObject* object = nullptr; |
+ while ((object = it.Next()) != nullptr) { |
DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object))); |
if (!visitor->Visit(object)) { |
if (mode == kClearMarkbits) { |
page->markbits()->ClearRange( |
page->AddressToMarkbitIndex(page->area_start()), |
page->AddressToMarkbitIndex(object->address())); |
+ LiveObjectIterator<kBlackObjects> it2(page); |
ulan
2016/01/14 15:46:38
Let's move this code into a separate function name
Michael Lippautz
2016/01/14 16:01:46
RecomputeLiveBytes it is.
|
+ int new_live_size = 0; |
+ while ((object = it2.Next()) != nullptr) { |
+ new_live_size += object->Size(); |
+ } |
+ DCHECK_LT(new_live_size, page->LiveBytes()); |
+ page->IncrementLiveBytes(new_live_size - page->LiveBytes()); |
ulan
2016/01/14 15:46:38
I think adding new page->SetLiveBytes(new_live_siz
Michael Lippautz
2016/01/14 16:01:45
SetLiveBytes() it is.
|
} |
return false; |
} |