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

Unified Diff: src/mark-compact.cc

Issue 7149016: Multi-page growing and shrinking new-space (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Address review comments Created 9 years, 6 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 | « src/incremental-marking.cc ('k') | src/mark-compact-inl.h » ('j') | 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 b4e8166625bd0b369622fb90f017fd3ba85ab566..7dee9bf7a38df4c5d8ecb21bc7d6b7817a74e6bb 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -123,6 +123,7 @@ static void VerifyMarking(NewSpace* space) {
while (it.has_next()) {
NewSpacePage* page = it.next();
Address limit = it.has_next() ? page->body_limit() : end;
+ ASSERT(limit == end || !page->Contains(end));
VerifyMarking(page->body(), limit);
}
}
@@ -193,13 +194,22 @@ static void VerifyMarkbitsAreClean(PagedSpace* space) {
}
}
+static void VerifyMarkbitsAreClean(NewSpace* space) {
+ NewSpacePageIterator it(space->ToSpaceLow(), space->ToSpaceHigh());
+
+ while (it.has_next()) {
+ NewSpacePage* p = it.next();
+ ASSERT(p->markbits()->IsClean());
+ }
+}
+
static void VerifyMarkbitsAreClean() {
VerifyMarkbitsAreClean(HEAP->old_pointer_space());
VerifyMarkbitsAreClean(HEAP->old_data_space());
VerifyMarkbitsAreClean(HEAP->code_space());
VerifyMarkbitsAreClean(HEAP->cell_space());
VerifyMarkbitsAreClean(HEAP->map_space());
- ASSERT(HEAP->new_space()->ActivePage()->markbits()->IsClean());
+ VerifyMarkbitsAreClean(HEAP->new_space());
}
#endif
@@ -214,14 +224,25 @@ static void ClearMarkbits(PagedSpace* space) {
}
+static void ClearMarkbits(NewSpace* space) {
+ NewSpacePageIterator it(space->ToSpaceLow(), space->ToSpaceHigh());
+
+ while (it.has_next()) {
+ NewSpacePage* p = it.next();
+ p->markbits()->Clear();
+ }
+}
+
+
static void ClearMarkbits() {
// TODO(gc): Clean the mark bits while sweeping.
- ClearMarkbits(HEAP->code_space());
- ClearMarkbits(HEAP->map_space());
- ClearMarkbits(HEAP->old_pointer_space());
- ClearMarkbits(HEAP->old_data_space());
- ClearMarkbits(HEAP->cell_space());
- HEAP->new_space()->ActivePage()->markbits()->Clear();
+ Heap* heap = HEAP;
+ ClearMarkbits(heap->code_space());
+ ClearMarkbits(heap->map_space());
+ ClearMarkbits(heap->old_pointer_space());
+ ClearMarkbits(heap->old_data_space());
+ ClearMarkbits(heap->cell_space());
+ ClearMarkbits(heap->new_space());
}
« no previous file with comments | « src/incremental-marking.cc ('k') | src/mark-compact-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698