Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: test/cctest/heap/heap-utils.cc

Issue 2304123003: [heap] Refactor incremental marking step. (Closed)
Patch Set: x Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 collector->EnsureSweepingCompleted(); 118 collector->EnsureSweepingCompleted();
119 } 119 }
120 CHECK(marking->IsMarking() || marking->IsStopped()); 120 CHECK(marking->IsMarking() || marking->IsStopped());
121 if (marking->IsStopped()) { 121 if (marking->IsStopped()) {
122 heap->StartIncrementalMarking(); 122 heap->StartIncrementalMarking();
123 } 123 }
124 CHECK(marking->IsMarking()); 124 CHECK(marking->IsMarking());
125 if (!force_completion) return; 125 if (!force_completion) return;
126 126
127 while (!marking->IsComplete()) { 127 while (!marking->IsComplete()) {
128 marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD); 128 marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD,
129 i::IncrementalMarking::FORCE_COMPLETION);
129 if (marking->IsReadyToOverApproximateWeakClosure()) { 130 if (marking->IsReadyToOverApproximateWeakClosure()) {
130 marking->FinalizeIncrementally(); 131 marking->FinalizeIncrementally();
131 } 132 }
132 } 133 }
133 CHECK(marking->IsComplete()); 134 CHECK(marking->IsComplete());
134 } 135 }
135 136
136 void SimulateFullSpace(v8::internal::PagedSpace* space) { 137 void SimulateFullSpace(v8::internal::PagedSpace* space) {
137 space->EmptyAllocationInfo(); 138 space->EmptyAllocationInfo();
138 space->ResetFreeList(); 139 space->ResetFreeList();
(...skipping 10 matching lines...) Expand all
149 void GcAndSweep(Heap* heap, AllocationSpace space) { 150 void GcAndSweep(Heap* heap, AllocationSpace space) {
150 heap->CollectGarbage(space); 151 heap->CollectGarbage(space);
151 if (heap->mark_compact_collector()->sweeping_in_progress()) { 152 if (heap->mark_compact_collector()->sweeping_in_progress()) {
152 heap->mark_compact_collector()->EnsureSweepingCompleted(); 153 heap->mark_compact_collector()->EnsureSweepingCompleted();
153 } 154 }
154 } 155 }
155 156
156 } // namespace heap 157 } // namespace heap
157 } // namespace internal 158 } // namespace internal
158 } // namespace v8 159 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698