OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_SPACES_INL_H_ | 5 #ifndef V8_HEAP_SPACES_INL_H_ |
6 #define V8_HEAP_SPACES_INL_H_ | 6 #define V8_HEAP_SPACES_INL_H_ |
7 | 7 |
8 #include "src/heap/incremental-marking.h" | 8 #include "src/heap/incremental-marking.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 return *this; | 21 return *this; |
22 } | 22 } |
23 | 23 |
24 template <class PAGE_TYPE> | 24 template <class PAGE_TYPE> |
25 PageIteratorImpl<PAGE_TYPE> PageIteratorImpl<PAGE_TYPE>::operator++(int) { | 25 PageIteratorImpl<PAGE_TYPE> PageIteratorImpl<PAGE_TYPE>::operator++(int) { |
26 PageIteratorImpl<PAGE_TYPE> tmp(*this); | 26 PageIteratorImpl<PAGE_TYPE> tmp(*this); |
27 operator++(); | 27 operator++(); |
28 return tmp; | 28 return tmp; |
29 } | 29 } |
30 | 30 |
31 NewSpacePageRange::NewSpacePageRange(Address start, Address limit) | 31 PageRange::PageRange(Address start, Address limit) |
32 : range_(Page::FromAddress(start), | 32 : begin_(Page::FromAddress(start)), |
33 Page::FromAllocationAreaAddress(limit)->next_page()) { | 33 end_(Page::FromAllocationAreaAddress(limit)->next_page()) { |
34 SemiSpace::AssertValidRange(start, limit); | 34 #ifdef DEBUG |
| 35 if (begin_->InNewSpace()) { |
| 36 SemiSpace::AssertValidRange(start, limit); |
| 37 } |
| 38 #endif // DEBUG |
35 } | 39 } |
36 | 40 |
37 // ----------------------------------------------------------------------------- | 41 // ----------------------------------------------------------------------------- |
38 // SemiSpaceIterator | 42 // SemiSpaceIterator |
39 | 43 |
40 HeapObject* SemiSpaceIterator::Next() { | 44 HeapObject* SemiSpaceIterator::Next() { |
41 while (current_ != limit_) { | 45 while (current_ != limit_) { |
42 if (Page::IsAlignedToPageSize(current_)) { | 46 if (Page::IsAlignedToPageSize(current_)) { |
43 Page* page = Page::FromAllocationAreaAddress(current_); | 47 Page* page = Page::FromAllocationAreaAddress(current_); |
44 page = page->next_page(); | 48 page = page->next_page(); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 other->allocation_info_.Reset(nullptr, nullptr); | 624 other->allocation_info_.Reset(nullptr, nullptr); |
621 return true; | 625 return true; |
622 } | 626 } |
623 return false; | 627 return false; |
624 } | 628 } |
625 | 629 |
626 } // namespace internal | 630 } // namespace internal |
627 } // namespace v8 | 631 } // namespace v8 |
628 | 632 |
629 #endif // V8_HEAP_SPACES_INL_H_ | 633 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |