Reviewers: Erik Corry,

Description:
Keep MemoryChunk::LiveBytes in sync when marking dequeue overflows.

[email protected]
BUG=v8:1672


Please review this at http://codereview.chromium.org/8139025/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/mark-compact.h
  M src/mark-compact.cc


Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index e90a23d8a497c7badda4638fb70741014599f4ee..450a58cb06cdd3bf59fe61fe62db7dedb0064151 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1703,6 +1703,7 @@ static void DiscoverGreyObjectsWithIterator(Heap* heap,
     MarkBit markbit = Marking::MarkBitFrom(object);
     if ((object->map() != filler_map) && Marking::IsGrey(markbit)) {
       Marking::GreyToBlack(markbit);
+      MemoryChunk::IncrementLiveBytes(object->address(), object->Size());
       marking_deque->PushBlack(object);
       if (marking_deque->IsFull()) return;
     }
@@ -1753,7 +1754,9 @@ static void DiscoverGreyObjectsOnPage(MarkingDeque* marking_deque, Page* p) {
       ASSERT(Marking::IsGrey(markbit));
       Marking::GreyToBlack(markbit);
       Address addr = cell_base + offset * kPointerSize;
-      marking_deque->PushBlack(HeapObject::FromAddress(addr));
+      HeapObject* object = HeapObject::FromAddress(addr);
+      MemoryChunk::IncrementLiveBytes(object->address(), object->Size());
+      marking_deque->PushBlack(object);
       if (marking_deque->IsFull()) return;
       offset += 2;
       grey_objects >>= 2;
Index: src/mark-compact.h
diff --git a/src/mark-compact.h b/src/mark-compact.h
index 469dd29f199c55a284aa108256458a314adb1bfa..86850369a906029c2075c000df787009f72013ae 100644
--- a/src/mark-compact.h
+++ b/src/mark-compact.h
@@ -216,6 +216,7 @@ class MarkingDeque {
     ASSERT(object->IsHeapObject());
     if (IsFull()) {
       Marking::BlackToGrey(object);
+      MemoryChunk::IncrementLiveBytes(object->address(), -object->Size());
       SetOverflowed();
     } else {
       array_[top_] = object;


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to