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

Unified Diff: test/cctest/heap/test-mark-compact.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/heap/test-incremental-marking.cc ('k') | test/cctest/heap/test-page-promotion.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-mark-compact.cc
diff --git a/test/cctest/heap/test-mark-compact.cc b/test/cctest/heap/test-mark-compact.cc
index 87b7c708f369552e67d929ac1a1f6e1e58633712..d0f7f8274139ef092a0306e21aaa2062593069dd 100644
--- a/test/cctest/heap/test-mark-compact.cc
+++ b/test/cctest/heap/test-mark-compact.cc
@@ -89,8 +89,8 @@ TEST(Promotion) {
// Array should be in the new space.
CHECK(heap->InSpace(*array, NEW_SPACE));
- heap->CollectAllGarbage();
- heap->CollectAllGarbage();
+ CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
+ CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
CHECK(heap->InSpace(*array, OLD_SPACE));
}
}
@@ -114,8 +114,8 @@ HEAP_TEST(NoPromotion) {
heap->set_force_oom(true);
// Array should be in the new space.
CHECK(heap->InSpace(*array, NEW_SPACE));
- heap->CollectAllGarbage();
- heap->CollectAllGarbage();
+ CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
+ CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
CHECK(heap->InSpace(*array, NEW_SPACE));
}
}
@@ -132,7 +132,7 @@ HEAP_TEST(MarkCompactCollector) {
Handle<JSGlobalObject> global(isolate->context()->global_object());
// call mark-compact when heap is empty
- heap->CollectGarbage(OLD_SPACE, "trigger 1");
+ CcTest::CollectGarbage(OLD_SPACE);
// keep allocating garbage in new space until it fails
const int arraysize = 100;
@@ -140,14 +140,14 @@ HEAP_TEST(MarkCompactCollector) {
do {
allocation = heap->AllocateFixedArray(arraysize);
} while (!allocation.IsRetry());
- heap->CollectGarbage(NEW_SPACE, "trigger 2");
+ CcTest::CollectGarbage(NEW_SPACE);
heap->AllocateFixedArray(arraysize).ToObjectChecked();
// keep allocating maps until it fails
do {
allocation = heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
} while (!allocation.IsRetry());
- heap->CollectGarbage(MAP_SPACE, "trigger 3");
+ CcTest::CollectGarbage(MAP_SPACE);
heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize).ToObjectChecked();
{ HandleScope scope(isolate);
@@ -159,7 +159,7 @@ HEAP_TEST(MarkCompactCollector) {
factory->NewJSObject(function);
}
- heap->CollectGarbage(OLD_SPACE, "trigger 4");
+ CcTest::CollectGarbage(OLD_SPACE);
{ HandleScope scope(isolate);
Handle<String> func_name = factory->InternalizeUtf8String("theFunction");
@@ -177,7 +177,7 @@ HEAP_TEST(MarkCompactCollector) {
JSReceiver::SetProperty(obj, prop_name, twenty_three, SLOPPY).Check();
}
- heap->CollectGarbage(OLD_SPACE, "trigger 5");
+ CcTest::CollectGarbage(OLD_SPACE);
{ HandleScope scope(isolate);
Handle<String> obj_name = factory->InternalizeUtf8String("theObject");
@@ -220,7 +220,7 @@ TEST(MapCompact) {
// be able to trigger map compaction.
// To give an additional chance to fail, try to force compaction which
// should be impossible right now.
- CcTest::heap()->CollectAllGarbage(Heap::kForceCompactionMask);
+ CcTest::CollectAllGarbage(Heap::kForceCompactionMask);
// And now map pointers should be encodable again.
CHECK(CcTest::heap()->map_space()->MapPointersEncodable());
}
@@ -301,7 +301,7 @@ HEAP_TEST(ObjectGroups) {
g2c1.location());
}
// Do a full GC
- heap->CollectGarbage(OLD_SPACE);
+ CcTest::CollectGarbage(OLD_SPACE);
// All object should be alive.
CHECK_EQ(0, NumberOfWeakCalls);
@@ -328,7 +328,7 @@ HEAP_TEST(ObjectGroups) {
g2c1.location());
}
- heap->CollectGarbage(OLD_SPACE);
+ CcTest::CollectGarbage(OLD_SPACE);
// All objects should be gone. 5 global handles in total.
CHECK_EQ(5, NumberOfWeakCalls);
@@ -341,7 +341,7 @@ HEAP_TEST(ObjectGroups) {
g2c1.location(), reinterpret_cast<void*>(&g2c1_and_id),
&WeakPointerCallback, v8::WeakCallbackType::kParameter);
- heap->CollectGarbage(OLD_SPACE);
+ CcTest::CollectGarbage(OLD_SPACE);
CHECK_EQ(7, NumberOfWeakCalls);
}
« no previous file with comments | « test/cctest/heap/test-incremental-marking.cc ('k') | test/cctest/heap/test-page-promotion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698