Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: src/mark-compact.cc

Issue 7935013: Implement verification of new space evacuation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: New space is not marked after evacuation. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 296b3c0b0f07530b08195f70479dd3e006ffe40e..6505aff42c651e648bd7d8cb5ac3cc7318047213 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,21 @@ 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());
+ VerifyEvacuationVisitor visitor;
+
+ while (it.has_next()) {
+ NewSpacePage* page = it.next();
+ Address current = page->body();
+ Address limit = it.has_next() ? page->body_limit() : space->top();
+ ASSERT(limit == space->top() || !page->Contains(space->top()));
+ while (current < limit) {
+ HeapObject* object = HeapObject::FromAddress(current);
+ object->Iterate(&visitor);
+ current += object->Size();
+ }
+ }
}
@@ -204,7 +201,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());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698