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

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

Issue 1149673002: Adding blink gc memory dump infrastructure for thread specific dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Making changes for forced GC. 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/ThreadState.cpp
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp
index b478a51002e467856f2553c6408948ab67046969..b725e1b7aa974a1d5e909ec550bc5b7fbfdc7975 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -878,6 +878,9 @@ void ThreadState::postGC(GCType gcType)
}
#endif
+ if (gcType == TakeSnapshot)
+ takeSnapshot();
+
for (int i = 0; i < NumberOfHeaps; i++)
m_heaps[i]->prepareForSweep();
@@ -886,7 +889,6 @@ void ThreadState::postGC(GCType gcType)
} else if (gcType == GCWithoutSweep) {
setGCState(LazySweepScheduled);
} else {
- takeSnapshot();
// This unmarks all marked objects and marks all unmarked objects dead.
makeConsistentForSweeping(gcType);
// Force setting NoGCScheduled to circumvent checkThread()
@@ -1280,7 +1282,34 @@ void ThreadState::promptlyFreed(size_t gcInfoIndex)
void ThreadState::takeSnapshot()
{
ASSERT(isInGC());
- // TODO(ssid): Implement this.
+
+#define SNAPSHOT_HEAP(HeapType) \
+ { \
+ String allocatorBaseName; \
+ if (isMainThread()) { \
+ allocatorBaseName = String("blink_gc/thread_main/heaps/" #HeapType); \
+ } \
+ else { \
+ allocatorBaseName = String::format("blink_gc/thread_%ld/heaps/" #HeapType, m_thread); \
+ } \
+ m_heaps[HeapType##HeapIndex]->takeSnapshot(allocatorBaseName); \
+ }
+
+ SNAPSHOT_HEAP(NormalPage1);
+ SNAPSHOT_HEAP(NormalPage2);
+ SNAPSHOT_HEAP(NormalPage3);
+ SNAPSHOT_HEAP(NormalPage4);
+ SNAPSHOT_HEAP(EagerSweep);
+ SNAPSHOT_HEAP(Vector1);
+ SNAPSHOT_HEAP(Vector2);
+ SNAPSHOT_HEAP(Vector3);
+ SNAPSHOT_HEAP(Vector4);
+ SNAPSHOT_HEAP(InlineVector);
+ SNAPSHOT_HEAP(HashTable);
+ SNAPSHOT_HEAP(LargeObject);
+ FOR_EACH_TYPED_HEAP(SNAPSHOT_HEAP);
+
+#undef SNAPSHOT_HEAP
}
#if ENABLE(GC_PROFILING)
« Source/platform/heap/BlinkGCMemoryDumpProvider.cpp ('K') | « Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698