Commit 9baa3762 authored by ssid@chromium.org's avatar ssid@chromium.org

Fix crash in tracing due to identical type names of blink gc objects.

The WTF_PRETTY_FUNCTION takes the name of the class using the typename
given by the compiler. This gives the base class name for all
sub-classes. To make the dump name unique the, gcInfoIndex is appended
to the object name.

BUG=521490

Review URL: https://codereview.chromium.org/1303693005

git-svn-id: svn://svn.chromium.org/blink/trunk@200975 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 631a1e65
...@@ -1468,18 +1468,18 @@ void ThreadState::takeSnapshot(SnapshotType type) ...@@ -1468,18 +1468,18 @@ void ThreadState::takeSnapshot(SnapshotType type)
size_t totalDeadCount = 0; size_t totalDeadCount = 0;
size_t totalLiveSize = 0; size_t totalLiveSize = 0;
size_t totalDeadSize = 0; size_t totalDeadSize = 0;
for (size_t i = 1; i <= GCInfoTable::gcInfoIndex(); ++i) { for (size_t gcInfoIndex = 1; gcInfoIndex <= GCInfoTable::gcInfoIndex(); ++gcInfoIndex) {
String dumpName = classesDumpName + "/" + Heap::gcInfo(i)->className(); String dumpName = classesDumpName + String::format("/%zu_", gcInfoIndex) + Heap::gcInfo(gcInfoIndex)->className();
WebMemoryAllocatorDump* classDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName); WebMemoryAllocatorDump* classDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName);
classDump->AddScalar("live_count", "objects", info.liveCount[i]); classDump->AddScalar("live_count", "objects", info.liveCount[gcInfoIndex]);
classDump->AddScalar("dead_count", "objects", info.deadCount[i]); classDump->AddScalar("dead_count", "objects", info.deadCount[gcInfoIndex]);
classDump->AddScalar("live_size", "bytes", info.liveSize[i]); classDump->AddScalar("live_size", "bytes", info.liveSize[gcInfoIndex]);
classDump->AddScalar("dead_size", "bytes", info.deadSize[i]); classDump->AddScalar("dead_size", "bytes", info.deadSize[gcInfoIndex]);
totalLiveCount += info.liveCount[i]; totalLiveCount += info.liveCount[gcInfoIndex];
totalDeadCount += info.deadCount[i]; totalDeadCount += info.deadCount[gcInfoIndex];
totalLiveSize += info.liveSize[i]; totalLiveSize += info.liveSize[gcInfoIndex];
totalDeadSize += info.deadSize[i]; totalDeadSize += info.deadSize[gcInfoIndex];
} }
WebMemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(threadDumpName); WebMemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(threadDumpName);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment