Index: src/spaces.cc |
=================================================================== |
--- src/spaces.cc (revision 1910) |
+++ src/spaces.cc (working copy) |
@@ -111,17 +111,17 @@ |
// ----------------------------------------------------------------------------- |
// PageIterator |
-PageIterator::PageIterator(PagedSpace* space, Mode mode) : space_(space) { |
- prev_page_ = NULL; |
+PageIterator::PageIterator(PagedSpace* space, Mode mode) { |
+ cur_page_ = space->first_page_; |
switch (mode) { |
case PAGES_IN_USE: |
- stop_page_ = space->AllocationTopPage(); |
+ stop_page_ = space->AllocationTopPage()->next_page(); |
break; |
case PAGES_USED_BY_MC: |
- stop_page_ = space->MCRelocationTopPage(); |
+ stop_page_ = space->MCRelocationTopPage()->next_page(); |
break; |
case ALL_PAGES: |
- stop_page_ = space->last_page_; |
+ stop_page_ = Page::FromAddress(NULL); |
break; |
default: |
UNREACHABLE(); |
@@ -496,11 +496,8 @@ |
accounting_stats_.ExpandSpace(num_pages * Page::kObjectAreaSize); |
ASSERT(Capacity() <= max_capacity_); |
- // Sequentially initialize remembered sets in the newly allocated |
- // pages and cache the current last page in the space. |
for (Page* p = first_page_; p->is_valid(); p = p->next_page()) { |
p->ClearRSet(); |
- last_page_ = p; |
} |
// Use first_page_ for allocation. |
@@ -679,11 +676,9 @@ |
MemoryAllocator::SetNextPage(last_page, p); |
- // Sequentially clear remembered set of new pages and and cache the |
- // new last page in the space. |
+ // Clear remembered set of new pages. |
while (p->is_valid()) { |
p->ClearRSet(); |
- last_page_ = p; |
p = p->next_page(); |
} |
@@ -728,12 +723,10 @@ |
Page* p = MemoryAllocator::FreePages(last_page_to_keep->next_page()); |
MemoryAllocator::SetNextPage(last_page_to_keep, p); |
- // Since pages are only freed in whole chunks, we may have kept more |
- // than pages_to_keep. Count the extra pages and cache the new last |
- // page in the space. |
+ // Since pages are only freed in whole chunks, we may have kept more than |
+ // pages_to_keep. |
while (p->is_valid()) { |
pages_to_keep++; |
- last_page_ = p; |
p = p->next_page(); |
} |