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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/atomic-utils.h" | 9 #include "src/atomic-utils.h" |
10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2114 | 2114 |
2115 // Generic fast case allocation function that tries aligned linear allocation | 2115 // Generic fast case allocation function that tries aligned linear allocation |
2116 // at the address denoted by top in allocation_info_. Writes the aligned | 2116 // at the address denoted by top in allocation_info_. Writes the aligned |
2117 // allocation size, which includes the filler size, to size_in_bytes. | 2117 // allocation size, which includes the filler size, to size_in_bytes. |
2118 inline HeapObject* AllocateLinearlyAligned(int* size_in_bytes, | 2118 inline HeapObject* AllocateLinearlyAligned(int* size_in_bytes, |
2119 AllocationAlignment alignment); | 2119 AllocationAlignment alignment); |
2120 | 2120 |
2121 // If sweeping is still in progress try to sweep unswept pages. If that is | 2121 // If sweeping is still in progress try to sweep unswept pages. If that is |
2122 // not successful, wait for the sweeper threads and re-try free-list | 2122 // not successful, wait for the sweeper threads and re-try free-list |
2123 // allocation. | 2123 // allocation. |
2124 MUST_USE_RESULT HeapObject* WaitForSweeperThreadsAndRetryAllocation( | 2124 MUST_USE_RESULT virtual HeapObject* SweepAndRetryAllocation( |
2125 int size_in_bytes); | 2125 int size_in_bytes); |
2126 | 2126 |
2127 // Slow path of AllocateRaw. This function is space-dependent. | 2127 // Slow path of AllocateRaw. This function is space-dependent. |
2128 MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes); | 2128 MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes); |
2129 | 2129 |
2130 int area_size_; | 2130 int area_size_; |
2131 | 2131 |
2132 // Accounting information for this space. | 2132 // Accounting information for this space. |
2133 AllocationStats accounting_stats_; | 2133 AllocationStats accounting_stats_; |
2134 | 2134 |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2831 Free(start, size_in_bytes); | 2831 Free(start, size_in_bytes); |
2832 } | 2832 } |
2833 | 2833 |
2834 virtual bool is_local() override { return true; } | 2834 virtual bool is_local() override { return true; } |
2835 | 2835 |
2836 virtual void RefillFreeList() override; | 2836 virtual void RefillFreeList() override; |
2837 | 2837 |
2838 protected: | 2838 protected: |
2839 // The space is temporary and not included in any snapshots. | 2839 // The space is temporary and not included in any snapshots. |
2840 virtual bool snapshotable() override { return false; } | 2840 virtual bool snapshotable() override { return false; } |
| 2841 |
| 2842 MUST_USE_RESULT virtual HeapObject* SweepAndRetryAllocation( |
| 2843 int size_in_bytes) override; |
2841 }; | 2844 }; |
2842 | 2845 |
2843 | 2846 |
2844 // A collection of |CompactionSpace|s used by a single compaction task. | 2847 // A collection of |CompactionSpace|s used by a single compaction task. |
2845 class CompactionSpaceCollection : public Malloced { | 2848 class CompactionSpaceCollection : public Malloced { |
2846 public: | 2849 public: |
2847 explicit CompactionSpaceCollection(Heap* heap) | 2850 explicit CompactionSpaceCollection(Heap* heap) |
2848 : old_space_(heap, OLD_SPACE, Executability::NOT_EXECUTABLE), | 2851 : old_space_(heap, OLD_SPACE, Executability::NOT_EXECUTABLE), |
2849 code_space_(heap, CODE_SPACE, Executability::EXECUTABLE) {} | 2852 code_space_(heap, CODE_SPACE, Executability::EXECUTABLE) {} |
2850 | 2853 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3056 count = 0; | 3059 count = 0; |
3057 } | 3060 } |
3058 // Must be small, since an iteration is used for lookup. | 3061 // Must be small, since an iteration is used for lookup. |
3059 static const int kMaxComments = 64; | 3062 static const int kMaxComments = 64; |
3060 }; | 3063 }; |
3061 #endif | 3064 #endif |
3062 } // namespace internal | 3065 } // namespace internal |
3063 } // namespace v8 | 3066 } // namespace v8 |
3064 | 3067 |
3065 #endif // V8_HEAP_SPACES_H_ | 3068 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |