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_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 }; | 1411 }; |
1412 | 1412 |
1413 typedef PageIteratorImpl<Page> PageIterator; | 1413 typedef PageIteratorImpl<Page> PageIterator; |
1414 typedef PageIteratorImpl<LargePage> LargePageIterator; | 1414 typedef PageIteratorImpl<LargePage> LargePageIterator; |
1415 | 1415 |
1416 class PageRange { | 1416 class PageRange { |
1417 public: | 1417 public: |
1418 typedef PageIterator iterator; | 1418 typedef PageIterator iterator; |
1419 PageRange(Page* begin, Page* end) : begin_(begin), end_(end) {} | 1419 PageRange(Page* begin, Page* end) : begin_(begin), end_(end) {} |
1420 explicit PageRange(Page* page) : PageRange(page, page->next_page()) {} | 1420 explicit PageRange(Page* page) : PageRange(page, page->next_page()) {} |
| 1421 inline PageRange(Address start, Address limit); |
| 1422 |
1421 iterator begin() { return iterator(begin_); } | 1423 iterator begin() { return iterator(begin_); } |
1422 iterator end() { return iterator(end_); } | 1424 iterator end() { return iterator(end_); } |
1423 | 1425 |
1424 private: | 1426 private: |
1425 Page* begin_; | 1427 Page* begin_; |
1426 Page* end_; | 1428 Page* end_; |
1427 }; | 1429 }; |
1428 | 1430 |
1429 // ----------------------------------------------------------------------------- | 1431 // ----------------------------------------------------------------------------- |
1430 // Heap object iterator in new/old/map spaces. | 1432 // Heap object iterator in new/old/map spaces. |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 | 1872 |
1871 private: | 1873 private: |
1872 LocalAllocationBuffer(Heap* heap, AllocationInfo allocation_info); | 1874 LocalAllocationBuffer(Heap* heap, AllocationInfo allocation_info); |
1873 | 1875 |
1874 void Close(); | 1876 void Close(); |
1875 | 1877 |
1876 Heap* heap_; | 1878 Heap* heap_; |
1877 AllocationInfo allocation_info_; | 1879 AllocationInfo allocation_info_; |
1878 }; | 1880 }; |
1879 | 1881 |
1880 class NewSpacePageRange { | |
1881 public: | |
1882 typedef PageRange::iterator iterator; | |
1883 inline NewSpacePageRange(Address start, Address limit); | |
1884 iterator begin() { return range_.begin(); } | |
1885 iterator end() { return range_.end(); } | |
1886 | |
1887 private: | |
1888 PageRange range_; | |
1889 }; | |
1890 | |
1891 class PagedSpace : public Space { | 1882 class PagedSpace : public Space { |
1892 public: | 1883 public: |
1893 typedef PageIterator iterator; | 1884 typedef PageIterator iterator; |
1894 | 1885 |
1895 static const intptr_t kCompactionMemoryWanted = 500 * KB; | 1886 static const intptr_t kCompactionMemoryWanted = 500 * KB; |
1896 | 1887 |
1897 // Creates a space with an id. | 1888 // Creates a space with an id. |
1898 PagedSpace(Heap* heap, AllocationSpace id, Executability executable); | 1889 PagedSpace(Heap* heap, AllocationSpace id, Executability executable); |
1899 | 1890 |
1900 ~PagedSpace() override { TearDown(); } | 1891 ~PagedSpace() override { TearDown(); } |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2916 PageIterator old_iterator_; | 2907 PageIterator old_iterator_; |
2917 PageIterator code_iterator_; | 2908 PageIterator code_iterator_; |
2918 PageIterator map_iterator_; | 2909 PageIterator map_iterator_; |
2919 LargePageIterator lo_iterator_; | 2910 LargePageIterator lo_iterator_; |
2920 }; | 2911 }; |
2921 | 2912 |
2922 } // namespace internal | 2913 } // namespace internal |
2923 } // namespace v8 | 2914 } // namespace v8 |
2924 | 2915 |
2925 #endif // V8_HEAP_SPACES_H_ | 2916 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |