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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 1463
1464 #undef SNAPSHOT_HEAP 1464 #undef SNAPSHOT_HEAP
1465 1465
1466 if (type == SnapshotType::FreelistSnapshot) 1466 if (type == SnapshotType::FreelistSnapshot)
1467 return; 1467 return;
1468 1468
1469 size_t totalLiveCount = 0; 1469 size_t totalLiveCount = 0;
1470 size_t totalDeadCount = 0; 1470 size_t totalDeadCount = 0;
1471 size_t totalLiveSize = 0; 1471 size_t totalLiveSize = 0;
1472 size_t totalDeadSize = 0; 1472 size_t totalDeadSize = 0;
1473 for (size_t i = 1; i <= GCInfoTable::gcInfoIndex(); ++i) { 1473 for (size_t gcInfoIndex = 1; gcInfoIndex <= GCInfoTable::gcInfoIndex(); ++gc InfoIndex) {
1474 String dumpName = classesDumpName + "/" + Heap::gcInfo(i)->className(); 1474 String dumpName = classesDumpName + String::format("/%zu_", gcInfoIndex) + Heap::gcInfo(gcInfoIndex)->className();
1475 WebMemoryAllocatorDump* classDump = BlinkGCMemoryDumpProvider::instance( )->createMemoryAllocatorDumpForCurrentGC(dumpName); 1475 WebMemoryAllocatorDump* classDump = BlinkGCMemoryDumpProvider::instance( )->createMemoryAllocatorDumpForCurrentGC(dumpName);
1476 classDump->AddScalar("live_count", "objects", info.liveCount[i]); 1476 classDump->AddScalar("live_count", "objects", info.liveCount[gcInfoIndex ]);
1477 classDump->AddScalar("dead_count", "objects", info.deadCount[i]); 1477 classDump->AddScalar("dead_count", "objects", info.deadCount[gcInfoIndex ]);
1478 classDump->AddScalar("live_size", "bytes", info.liveSize[i]); 1478 classDump->AddScalar("live_size", "bytes", info.liveSize[gcInfoIndex]);
1479 classDump->AddScalar("dead_size", "bytes", info.deadSize[i]); 1479 classDump->AddScalar("dead_size", "bytes", info.deadSize[gcInfoIndex]);
1480 1480
1481 totalLiveCount += info.liveCount[i]; 1481 totalLiveCount += info.liveCount[gcInfoIndex];
1482 totalDeadCount += info.deadCount[i]; 1482 totalDeadCount += info.deadCount[gcInfoIndex];
1483 totalLiveSize += info.liveSize[i]; 1483 totalLiveSize += info.liveSize[gcInfoIndex];
1484 totalDeadSize += info.deadSize[i]; 1484 totalDeadSize += info.deadSize[gcInfoIndex];
1485 } 1485 }
1486 1486
1487 WebMemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()-> createMemoryAllocatorDumpForCurrentGC(threadDumpName); 1487 WebMemoryAllocatorDump* threadDump = BlinkGCMemoryDumpProvider::instance()-> createMemoryAllocatorDumpForCurrentGC(threadDumpName);
1488 threadDump->AddScalar("live_count", "objects", totalLiveCount); 1488 threadDump->AddScalar("live_count", "objects", totalLiveCount);
1489 threadDump->AddScalar("dead_count", "objects", totalDeadCount); 1489 threadDump->AddScalar("dead_count", "objects", totalDeadCount);
1490 threadDump->AddScalar("live_size", "bytes", totalLiveSize); 1490 threadDump->AddScalar("live_size", "bytes", totalLiveSize);
1491 threadDump->AddScalar("dead_size", "bytes", totalDeadSize); 1491 threadDump->AddScalar("dead_size", "bytes", totalDeadSize);
1492 1492
1493 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); 1493 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName);
1494 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); 1494 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 json->beginArray(it->key.ascii().data()); 1585 json->beginArray(it->key.ascii().data());
1586 for (size_t age = 0; age <= maxHeapObjectAge; ++age) 1586 for (size_t age = 0; age <= maxHeapObjectAge; ++age)
1587 json->pushInteger(it->value.ages[age]); 1587 json->pushInteger(it->value.ages[age]);
1588 json->endArray(); 1588 json->endArray();
1589 } 1589 }
1590 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release()); 1590 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release());
1591 } 1591 }
1592 #endif 1592 #endif
1593 1593
1594 } // namespace blink 1594 } // namespace blink
OLDNEW
« 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