Index: src/spaces.cc |
=================================================================== |
--- src/spaces.cc (revision 1888) |
+++ src/spaces.cc (working copy) |
@@ -111,17 +111,17 @@ |
// ----------------------------------------------------------------------------- |
// PageIterator |
-PageIterator::PageIterator(PagedSpace* space, Mode mode) { |
- cur_page_ = space->first_page_; |
+PageIterator::PageIterator(PagedSpace* space, Mode mode) : space_(space) { |
+ prev_page_ = NULL; |
switch (mode) { |
case PAGES_IN_USE: |
- stop_page_ = space->AllocationTopPage()->next_page(); |
+ stop_page_ = space->AllocationTopPage(); |
break; |
case PAGES_USED_BY_MC: |
- stop_page_ = space->MCRelocationTopPage()->next_page(); |
+ stop_page_ = space->MCRelocationTopPage(); |
break; |
case ALL_PAGES: |
- stop_page_ = Page::FromAddress(NULL); |
+ stop_page_ = space->last_page_; |
break; |
default: |
UNREACHABLE(); |
@@ -498,6 +498,7 @@ |
for (Page* p = first_page_; p->is_valid(); p = p->next_page()) { |
p->ClearRSet(); |
+ last_page_ = p; |
} |
// Use first_page_ for allocation. |
@@ -679,6 +680,7 @@ |
// Clear remembered set of new pages. |
while (p->is_valid()) { |
p->ClearRSet(); |
+ last_page_ = p; |
p = p->next_page(); |
} |
@@ -727,6 +729,7 @@ |
// pages_to_keep. |
while (p->is_valid()) { |
pages_to_keep++; |
+ last_page_ = p; |
p = p->next_page(); |
} |