Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Unified Diff: src/heap/mark-compact.cc

Issue 1588823003: [heap] Properly adjust live bytes for pages where we abort evacaution (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698