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

Unified Diff: test/cctest/heap/test-mark-compact.cc

Issue 2310143002: [heap] Introduce enum of garbage collection reasons. (Closed)
Patch Set: fix win 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
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 a906d3473fec3b07ee78e43111faa94cb1895fe9..1474ad49252bfd4e490d4a7a1fc40902a67a9bc5 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));
}
}
@@ -110,8 +110,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));
}
}
@@ -128,7 +128,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;
@@ -136,14 +136,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);
@@ -155,7 +155,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");
@@ -173,7 +173,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");
@@ -216,7 +216,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());
}
@@ -297,7 +297,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);
@@ -324,7 +324,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);
@@ -337,7 +337,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);
}

Powered by Google App Engine
This is Rietveld 408576698