| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "platform/heap/ThreadState.h" | 31 #include "platform/heap/ThreadState.h" |
| 32 | 32 |
| 33 #include "base/trace_event/process_memory_dump.h" | 33 #include "base/trace_event/process_memory_dump.h" |
| 34 #include "platform/Histogram.h" | 34 #include "platform/Histogram.h" |
| 35 #include "platform/RuntimeEnabledFeatures.h" |
| 35 #include "platform/ScriptForbiddenScope.h" | 36 #include "platform/ScriptForbiddenScope.h" |
| 36 #include "platform/TraceEvent.h" | 37 #include "platform/TraceEvent.h" |
| 37 #include "platform/heap/BlinkGCMemoryDumpProvider.h" | 38 #include "platform/heap/BlinkGCMemoryDumpProvider.h" |
| 38 #include "platform/heap/CallbackStack.h" | 39 #include "platform/heap/CallbackStack.h" |
| 39 #include "platform/heap/Handle.h" | 40 #include "platform/heap/Handle.h" |
| 40 #include "platform/heap/Heap.h" | 41 #include "platform/heap/Heap.h" |
| 41 #include "platform/heap/SafePoint.h" | 42 #include "platform/heap/SafePoint.h" |
| 42 #include "platform/heap/Visitor.h" | 43 #include "platform/heap/Visitor.h" |
| 43 #include "platform/web_memory_allocator_dump.h" | 44 #include "platform/web_memory_allocator_dump.h" |
| 44 #include "platform/web_process_memory_dump.h" | 45 #include "platform/web_process_memory_dump.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 , m_accumulatedSweepingTime(0) | 92 , m_accumulatedSweepingTime(0) |
| 92 , m_vectorBackingArenaIndex(BlinkGC::Vector1ArenaIndex) | 93 , m_vectorBackingArenaIndex(BlinkGC::Vector1ArenaIndex) |
| 93 , m_currentArenaAges(0) | 94 , m_currentArenaAges(0) |
| 94 , m_perThreadHeapEnabled(perThreadHeapEnabled) | 95 , m_perThreadHeapEnabled(perThreadHeapEnabled) |
| 95 , m_isTerminating(false) | 96 , m_isTerminating(false) |
| 96 , m_gcMixinMarker(nullptr) | 97 , m_gcMixinMarker(nullptr) |
| 97 , m_shouldFlushHeapDoesNotContainCache(false) | 98 , m_shouldFlushHeapDoesNotContainCache(false) |
| 98 , m_gcState(NoGCScheduled) | 99 , m_gcState(NoGCScheduled) |
| 99 , m_isolate(nullptr) | 100 , m_isolate(nullptr) |
| 100 , m_traceDOMWrappers(nullptr) | 101 , m_traceDOMWrappers(nullptr) |
| 102 , m_invalidateDeadObjectsInWrappersMarkingDeque(nullptr) |
| 101 #if defined(ADDRESS_SANITIZER) | 103 #if defined(ADDRESS_SANITIZER) |
| 102 , m_asanFakeStack(__asan_get_current_fake_stack()) | 104 , m_asanFakeStack(__asan_get_current_fake_stack()) |
| 103 #endif | 105 #endif |
| 104 #if defined(LEAK_SANITIZER) | 106 #if defined(LEAK_SANITIZER) |
| 105 , m_disabledStaticPersistentsRegistration(0) | 107 , m_disabledStaticPersistentsRegistration(0) |
| 106 #endif | 108 #endif |
| 107 , m_allocatedObjectSize(0) | 109 , m_allocatedObjectSize(0) |
| 108 , m_markedObjectSize(0) | 110 , m_markedObjectSize(0) |
| 109 , m_reportedMemoryToV8(0) | 111 , m_reportedMemoryToV8(0) |
| 110 { | 112 { |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 // entries on its local weak callback stack when that later GC goes | 954 // entries on its local weak callback stack when that later GC goes |
| 953 // ahead. Clear out and invalidate the stack now, as the thread | 955 // ahead. Clear out and invalidate the stack now, as the thread |
| 954 // should only process callbacks that's found to be reachable by | 956 // should only process callbacks that's found to be reachable by |
| 955 // the latest GC, when it eventually gets to next perform | 957 // the latest GC, when it eventually gets to next perform |
| 956 // thread-local weak processing. | 958 // thread-local weak processing. |
| 957 m_threadLocalWeakCallbackStack->clear(); | 959 m_threadLocalWeakCallbackStack->clear(); |
| 958 } | 960 } |
| 959 | 961 |
| 960 void ThreadState::postGC(BlinkGC::GCType gcType) | 962 void ThreadState::postGC(BlinkGC::GCType gcType) |
| 961 { | 963 { |
| 964 if (RuntimeEnabledFeatures::traceWrappablesEnabled() |
| 965 && m_invalidateDeadObjectsInWrappersMarkingDeque) { |
| 966 m_invalidateDeadObjectsInWrappersMarkingDeque(m_isolate); |
| 967 } |
| 968 |
| 962 ASSERT(isInGC()); | 969 ASSERT(isInGC()); |
| 963 for (int i = 0; i < BlinkGC::NumberOfArenas; i++) | 970 for (int i = 0; i < BlinkGC::NumberOfArenas; i++) |
| 964 m_arenas[i]->prepareForSweep(); | 971 m_arenas[i]->prepareForSweep(); |
| 965 | 972 |
| 966 if (gcType == BlinkGC::GCWithSweep) { | 973 if (gcType == BlinkGC::GCWithSweep) { |
| 967 setGCState(EagerSweepScheduled); | 974 setGCState(EagerSweepScheduled); |
| 968 } else if (gcType == BlinkGC::GCWithoutSweep) { | 975 } else if (gcType == BlinkGC::GCWithoutSweep) { |
| 969 setGCState(LazySweepScheduled); | 976 setGCState(LazySweepScheduled); |
| 970 } else { | 977 } else { |
| 971 takeSnapshot(SnapshotType::HeapSnapshot); | 978 takeSnapshot(SnapshotType::HeapSnapshot); |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 threadDump->AddScalar("dead_count", "objects", totalDeadCount); | 1526 threadDump->AddScalar("dead_count", "objects", totalDeadCount); |
| 1520 threadDump->AddScalar("live_size", "bytes", totalLiveSize); | 1527 threadDump->AddScalar("live_size", "bytes", totalLiveSize); |
| 1521 threadDump->AddScalar("dead_size", "bytes", totalDeadSize); | 1528 threadDump->AddScalar("dead_size", "bytes", totalDeadSize); |
| 1522 | 1529 |
| 1523 base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvide
r::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1530 base::trace_event::MemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvide
r::instance()->createMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1524 base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvi
der::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1531 base::trace_event::MemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvi
der::instance()->createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1525 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1532 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->AddOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1526 } | 1533 } |
| 1527 | 1534 |
| 1528 } // namespace blink | 1535 } // namespace blink |
| OLD | NEW |