Chromium Code Reviews| Index: src/heap/spaces-inl.h |
| diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h |
| index 1567a8790d26ce5d0c88bd86847299cca5985fdf..5f228cd0af035bd3b8ed9547c72d1ffbd4042b31 100644 |
| --- a/src/heap/spaces-inl.h |
| +++ b/src/heap/spaces-inl.h |
| @@ -28,10 +28,14 @@ PageIteratorImpl<PAGE_TYPE> PageIteratorImpl<PAGE_TYPE>::operator++(int) { |
| return tmp; |
| } |
| -NewSpacePageRange::NewSpacePageRange(Address start, Address limit) |
| - : range_(Page::FromAddress(start), |
| - Page::FromAllocationAreaAddress(limit)->next_page()) { |
| - SemiSpace::AssertValidRange(start, limit); |
| +PageRange::PageRange(Address start, Address limit) |
| + : begin_(Page::FromAllocationAreaAddress(start)), |
| + end_(Page::FromAllocationAreaAddress(limit)->next_page()) { |
| +#ifdef DEBUG |
| + if (begin_->InNewSpace()) { |
| + SemiSpace::AssertValidRange(start, limit); |
| + } |
| +#endif // DEBUG |
| } |
| // ----------------------------------------------------------------------------- |
| @@ -68,8 +72,9 @@ HeapObject* HeapObjectIterator::Next() { |
| HeapObject* HeapObjectIterator::FromCurrentPage() { |
| while (cur_addr_ != cur_end_) { |
|
Hannes Payer (out of office)
2016/11/23 13:07:26
Please add a comment here.
Michael Lippautz
2016/11/23 13:29:07
Done.
|
| - if (cur_addr_ == space_->top() && cur_addr_ != space_->limit()) { |
| - cur_addr_ = space_->limit(); |
| + if (cur_addr_ == space_->top() && |
| + (cur_addr_ != space_->limit() || current_page()->InNewSpace())) { |
| + cur_addr_ = current_page()->InNewSpace() ? cur_end_ : space_->limit(); |
| continue; |
| } |
| HeapObject* obj = HeapObject::FromAddress(cur_addr_); |
| @@ -79,7 +84,7 @@ HeapObject* HeapObjectIterator::FromCurrentPage() { |
| if (!obj->IsFiller()) { |
| if (obj->IsCode()) { |
| DCHECK_EQ(space_, space_->heap()->code_space()); |
| - DCHECK_CODEOBJECT_SIZE(obj_size, space_); |
| + DCHECK_CODEOBJECT_SIZE(obj_size, reinterpret_cast<PagedSpace*>(space_)); |
| } else { |
| DCHECK_OBJECT_SIZE(obj_size); |
| } |