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 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2176 inline HeapObject* AllocateLinearlyAligned(int* size_in_bytes, | 2176 inline HeapObject* AllocateLinearlyAligned(int* size_in_bytes, |
2177 AllocationAlignment alignment); | 2177 AllocationAlignment alignment); |
2178 | 2178 |
2179 // If sweeping is still in progress try to sweep unswept pages. If that is | 2179 // If sweeping is still in progress try to sweep unswept pages. If that is |
2180 // not successful, wait for the sweeper threads and re-try free-list | 2180 // not successful, wait for the sweeper threads and re-try free-list |
2181 // allocation. | 2181 // allocation. |
2182 MUST_USE_RESULT virtual HeapObject* SweepAndRetryAllocation( | 2182 MUST_USE_RESULT virtual HeapObject* SweepAndRetryAllocation( |
2183 int size_in_bytes); | 2183 int size_in_bytes); |
2184 | 2184 |
2185 // Slow path of AllocateRaw. This function is space-dependent. | 2185 // Slow path of AllocateRaw. This function is space-dependent. |
2186 MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes); | 2186 MUST_USE_RESULT virtual HeapObject* SlowAllocateRaw(int size_in_bytes); |
| 2187 |
| 2188 MUST_USE_RESULT HeapObject* RawSlowAllocateRaw(int size_in_bytes); |
2187 | 2189 |
2188 size_t area_size_; | 2190 size_t area_size_; |
2189 | 2191 |
2190 // Accounting information for this space. | 2192 // Accounting information for this space. |
2191 AllocationStats accounting_stats_; | 2193 AllocationStats accounting_stats_; |
2192 | 2194 |
2193 // The dummy page that anchors the double linked list of pages. | 2195 // The dummy page that anchors the double linked list of pages. |
2194 Page anchor_; | 2196 Page anchor_; |
2195 | 2197 |
2196 // The space's free list. | 2198 // The space's free list. |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2735 : PagedSpace(heap, id, executable) {} | 2737 : PagedSpace(heap, id, executable) {} |
2736 | 2738 |
2737 bool is_local() override { return true; } | 2739 bool is_local() override { return true; } |
2738 | 2740 |
2739 protected: | 2741 protected: |
2740 // The space is temporary and not included in any snapshots. | 2742 // The space is temporary and not included in any snapshots. |
2741 bool snapshotable() override { return false; } | 2743 bool snapshotable() override { return false; } |
2742 | 2744 |
2743 MUST_USE_RESULT HeapObject* SweepAndRetryAllocation( | 2745 MUST_USE_RESULT HeapObject* SweepAndRetryAllocation( |
2744 int size_in_bytes) override; | 2746 int size_in_bytes) override; |
| 2747 |
| 2748 MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes) override; |
2745 }; | 2749 }; |
2746 | 2750 |
2747 | 2751 |
2748 // A collection of |CompactionSpace|s used by a single compaction task. | 2752 // A collection of |CompactionSpace|s used by a single compaction task. |
2749 class CompactionSpaceCollection : public Malloced { | 2753 class CompactionSpaceCollection : public Malloced { |
2750 public: | 2754 public: |
2751 explicit CompactionSpaceCollection(Heap* heap) | 2755 explicit CompactionSpaceCollection(Heap* heap) |
2752 : old_space_(heap, OLD_SPACE, Executability::NOT_EXECUTABLE), | 2756 : old_space_(heap, OLD_SPACE, Executability::NOT_EXECUTABLE), |
2753 code_space_(heap, CODE_SPACE, Executability::EXECUTABLE) {} | 2757 code_space_(heap, CODE_SPACE, Executability::EXECUTABLE) {} |
2754 | 2758 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2955 PageIterator old_iterator_; | 2959 PageIterator old_iterator_; |
2956 PageIterator code_iterator_; | 2960 PageIterator code_iterator_; |
2957 PageIterator map_iterator_; | 2961 PageIterator map_iterator_; |
2958 LargePageIterator lo_iterator_; | 2962 LargePageIterator lo_iterator_; |
2959 }; | 2963 }; |
2960 | 2964 |
2961 } // namespace internal | 2965 } // namespace internal |
2962 } // namespace v8 | 2966 } // namespace v8 |
2963 | 2967 |
2964 #endif // V8_HEAP_SPACES_H_ | 2968 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |