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

Unified Diff: Source/platform/heap/HeapTest.cpp

Issue 1159773004: Oilpan: Implement a GC to take a heap snapshot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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: Source/platform/heap/HeapTest.cpp
diff --git a/Source/platform/heap/HeapTest.cpp b/Source/platform/heap/HeapTest.cpp
index 84a55e4005878aa54cd4883c0d94fafd3a2fbfb6..137cf4f0ae20e08a03384cef6fa6281f5a27ea52 100644
--- a/Source/platform/heap/HeapTest.cpp
+++ b/Source/platform/heap/HeapTest.cpp
@@ -230,7 +230,7 @@ public:
{
m_state->checkThread();
if (LIKELY(ThreadState::stopThreads())) {
- Heap::preGC();
+ Heap::preGC(ThreadState::GCWithSweep);
m_parkedAllThreads = true;
}
}
@@ -517,11 +517,15 @@ protected:
}
if (gcCount < gcPerThread) {
+ // Taking snapshot shouldn't have any bad side effect.
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::TakeSnapshot, Heap::ForcedGC);
Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWithSweep, Heap::ForcedGC);
gcCount++;
atomicIncrement(&m_gcCount);
}
+ // Taking snapshot shouldn't have any bad side effect.
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::TakeSnapshot, Heap::ForcedGC);
Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWithSweep, Heap::ForcedGC);
EXPECT_EQ(wrapper->value(), 0x0bbac0de);
EXPECT_EQ((*globalPersistent)->value(), 0x0ed0cabb);

Powered by Google App Engine
This is Rietveld 408576698