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

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: Rebase and replacing main thread with thread id. 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
« no previous file with comments | « Source/platform/heap/Heap.cpp ('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 73afe55fb9d405a2dd345e901dbcd85afe6609e6..106c1c799bf7e811ad60b8e75f08e6a7595ae6a6 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -1376,7 +1376,33 @@ void ThreadState::promptlyFreed(size_t gcInfoIndex)
void ThreadState::takeSnapshot()
{
ASSERT(isInGC());
- // TODO(ssid): Implement this.
+
+ int numberOfHeapsReported = 0;
+#define SNAPSHOT_HEAP(HeapType) \
+ { \
+ numberOfHeapsReported++; \
+ String allocatorBaseName; \
+ allocatorBaseName = String::format("blink_gc/thread_%lu/heaps/" #HeapType, (unsigned long)(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);
+
+ ASSERT(numberOfHeapsReported == NumberOfHeaps);
+
+#undef SNAPSHOT_HEAP
}
#if ENABLE(GC_PROFILING)
« no previous file with comments | « Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698