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

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

Issue 2321553002: [heap] Do more incremental marking work in tasks. (Closed)
Patch Set: 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 CHECK(marking->IsMarking() || marking->IsStopped() || marking->IsComplete()); 154 CHECK(marking->IsMarking() || marking->IsStopped() || marking->IsComplete());
155 if (marking->IsStopped()) { 155 if (marking->IsStopped()) {
156 heap->StartIncrementalMarking(i::Heap::kNoGCFlags, 156 heap->StartIncrementalMarking(i::Heap::kNoGCFlags,
157 i::GarbageCollectionReason::kTesting); 157 i::GarbageCollectionReason::kTesting);
158 } 158 }
159 CHECK(marking->IsMarking() || marking->IsComplete()); 159 CHECK(marking->IsMarking() || marking->IsComplete());
160 if (!force_completion) return; 160 if (!force_completion) return;
161 161
162 while (!marking->IsComplete()) { 162 while (!marking->IsComplete()) {
163 marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD, 163 marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD,
164 i::IncrementalMarking::FORCE_COMPLETION); 164 i::IncrementalMarking::FORCE_COMPLETION, i::StepOrigin::kV8);
165 if (marking->IsReadyToOverApproximateWeakClosure()) { 165 if (marking->IsReadyToOverApproximateWeakClosure()) {
166 marking->FinalizeIncrementally(); 166 marking->FinalizeIncrementally();
167 } 167 }
168 } 168 }
169 CHECK(marking->IsComplete()); 169 CHECK(marking->IsComplete());
170 } 170 }
171 171
172 void SimulateFullSpace(v8::internal::PagedSpace* space) { 172 void SimulateFullSpace(v8::internal::PagedSpace* space) {
173 space->EmptyAllocationInfo(); 173 space->EmptyAllocationInfo();
174 space->ResetFreeList(); 174 space->ResetFreeList();
(...skipping 10 matching lines...) Expand all
185 void GcAndSweep(Heap* heap, AllocationSpace space) { 185 void GcAndSweep(Heap* heap, AllocationSpace space) {
186 heap->CollectGarbage(space, GarbageCollectionReason::kTesting); 186 heap->CollectGarbage(space, GarbageCollectionReason::kTesting);
187 if (heap->mark_compact_collector()->sweeping_in_progress()) { 187 if (heap->mark_compact_collector()->sweeping_in_progress()) {
188 heap->mark_compact_collector()->EnsureSweepingCompleted(); 188 heap->mark_compact_collector()->EnsureSweepingCompleted();
189 } 189 }
190 } 190 }
191 191
192 } // namespace heap 192 } // namespace heap
193 } // namespace internal 193 } // namespace internal
194 } // namespace v8 194 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698