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

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

Issue 1200833008: Adding freelist statistics to blink gc dump provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@oilpan_n2
Patch Set: Nits. Created 5 years, 6 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
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.cpp
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp
index 106c1c799bf7e811ad60b8e75f08e6a7595ae6a6..4cfc974c5ff7e034bebc0f62884121dde973c3b1 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -959,11 +959,13 @@ void ThreadState::postGC(GCType gcType)
} else if (gcType == GCWithoutSweep) {
setGCState(LazySweepScheduled);
} else {
- takeSnapshot();
+ takeSnapshot(SnapshotType::HeapSnapshot);
// This unmarks all marked objects and marks all unmarked objects dead.
makeConsistentForMutator();
+ takeSnapshot(SnapshotType::FreelistSnapshot);
+
// Force setting NoGCScheduled to circumvent checkThread()
// in setGCState().
m_gcState = NoGCScheduled;
@@ -1373,7 +1375,7 @@ void ThreadState::promptlyFreed(size_t gcInfoIndex)
m_likelyToBePromptlyFreed[entryIndex] += 3;
}
-void ThreadState::takeSnapshot()
+void ThreadState::takeSnapshot(SnapshotType type)
{
ASSERT(isInGC());
@@ -1383,7 +1385,16 @@ void ThreadState::takeSnapshot()
numberOfHeapsReported++; \
String allocatorBaseName; \
allocatorBaseName = String::format("blink_gc/thread_%lu/heaps/" #HeapType, (unsigned long)(m_thread)); \
- m_heaps[HeapType##HeapIndex]->takeSnapshot(allocatorBaseName); \
+ switch (type) { \
+ case SnapshotType::HeapSnapshot: \
+ m_heaps[HeapType##HeapIndex]->takeSnapshot(allocatorBaseName); \
+ break; \
+ case SnapshotType::FreelistSnapshot: \
+ m_heaps[HeapType##HeapIndex]->takeFreelistSnapshot(allocatorBaseName); \
+ break; \
+ default: \
+ ASSERT_NOT_REACHED(); \
+ } \
}
SNAPSHOT_HEAP(NormalPage1);
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698