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

Unified Diff: test/cctest/heap/heap-utils.cc

Issue 2310143002: [heap] Introduce enum of garbage collection reasons. (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.cc ('k') | test/cctest/heap/test-alloc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/heap-utils.cc
diff --git a/test/cctest/heap/heap-utils.cc b/test/cctest/heap/heap-utils.cc
index 99a2e3d369c91319827c97e3f646930bf79e33c3..ad94d2c734770bd6bd0c853fa0e032856333d747 100644
--- a/test/cctest/heap/heap-utils.cc
+++ b/test/cctest/heap/heap-utils.cc
@@ -15,8 +15,10 @@ namespace internal {
namespace heap {
void SealCurrentObjects(Heap* heap) {
- heap->CollectAllGarbage();
- heap->CollectAllGarbage();
+ heap->CollectAllGarbage(Heap::kFinalizeIncrementalMarkingMask,
+ GarbageCollectionReason::kTesting);
+ heap->CollectAllGarbage(Heap::kFinalizeIncrementalMarkingMask,
+ GarbageCollectionReason::kTesting);
heap->mark_compact_collector()->EnsureSweepingCompleted();
heap->old_space()->EmptyAllocationInfo();
for (Page* page : *heap->old_space()) {
@@ -151,7 +153,8 @@ void SimulateIncrementalMarking(i::Heap* heap, bool force_completion) {
}
CHECK(marking->IsMarking() || marking->IsStopped() || marking->IsComplete());
if (marking->IsStopped()) {
- heap->StartIncrementalMarking();
+ heap->StartIncrementalMarking(i::Heap::kNoGCFlags,
+ i::GarbageCollectionReason::kTesting);
}
CHECK(marking->IsMarking() || marking->IsComplete());
if (!force_completion) return;
@@ -180,7 +183,7 @@ void AbandonCurrentlyFreeMemory(PagedSpace* space) {
}
void GcAndSweep(Heap* heap, AllocationSpace space) {
- heap->CollectGarbage(space);
+ heap->CollectGarbage(space, GarbageCollectionReason::kTesting);
if (heap->mark_compact_collector()->sweeping_in_progress()) {
heap->mark_compact_collector()->EnsureSweepingCompleted();
}
« no previous file with comments | « test/cctest/cctest.cc ('k') | test/cctest/heap/test-alloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698