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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 | 689 |
690 private: | 690 private: |
691 void InitializeReservedMemory() { reservation_.Reset(); } | 691 void InitializeReservedMemory() { reservation_.Reset(); } |
692 | 692 |
693 friend class MemoryAllocator; | 693 friend class MemoryAllocator; |
694 friend class MemoryChunkValidator; | 694 friend class MemoryChunkValidator; |
695 }; | 695 }; |
696 | 696 |
697 DEFINE_OPERATORS_FOR_FLAGS(MemoryChunk::Flags) | 697 DEFINE_OPERATORS_FOR_FLAGS(MemoryChunk::Flags) |
698 | 698 |
699 STATIC_ASSERT(kMaxRegularHeapObjectSize < MemoryChunk::kAllocatableMemory); | 699 static_assert(kMaxRegularHeapObjectSize <= MemoryChunk::kAllocatableMemory, |
| 700 "kMaxRegularHeapObjectSize <= MemoryChunk::kAllocatableMemory"); |
700 | 701 |
701 // ----------------------------------------------------------------------------- | 702 // ----------------------------------------------------------------------------- |
702 // A page is a memory chunk of a size 1MB. Large object pages may be larger. | 703 // A page is a memory chunk of a size 1MB. Large object pages may be larger. |
703 // | 704 // |
704 // The only way to get a page pointer is by calling factory methods: | 705 // The only way to get a page pointer is by calling factory methods: |
705 // Page* p = Page::FromAddress(addr); or | 706 // Page* p = Page::FromAddress(addr); or |
706 // Page* p = Page::FromTopOrLimit(top); | 707 // Page* p = Page::FromTopOrLimit(top); |
707 class Page : public MemoryChunk { | 708 class Page : public MemoryChunk { |
708 public: | 709 public: |
709 static const intptr_t kCopyAllFlags = ~0; | 710 static const intptr_t kCopyAllFlags = ~0; |
(...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2941 PageIterator old_iterator_; | 2942 PageIterator old_iterator_; |
2942 PageIterator code_iterator_; | 2943 PageIterator code_iterator_; |
2943 PageIterator map_iterator_; | 2944 PageIterator map_iterator_; |
2944 LargePageIterator lo_iterator_; | 2945 LargePageIterator lo_iterator_; |
2945 }; | 2946 }; |
2946 | 2947 |
2947 } // namespace internal | 2948 } // namespace internal |
2948 } // namespace v8 | 2949 } // namespace v8 |
2949 | 2950 |
2950 #endif // V8_HEAP_SPACES_H_ | 2951 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |