Index: src/spaces-inl.h |
=================================================================== |
--- src/spaces-inl.h (revision 1915) |
+++ src/spaces-inl.h (working copy) |
@@ -64,15 +64,16 @@ |
// PageIterator |
bool PageIterator::has_next() { |
- return cur_page_ != stop_page_; |
+ return prev_page_ != stop_page_; |
} |
Page* PageIterator::next() { |
ASSERT(has_next()); |
- Page* result = cur_page_; |
- cur_page_ = cur_page_->next_page(); |
- return result; |
+ prev_page_ = (prev_page_ == NULL) |
+ ? space_->first_page_ |
+ : prev_page_->next_page(); |
+ return prev_page_; |
} |