Chromium Code Reviews| Index: Source/platform/heap/ThreadState.cpp |
| diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
| index c47c92bac6ba45ffcd42d4f139cde1877a0bc354..d282411aa7c329d69e12f64eb57247f90ae3c3e8 100644 |
| --- a/Source/platform/heap/ThreadState.cpp |
| +++ b/Source/platform/heap/ThreadState.cpp |
| @@ -38,6 +38,8 @@ |
| #include "platform/heap/Heap.h" |
| #include "platform/heap/SafePoint.h" |
| #include "public/platform/Platform.h" |
| +#include "public/platform/WebMemoryAllocatorDump.h" |
| +#include "public/platform/WebProcessMemoryDump.h" |
|
Primiano Tucci (use gerrit)
2015/05/22 19:45:57
I think you don't need this anymore
ssid
2015/05/26 11:08:43
Done.
|
| #include "public/platform/WebScheduler.h" |
| #include "public/platform/WebThread.h" |
| #include "public/platform/WebTraceLocation.h" |
| @@ -379,6 +381,36 @@ void ThreadState::visitPersistents(Visitor* visitor) |
| } |
| } |
| +void ThreadState::dumpMemory() |
| +{ |
| +#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]->dumpMemory(allocatorBaseName); \ |
| + } |
| + |
| + SNAPSHOT_HEAP(NormalPage1); |
| + SNAPSHOT_HEAP(NormalPage2); |
| + SNAPSHOT_HEAP(NormalPage3); |
| + SNAPSHOT_HEAP(NormalPage4); |
| + 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) |
| const GCInfo* ThreadState::findGCInfo(Address address) |
| { |