| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 s_allocatedObjectSize = 0; | 165 s_allocatedObjectSize = 0; |
| 166 s_objectSizeAtLastGC = 0; | 166 s_objectSizeAtLastGC = 0; |
| 167 s_markedObjectSize = 0; | 167 s_markedObjectSize = 0; |
| 168 s_markedObjectSizeAtLastCompleteSweep = 0; | 168 s_markedObjectSizeAtLastCompleteSweep = 0; |
| 169 s_wrapperCount = 0; | 169 s_wrapperCount = 0; |
| 170 s_wrapperCountAtLastGC = 0; | 170 s_wrapperCountAtLastGC = 0; |
| 171 s_collectedWrapperCount = 0; | 171 s_collectedWrapperCount = 0; |
| 172 s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages(); | 172 s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages(); |
| 173 s_estimatedMarkingTimePerByte = 0.0; | 173 s_estimatedMarkingTimePerByte = 0.0; |
| 174 #if ENABLE(ASSERT) | 174 #if ENABLE(ASSERT) |
| 175 s_gcGeneration = 1; | 175 s_gcGeneration = gcGenerationStart; |
| 176 #endif | 176 #endif |
| 177 | 177 |
| 178 GCInfoTable::init(); | 178 GCInfoTable::init(); |
| 179 | 179 |
| 180 if (Platform::current() && Platform::current()->currentThread()) | 180 if (Platform::current() && Platform::current()->currentThread()) |
| 181 Platform::current()->registerMemoryDumpProvider(BlinkGCMemoryDumpProvide
r::instance(), "BlinkGC"); | 181 Platform::current()->registerMemoryDumpProvider(BlinkGCMemoryDumpProvide
r::instance(), "BlinkGC"); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void Heap::shutdown() | 184 void Heap::shutdown() |
| 185 { | 185 { |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 Platform::current()->histogramCustomCounts("BlinkGC.CollectGarbage", marking
TimeInMilliseconds, 0, 10 * 1000, 50); | 450 Platform::current()->histogramCustomCounts("BlinkGC.CollectGarbage", marking
TimeInMilliseconds, 0, 10 * 1000, 50); |
| 451 Platform::current()->histogramCustomCounts("BlinkGC.TotalObjectSpace", Heap:
:allocatedObjectSize() / 1024, 0, 4 * 1024 * 1024, 50); | 451 Platform::current()->histogramCustomCounts("BlinkGC.TotalObjectSpace", Heap:
:allocatedObjectSize() / 1024, 0, 4 * 1024 * 1024, 50); |
| 452 Platform::current()->histogramCustomCounts("BlinkGC.TotalAllocatedSpace", He
ap::allocatedSpace() / 1024, 0, 4 * 1024 * 1024, 50); | 452 Platform::current()->histogramCustomCounts("BlinkGC.TotalAllocatedSpace", He
ap::allocatedSpace() / 1024, 0, 4 * 1024 * 1024, 50); |
| 453 Platform::current()->histogramEnumeration("BlinkGC.GCReason", reason, BlinkG
C::NumberOfGCReason); | 453 Platform::current()->histogramEnumeration("BlinkGC.GCReason", reason, BlinkG
C::NumberOfGCReason); |
| 454 Heap::reportMemoryUsageHistogram(); | 454 Heap::reportMemoryUsageHistogram(); |
| 455 WTF::Partitions::reportMemoryUsageHistogram(); | 455 WTF::Partitions::reportMemoryUsageHistogram(); |
| 456 | 456 |
| 457 postGC(gcType); | 457 postGC(gcType); |
| 458 | 458 |
| 459 #if ENABLE(ASSERT) | 459 #if ENABLE(ASSERT) |
| 460 // 0 is used to figure non-assigned area, so avoid to use 0 in s_gcGeneratio
n. | 460 // 0 and 1 are used to figure specific states in gcGeneration. |
| 461 if (++s_gcGeneration == 0) { | 461 if (++s_gcGeneration == 0) { |
| 462 s_gcGeneration = 1; | 462 s_gcGeneration = gcGenerationStart; |
| 463 } | 463 } |
| 464 #endif | 464 #endif |
| 465 | 465 |
| 466 if (state->isMainThread()) | 466 if (state->isMainThread()) |
| 467 ScriptForbiddenScope::exit(); | 467 ScriptForbiddenScope::exit(); |
| 468 } | 468 } |
| 469 | 469 |
| 470 void Heap::collectGarbageForTerminatingThread(ThreadState* state) | 470 void Heap::collectGarbageForTerminatingThread(ThreadState* state) |
| 471 { | 471 { |
| 472 { | 472 { |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 size_t Heap::s_allocatedSpace = 0; | 765 size_t Heap::s_allocatedSpace = 0; |
| 766 size_t Heap::s_allocatedObjectSize = 0; | 766 size_t Heap::s_allocatedObjectSize = 0; |
| 767 size_t Heap::s_objectSizeAtLastGC = 0; | 767 size_t Heap::s_objectSizeAtLastGC = 0; |
| 768 size_t Heap::s_markedObjectSize = 0; | 768 size_t Heap::s_markedObjectSize = 0; |
| 769 size_t Heap::s_markedObjectSizeAtLastCompleteSweep = 0; | 769 size_t Heap::s_markedObjectSizeAtLastCompleteSweep = 0; |
| 770 size_t Heap::s_wrapperCount = 0; | 770 size_t Heap::s_wrapperCount = 0; |
| 771 size_t Heap::s_wrapperCountAtLastGC = 0; | 771 size_t Heap::s_wrapperCountAtLastGC = 0; |
| 772 size_t Heap::s_collectedWrapperCount = 0; | 772 size_t Heap::s_collectedWrapperCount = 0; |
| 773 size_t Heap::s_partitionAllocSizeAtLastGC = 0; | 773 size_t Heap::s_partitionAllocSizeAtLastGC = 0; |
| 774 double Heap::s_estimatedMarkingTimePerByte = 0.0; | 774 double Heap::s_estimatedMarkingTimePerByte = 0.0; |
| 775 #if ENABLE(ASSERT) | 775 uint32_t Heap::s_gcGeneration = gcGenerationUnchecked; |
| 776 uint16_t Heap::s_gcGeneration = 0; | |
| 777 #endif | |
| 778 | 776 |
| 779 } // namespace blink | 777 } // namespace blink |
| OLD | NEW |