OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "test/cctest/heap/heap-utils.h" | 5 #include "test/cctest/heap/heap-utils.h" |
6 | 6 |
7 #include "src/factory.h" | 7 #include "src/factory.h" |
8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
9 #include "src/heap/incremental-marking.h" | 9 #include "src/heap/incremental-marking.h" |
10 #include "src/heap/mark-compact.h" | 10 #include "src/heap/mark-compact.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 CHECK(marking->IsComplete()); | 135 CHECK(marking->IsComplete()); |
136 } | 136 } |
137 | 137 |
138 void SimulateFullSpace(v8::internal::PagedSpace* space) { | 138 void SimulateFullSpace(v8::internal::PagedSpace* space) { |
139 space->EmptyAllocationInfo(); | 139 space->EmptyAllocationInfo(); |
140 space->ResetFreeList(); | 140 space->ResetFreeList(); |
141 space->ClearStats(); | 141 space->ClearStats(); |
142 } | 142 } |
143 | 143 |
| 144 void AbandonCurrentlyFreeMemory(PagedSpace* space) { |
| 145 space->EmptyAllocationInfo(); |
| 146 PageIterator pit(space); |
| 147 while (pit.has_next()) { |
| 148 pit.next()->MarkNeverAllocateForTesting(); |
| 149 } |
| 150 } |
| 151 |
| 152 void GcAndSweep(Heap* heap, AllocationSpace space) { |
| 153 heap->CollectGarbage(space); |
| 154 if (heap->mark_compact_collector()->sweeping_in_progress()) { |
| 155 heap->mark_compact_collector()->EnsureSweepingCompleted(); |
| 156 } |
| 157 } |
| 158 |
144 } // namespace heap | 159 } // namespace heap |
145 } // namespace internal | 160 } // namespace internal |
146 } // namespace v8 | 161 } // namespace v8 |
OLD | NEW |