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

Unified Diff: test/cctest/test-serialize.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/test-mementos.cc ('k') | test/cctest/test-symbols.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-serialize.cc
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc
index 4373ddca9655771e6b390a9880564c79dcd48a75..a476cfdf9d65f9f92216d552e7783e2386362773 100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -90,7 +90,8 @@ static Vector<const byte> Serialize(v8::Isolate* isolate) {
}
Isolate* internal_isolate = reinterpret_cast<Isolate*>(isolate);
- internal_isolate->heap()->CollectAllAvailableGarbage("serialize");
+ internal_isolate->heap()->CollectAllAvailableGarbage(
+ i::GarbageCollectionReason::kTesting);
StartupSerializer ser(internal_isolate,
v8::SnapshotCreator::FunctionCodeHandling::kClear);
ser.SerializeStrongReferences();
@@ -263,8 +264,10 @@ static void PartiallySerializeObject(Vector<const byte>* startup_blob_out,
isolate->bootstrapper()->SourceLookup<Natives>(i);
}
}
- heap->CollectAllGarbage();
- heap->CollectAllGarbage();
+ heap->CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask,
+ i::GarbageCollectionReason::kTesting);
+ heap->CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask,
+ i::GarbageCollectionReason::kTesting);
Object* raw_foo;
{
@@ -366,7 +369,8 @@ static void PartiallySerializeContext(Vector<const byte>* startup_blob_out,
}
// If we don't do this then we end up with a stray root pointing at the
// context even after we have disposed of env.
- heap->CollectAllGarbage();
+ heap->CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask,
+ i::GarbageCollectionReason::kTesting);
{
v8::HandleScope handle_scope(v8_isolate);
@@ -484,7 +488,8 @@ static void PartiallySerializeCustomContext(
}
// If we don't do this then we end up with a stray root pointing at the
// context even after we have disposed of env.
- isolate->heap()->CollectAllAvailableGarbage("snapshotting");
+ isolate->heap()->CollectAllAvailableGarbage(
+ i::GarbageCollectionReason::kTesting);
{
v8::HandleScope handle_scope(v8_isolate);
@@ -1894,7 +1899,6 @@ TEST(CodeSerializerEmbeddedObject) {
LocalContext context;
Isolate* isolate = CcTest::i_isolate();
isolate->compilation_cache()->Disable(); // Disable same-isolate code cache.
- Heap* heap = isolate->heap();
v8::HandleScope scope(CcTest::isolate());
size_t actual_size;
@@ -1934,7 +1938,7 @@ TEST(CodeSerializerEmbeddedObject) {
CHECK(rit2.rinfo()->target_object()->IsHeapNumber());
CHECK_EQ(0.3, HeapNumber::cast(rit2.rinfo()->target_object())->value());
- heap->CollectAllAvailableGarbage();
+ CcTest::CollectAllAvailableGarbage();
RelocIterator rit3(copy->code(),
RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT));
« no previous file with comments | « test/cctest/test-mementos.cc ('k') | test/cctest/test-symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698