Revision: 9525
Author:   [email protected]
Date:     Wed Oct  5 02:42:20 2011
Log:      Keep MemoryChunk::LiveBytes in sync when marking deque overflows.

[email protected]
BUG=v8:1672

Review URL: http://codereview.chromium.org/8139025
http://code.google.com/p/v8/source/detail?r=9525

Modified:
 /branches/bleeding_edge/src/mark-compact.cc
 /branches/bleeding_edge/src/mark-compact.h

=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Fri Sep 30 04:09:31 2011
+++ /branches/bleeding_edge/src/mark-compact.cc Wed Oct  5 02:42:20 2011
@@ -1703,6 +1703,7 @@
     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 @@
       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;
=======================================
--- /branches/bleeding_edge/src/mark-compact.h  Thu Sep 22 09:01:35 2011
+++ /branches/bleeding_edge/src/mark-compact.h  Wed Oct  5 02:42:20 2011
@@ -216,6 +216,7 @@
     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