Commit 7e1c2d9d authored by vegorov@chromium.org's avatar vegorov@chromium.org

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
parent 2c975d6a
...@@ -1703,6 +1703,7 @@ static void DiscoverGreyObjectsWithIterator(Heap* heap, ...@@ -1703,6 +1703,7 @@ static void DiscoverGreyObjectsWithIterator(Heap* heap,
MarkBit markbit = Marking::MarkBitFrom(object); MarkBit markbit = Marking::MarkBitFrom(object);
if ((object->map() != filler_map) && Marking::IsGrey(markbit)) { if ((object->map() != filler_map) && Marking::IsGrey(markbit)) {
Marking::GreyToBlack(markbit); Marking::GreyToBlack(markbit);
MemoryChunk::IncrementLiveBytes(object->address(), object->Size());
marking_deque->PushBlack(object); marking_deque->PushBlack(object);
if (marking_deque->IsFull()) return; if (marking_deque->IsFull()) return;
} }
...@@ -1753,7 +1754,9 @@ static void DiscoverGreyObjectsOnPage(MarkingDeque* marking_deque, Page* p) { ...@@ -1753,7 +1754,9 @@ static void DiscoverGreyObjectsOnPage(MarkingDeque* marking_deque, Page* p) {
ASSERT(Marking::IsGrey(markbit)); ASSERT(Marking::IsGrey(markbit));
Marking::GreyToBlack(markbit); Marking::GreyToBlack(markbit);
Address addr = cell_base + offset * kPointerSize; 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; if (marking_deque->IsFull()) return;
offset += 2; offset += 2;
grey_objects >>= 2; grey_objects >>= 2;
......
...@@ -216,6 +216,7 @@ class MarkingDeque { ...@@ -216,6 +216,7 @@ class MarkingDeque {
ASSERT(object->IsHeapObject()); ASSERT(object->IsHeapObject());
if (IsFull()) { if (IsFull()) {
Marking::BlackToGrey(object); Marking::BlackToGrey(object);
MemoryChunk::IncrementLiveBytes(object->address(), -object->Size());
SetOverflowed(); SetOverflowed();
} else { } else {
array_[top_] = object; array_[top_] = object;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment