Chromium Code Reviews| Index: src/mark-compact.cc |
| diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
| index 296b3c0b0f07530b08195f70479dd3e006ffe40e..b69a74f046e0d3e4572c65b996b311b2a123bd75 100644 |
| --- a/src/mark-compact.cc |
| +++ b/src/mark-compact.cc |
| @@ -109,11 +109,6 @@ static void VerifyMarking(Address bottom, Address top) { |
| } |
| -static void VerifyMarking(Page* p) { |
| - VerifyMarking(p->ObjectAreaStart(), p->ObjectAreaEnd()); |
| -} |
| - |
| - |
| static void VerifyMarking(NewSpace* space) { |
| Address end = space->top(); |
| NewSpacePageIterator it(space->bottom(), end); |
| @@ -134,7 +129,8 @@ static void VerifyMarking(PagedSpace* space) { |
| PageIterator it(space); |
| while (it.has_next()) { |
| - VerifyMarking(it.next()); |
| + Page* p = it.next(); |
| + VerifyMarking(p->ObjectAreaStart(), p->ObjectAreaEnd()); |
| } |
| } |
| @@ -158,14 +154,10 @@ class VerifyEvacuationVisitor: public ObjectVisitor { |
| for (Object** current = start; current < end; current++) { |
| if ((*current)->IsHeapObject()) { |
| HeapObject* object = HeapObject::cast(*current); |
| - if (MarkCompactCollector::IsOnEvacuationCandidate(object)) { |
| - CHECK(false); |
| - } |
| + CHECK(!MarkCompactCollector::IsOnEvacuationCandidate(object)); |
| } |
| } |
| } |
| - |
| - HeapObject* source_; |
| }; |
| @@ -180,7 +172,6 @@ static void VerifyEvacuation(Address bottom, Address top) { |
| object = HeapObject::FromAddress(current); |
| if (MarkCompactCollector::IsMarked(object)) { |
| ASSERT(current >= next_object_must_be_here_or_later); |
| - visitor.source_ = object; |
| object->Iterate(&visitor); |
| next_object_must_be_here_or_later = current + object->Size(); |
| } |
| @@ -188,15 +179,13 @@ static void VerifyEvacuation(Address bottom, Address top) { |
| } |
| -static void VerifyEvacuation(Page* p) { |
| - if (p->IsEvacuationCandidate()) return; |
| - |
| - VerifyEvacuation(p->ObjectAreaStart(), p->ObjectAreaEnd()); |
| -} |
| - |
| - |
| static void VerifyEvacuation(NewSpace* space) { |
| - // TODO(gc) Verify evacution for new space. |
| + NewSpacePageIterator it(space->bottom(), space->top()); |
| + |
| + while (it.has_next()) { |
| + NewSpacePage* page = it.next(); |
| + VerifyEvacuation(page->body(), page->body_limit()); |
|
Vyacheslav Egorov (Chromium)
2011/09/19 10:39:17
I doubt that this actually works. We have copied m
Michael Starzinger
2011/09/19 13:02:59
Done.
|
| + } |
| } |
| @@ -204,7 +193,9 @@ static void VerifyEvacuation(PagedSpace* space) { |
| PageIterator it(space); |
| while (it.has_next()) { |
| - VerifyEvacuation(it.next()); |
| + Page* p = it.next(); |
| + if (p->IsEvacuationCandidate()) continue; |
| + VerifyEvacuation(p->ObjectAreaStart(), p->ObjectAreaEnd()); |
| } |
| } |