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

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

Issue 1303693005: Fix crash in tracing due to identical type names of blink gc objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | 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 3971b8206bada4336caa2e1b62f5e4394600ca45..e099cb51b46942f006899e56c39b8c1dc0df7e3d 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -1470,18 +1470,18 @@ void ThreadState::takeSnapshot(SnapshotType type)
size_t totalDeadCount = 0;
size_t totalLiveSize = 0;
size_t totalDeadSize = 0;
- for (size_t i = 1; i <= GCInfoTable::gcInfoIndex(); ++i) {
- String dumpName = classesDumpName + "/" + Heap::gcInfo(i)->className();
+ for (size_t gcInfoIndex = 1; gcInfoIndex <= GCInfoTable::gcInfoIndex(); ++gcInfoIndex) {
+ String dumpName = classesDumpName + String::format("/%zu_", gcInfoIndex) + Heap::gcInfo(gcInfoIndex)->className();
WebMemoryAllocatorDump* classDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName);
- classDump->AddScalar("live_count", "objects", info.liveCount[i]);
- classDump->AddScalar("dead_count", "objects", info.deadCount[i]);
- classDump->AddScalar("live_size", "bytes", info.liveSize[i]);
- classDump->AddScalar("dead_size", "bytes", info.deadSize[i]);
-
- totalLiveCount += info.liveCount[i];
- totalDeadCount += info.deadCount[i];
- totalLiveSize += info.liveSize[i];
- totalDeadSize += info.deadSize[i];
+ classDump->AddScalar("live_count", "objects", info.liveCount[gcInfoIndex]);
+ classDump->AddScalar("dead_count", "objects", info.deadCount[gcInfoIndex]);
+ classDump->AddScalar("live_size", "bytes", info.liveSize[gcInfoIndex]);
+ classDump->AddScalar("dead_size", "bytes", info.deadSize[gcInfoIndex]);
+
+ totalLiveCount += info.liveCount[gcInfoIndex];
+ totalDeadCount += info.deadCount[gcInfoIndex];
+ totalLiveSize += info.liveSize[gcInfoIndex];
+ totalDeadSize += info.deadSize[gcInfoIndex];
}
WebMemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(threadDumpName);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698