OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 HEAP_UTILS_H_ | 5 #ifndef HEAP_UTILS_H_ |
6 #define HEAP_UTILS_H_ | 6 #define HEAP_UTILS_H_ |
7 | 7 |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/heap/heap-inl.h" | 9 #include "src/heap/heap-inl.h" |
10 #include "src/heap/incremental-marking.h" | 10 #include "src/heap/incremental-marking.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 | 135 |
136 while (!marking->IsComplete()) { | 136 while (!marking->IsComplete()) { |
137 marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD); | 137 marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
138 if (marking->IsReadyToOverApproximateWeakClosure()) { | 138 if (marking->IsReadyToOverApproximateWeakClosure()) { |
139 marking->FinalizeIncrementally(); | 139 marking->FinalizeIncrementally(); |
140 } | 140 } |
141 } | 141 } |
142 CHECK(marking->IsComplete()); | 142 CHECK(marking->IsComplete()); |
143 } | 143 } |
144 | 144 |
145 static inline void AbandonCurrentlyFreeMemory(PagedSpace* space) { | |
146 space->EmptyAllocationInfo(); | |
147 PageIterator pit(space); | |
148 while (pit.has_next()) { | |
149 pit.next()->MarkNeverAllocateForTesting(); | |
150 } | |
151 } | |
152 | |
153 static inline void GcAndSweep(Heap* heap, AllocationSpace space) { | |
Hannes Payer (out of office)
2016/05/11 11:12:34
Why don't we make it a CollectGarbage mode that fi
Michael Lippautz
2016/05/11 18:43:26
Good idea! Fine to do it in a follow up? It requir
| |
154 heap->CollectGarbage(space); | |
155 if (heap->mark_compact_collector()->sweeping_in_progress()) { | |
156 heap->mark_compact_collector()->EnsureSweepingCompleted(); | |
157 } | |
158 } | |
159 | |
145 } // namespace internal | 160 } // namespace internal |
146 } // namespace v8 | 161 } // namespace v8 |
147 | 162 |
148 #endif // HEAP_UTILS_H_ | 163 #endif // HEAP_UTILS_H_ |
OLD | NEW |