| OLD | NEW |
| 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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 ScriptForbiddenScope::enter(); | 1107 ScriptForbiddenScope::enter(); |
| 1108 | 1108 |
| 1109 TRACE_EVENT0("blink_gc", "ThreadState::completeSweep"); | 1109 TRACE_EVENT0("blink_gc", "ThreadState::completeSweep"); |
| 1110 double startTime = WTF::currentTimeMS(); | 1110 double startTime = WTF::currentTimeMS(); |
| 1111 | 1111 |
| 1112 static_assert(BlinkGC::EagerSweepHeapIndex == 0, "Eagerly swept heaps mu
st be processed first."); | 1112 static_assert(BlinkGC::EagerSweepHeapIndex == 0, "Eagerly swept heaps mu
st be processed first."); |
| 1113 for (int i = 0; i < BlinkGC::NumberOfHeaps; i++) | 1113 for (int i = 0; i < BlinkGC::NumberOfHeaps; i++) |
| 1114 m_heaps[i]->completeSweep(); | 1114 m_heaps[i]->completeSweep(); |
| 1115 | 1115 |
| 1116 double timeForCompleteSweep = WTF::currentTimeMS() - startTime; | 1116 double timeForCompleteSweep = WTF::currentTimeMS() - startTime; |
| 1117 Platform::current()->histogramCustomCounts("BlinkGC.CompleteSweep", time
ForCompleteSweep, 0, 10 * 1000, 50); | |
| 1118 accumulateSweepingTime(timeForCompleteSweep); | 1117 accumulateSweepingTime(timeForCompleteSweep); |
| 1119 | 1118 |
| 1120 if (isMainThread()) | 1119 if (isMainThread()) { |
| 1121 ScriptForbiddenScope::exit(); | 1120 ScriptForbiddenScope::exit(); |
| 1121 Platform::current()->histogramCustomCounts("BlinkGC.CompleteSweep",
timeForCompleteSweep, 1, 10 * 1000, 50); |
| 1122 } |
| 1122 } | 1123 } |
| 1123 | 1124 |
| 1124 postSweep(); | 1125 postSweep(); |
| 1125 } | 1126 } |
| 1126 | 1127 |
| 1127 void ThreadState::postSweep() | 1128 void ThreadState::postSweep() |
| 1128 { | 1129 { |
| 1129 ASSERT(checkThread()); | 1130 ASSERT(checkThread()); |
| 1130 Heap::reportMemoryUsageForTracing(); | 1131 Heap::reportMemoryUsageForTracing(); |
| 1131 | 1132 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1483 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1483 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1484 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1484 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1485 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1485 | 1486 |
| 1486 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1487 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1487 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1488 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1488 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1489 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1489 } | 1490 } |
| 1490 | 1491 |
| 1491 } // namespace blink | 1492 } // namespace blink |
| OLD | NEW |