| 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 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 1024); | 1024 1024); |
| 1025 DEFINE_STATIC_LOCAL(CustomCountHistogram, collectionRateHistogram, | 1025 DEFINE_STATIC_LOCAL(CustomCountHistogram, collectionRateHistogram, |
| 1026 ("BlinkGC.CollectionRate", 1, 100, 20)); | 1026 ("BlinkGC.CollectionRate", 1, 100, 20)); |
| 1027 collectionRateHistogram.count(static_cast<int>(100 * collectionRate)); | 1027 collectionRateHistogram.count(static_cast<int>(100 * collectionRate)); |
| 1028 DEFINE_STATIC_LOCAL( | 1028 DEFINE_STATIC_LOCAL( |
| 1029 CustomCountHistogram, timeForSweepHistogram, | 1029 CustomCountHistogram, timeForSweepHistogram, |
| 1030 ("BlinkGC.TimeForSweepingAllObjects", 1, 10 * 1000, 50)); | 1030 ("BlinkGC.TimeForSweepingAllObjects", 1, 10 * 1000, 50)); |
| 1031 timeForSweepHistogram.count(m_accumulatedSweepingTime); | 1031 timeForSweepHistogram.count(m_accumulatedSweepingTime); |
| 1032 | 1032 |
| 1033 #define COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(GCReason) \ | 1033 #define COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(GCReason) \ |
| 1034 case BlinkGC::GCReason: { \ | 1034 case BlinkGC::k##GCReason: { \ |
| 1035 DEFINE_STATIC_LOCAL(CustomCountHistogram, histogram, \ | 1035 DEFINE_STATIC_LOCAL(CustomCountHistogram, histogram, \ |
| 1036 ("BlinkGC.CollectionRate_" #GCReason, 1, 100, 20)); \ | 1036 ("BlinkGC.CollectionRate_" #GCReason, 1, 100, 20)); \ |
| 1037 histogram.count(static_cast<int>(100 * collectionRate)); \ | 1037 histogram.count(static_cast<int>(100 * collectionRate)); \ |
| 1038 break; \ | 1038 break; \ |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 switch (m_heap->lastGCReason()) { | 1041 switch (heap_->lastGCReason()) { |
| 1042 /* DO NOT SUBMIT - Conflict resolution helper: |
| 1043 * important to use IdleGC, rather than kIdleGC below - stringification */ |
| 1042 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(IdleGC) | 1044 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(IdleGC) |
| 1043 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(PreciseGC) | 1045 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(PreciseGC) |
| 1044 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(ConservativeGC) | 1046 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(ConservativeGC) |
| 1045 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(ForcedGC) | 1047 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(ForcedGC) |
| 1046 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(MemoryPressureGC) | 1048 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(MemoryPressureGC) |
| 1047 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(PageNavigationGC) | 1049 COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(PageNavigationGC) |
| 1050 /* DO NOT SUBMIT - Conflict resolution helper: |
| 1051 * important to use IdleGC, rather than kIdleGC above - stringification */ |
| 1048 default: | 1052 default: |
| 1049 break; | 1053 break; |
| 1050 } | 1054 } |
| 1051 } | 1055 } |
| 1052 | 1056 |
| 1053 switch (gcState()) { | 1057 switch (gcState()) { |
| 1054 case Sweeping: | 1058 case Sweeping: |
| 1055 setGCState(NoGCScheduled); | 1059 setGCState(NoGCScheduled); |
| 1056 break; | 1060 break; |
| 1057 case SweepingAndPreciseGCScheduled: | 1061 case SweepingAndPreciseGCScheduled: |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1349 String threadDumpName = String::format("blink_gc/thread_%lu", | 1353 String threadDumpName = String::format("blink_gc/thread_%lu", |
| 1350 static_cast<unsigned long>(m_thread)); | 1354 static_cast<unsigned long>(m_thread)); |
| 1351 const String heapsDumpName = threadDumpName + "/heaps"; | 1355 const String heapsDumpName = threadDumpName + "/heaps"; |
| 1352 const String classesDumpName = threadDumpName + "/classes"; | 1356 const String classesDumpName = threadDumpName + "/classes"; |
| 1353 | 1357 |
| 1354 int numberOfHeapsReported = 0; | 1358 int numberOfHeapsReported = 0; |
| 1355 #define SNAPSHOT_HEAP(ArenaType) \ | 1359 #define SNAPSHOT_HEAP(ArenaType) \ |
| 1356 { \ | 1360 { \ |
| 1357 numberOfHeapsReported++; \ | 1361 numberOfHeapsReported++; \ |
| 1358 switch (type) { \ | 1362 switch (type) { \ |
| 1359 case SnapshotType::HeapSnapshot: \ | 1363 case SnapshotType::kHeapSnapshot: \ |
| 1360 m_arenas[BlinkGC::ArenaType##ArenaIndex]->takeSnapshot( \ | 1364 arenas_[BlinkGC::k##ArenaType##ArenaIndex]->TakeSnapshot( \ |
| 1361 heapsDumpName + "/" #ArenaType, info); \ | 1365 heaps_dump_name + "/" #ArenaType, info); \ |
| 1362 break; \ | 1366 break; \ |
| 1363 case SnapshotType::FreelistSnapshot: \ | 1367 case SnapshotType::kFreelistSnapshot: \ |
| 1364 m_arenas[BlinkGC::ArenaType##ArenaIndex]->takeFreelistSnapshot( \ | 1368 arenas_[BlinkGC::k##ArenaType##ArenaIndex]->TakeFreelistSnapshot( \ |
| 1365 heapsDumpName + "/" #ArenaType); \ | 1369 heaps_dump_name + "/" #ArenaType); \ |
| 1366 break; \ | 1370 break; \ |
| 1367 default: \ | 1371 default: \ |
| 1368 ASSERT_NOT_REACHED(); \ | 1372 ASSERT_NOT_REACHED(); \ |
| 1369 } \ | 1373 } \ |
| 1370 } | 1374 } |
| 1371 | 1375 |
| 1376 /* DO NOT SUBMIT - Conflict resolution helper: |
| 1377 * Important to use NormalPage instead of kNormalPage1 below */ |
| 1372 SNAPSHOT_HEAP(NormalPage1); | 1378 SNAPSHOT_HEAP(NormalPage1); |
| 1373 SNAPSHOT_HEAP(NormalPage2); | 1379 SNAPSHOT_HEAP(NormalPage2); |
| 1374 SNAPSHOT_HEAP(NormalPage3); | 1380 SNAPSHOT_HEAP(NormalPage3); |
| 1375 SNAPSHOT_HEAP(NormalPage4); | 1381 SNAPSHOT_HEAP(NormalPage4); |
| 1376 SNAPSHOT_HEAP(EagerSweep); | 1382 SNAPSHOT_HEAP(EagerSweep); |
| 1377 SNAPSHOT_HEAP(Vector1); | 1383 SNAPSHOT_HEAP(Vector1); |
| 1378 SNAPSHOT_HEAP(Vector2); | 1384 SNAPSHOT_HEAP(Vector2); |
| 1379 SNAPSHOT_HEAP(Vector3); | 1385 SNAPSHOT_HEAP(Vector3); |
| 1380 SNAPSHOT_HEAP(Vector4); | 1386 SNAPSHOT_HEAP(Vector4); |
| 1381 SNAPSHOT_HEAP(InlineVector); | 1387 SNAPSHOT_HEAP(InlineVector); |
| 1382 SNAPSHOT_HEAP(HashTable); | 1388 SNAPSHOT_HEAP(HashTable); |
| 1383 SNAPSHOT_HEAP(LargeObject); | 1389 SNAPSHOT_HEAP(LargeObject); |
| 1390 /* DO NOT SUBMIT - Conflict resolution helper: |
| 1391 * Important to use LargeObject instead of kLargeObject above */ |
| 1384 FOR_EACH_TYPED_ARENA(SNAPSHOT_HEAP); | 1392 FOR_EACH_TYPED_ARENA(SNAPSHOT_HEAP); |
| 1385 | 1393 |
| 1386 ASSERT(numberOfHeapsReported == BlinkGC::NumberOfArenas); | 1394 ASSERT(numberOfHeapsReported == BlinkGC::NumberOfArenas); |
| 1387 | 1395 |
| 1388 #undef SNAPSHOT_HEAP | 1396 #undef SNAPSHOT_HEAP |
| 1389 | 1397 |
| 1390 if (type == SnapshotType::FreelistSnapshot) | 1398 if (type == SnapshotType::FreelistSnapshot) |
| 1391 return; | 1399 return; |
| 1392 | 1400 |
| 1393 size_t totalLiveCount = 0; | 1401 size_t totalLiveCount = 0; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1548 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, | 1556 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, |
| 1549 BlinkGC::ForcedGC); | 1557 BlinkGC::ForcedGC); |
| 1550 size_t liveObjects = heap().heapStats().markedObjectSize(); | 1558 size_t liveObjects = heap().heapStats().markedObjectSize(); |
| 1551 if (liveObjects == previousLiveObjects) | 1559 if (liveObjects == previousLiveObjects) |
| 1552 break; | 1560 break; |
| 1553 previousLiveObjects = liveObjects; | 1561 previousLiveObjects = liveObjects; |
| 1554 } | 1562 } |
| 1555 } | 1563 } |
| 1556 | 1564 |
| 1557 } // namespace blink | 1565 } // namespace blink |
| OLD | NEW |