Keep MemoryChunk::LiveBytes in sync when marking deque overflows.

R=erik.corry@gmail.com
BUG=v8:1672

Review URL: http://codereview.chromium.org/8139025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9525 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
vegorov@chromium.org 2011-10-05 09:42:20 +00:00
parent 2c975d6ae2
commit 7e1c2d9d1e
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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;