| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 , m_vectorBackingHeapIndex(BlinkGC::Vector1HeapIndex) | 97 , m_vectorBackingHeapIndex(BlinkGC::Vector1HeapIndex) |
| 98 , m_currentHeapAges(0) | 98 , m_currentHeapAges(0) |
| 99 , m_isTerminating(false) | 99 , m_isTerminating(false) |
| 100 , m_gcMixinMarker(nullptr) | 100 , m_gcMixinMarker(nullptr) |
| 101 , m_shouldFlushHeapDoesNotContainCache(false) | 101 , m_shouldFlushHeapDoesNotContainCache(false) |
| 102 , m_gcState(NoGCScheduled) | 102 , m_gcState(NoGCScheduled) |
| 103 , m_traceDOMWrappers(nullptr) | 103 , m_traceDOMWrappers(nullptr) |
| 104 #if defined(ADDRESS_SANITIZER) | 104 #if defined(ADDRESS_SANITIZER) |
| 105 , m_asanFakeStack(__asan_get_current_fake_stack()) | 105 , m_asanFakeStack(__asan_get_current_fake_stack()) |
| 106 #endif | 106 #endif |
| 107 #if defined(LEAK_SANITIZER) | |
| 108 , m_disabledStaticPersistentsRegistration(0) | |
| 109 #endif | |
| 110 { | 107 { |
| 111 ASSERT(checkThread()); | 108 ASSERT(checkThread()); |
| 112 ASSERT(!**s_threadSpecific); | 109 ASSERT(!**s_threadSpecific); |
| 113 **s_threadSpecific = this; | 110 **s_threadSpecific = this; |
| 114 | 111 |
| 115 if (isMainThread()) { | 112 if (isMainThread()) { |
| 116 s_mainThreadStackStart = reinterpret_cast<uintptr_t>(m_startOfStack) - s
izeof(void*); | 113 s_mainThreadStackStart = reinterpret_cast<uintptr_t>(m_startOfStack) - s
izeof(void*); |
| 117 size_t underestimatedStackSize = StackFrameDepth::getUnderestimatedStack
Size(); | 114 size_t underestimatedStackSize = StackFrameDepth::getUnderestimatedStack
Size(); |
| 118 if (underestimatedStackSize > sizeof(void*)) | 115 if (underestimatedStackSize > sizeof(void*)) |
| 119 s_mainThreadUnderestimatedStackSize = underestimatedStackSize - size
of(void*); | 116 s_mainThreadUnderestimatedStackSize = underestimatedStackSize - size
of(void*); |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 ASSERT(checkThread()); | 1310 ASSERT(checkThread()); |
| 1314 SafePointScope scope(BlinkGC::HeapPointersOnStack); | 1311 SafePointScope scope(BlinkGC::HeapPointersOnStack); |
| 1315 { | 1312 { |
| 1316 MutexLocker locker(threadAttachMutex()); | 1313 MutexLocker locker(threadAttachMutex()); |
| 1317 size_t index = m_interruptors.find(interruptor); | 1314 size_t index = m_interruptors.find(interruptor); |
| 1318 RELEASE_ASSERT(index != kNotFound); | 1315 RELEASE_ASSERT(index != kNotFound); |
| 1319 m_interruptors.remove(index); | 1316 m_interruptors.remove(index); |
| 1320 } | 1317 } |
| 1321 } | 1318 } |
| 1322 | 1319 |
| 1323 #if defined(LEAK_SANITIZER) | |
| 1324 void ThreadState::registerStaticPersistentNode(PersistentNode* node) | |
| 1325 { | |
| 1326 if (m_disabledStaticPersistentsRegistration) | |
| 1327 return; | |
| 1328 | |
| 1329 ASSERT(!m_staticPersistents.contains(node)); | |
| 1330 m_staticPersistents.add(node); | |
| 1331 } | |
| 1332 | |
| 1333 void ThreadState::releaseStaticPersistentNodes() | |
| 1334 { | |
| 1335 for (PersistentNode* node : m_staticPersistents) | |
| 1336 persistentRegion()->freePersistentNode(node); | |
| 1337 | |
| 1338 m_staticPersistents.clear(); | |
| 1339 } | |
| 1340 | |
| 1341 void ThreadState::enterStaticReferenceRegistrationDisabledScope() | |
| 1342 { | |
| 1343 m_disabledStaticPersistentsRegistration++; | |
| 1344 } | |
| 1345 | |
| 1346 void ThreadState::leaveStaticReferenceRegistrationDisabledScope() | |
| 1347 { | |
| 1348 ASSERT(m_disabledStaticPersistentsRegistration); | |
| 1349 m_disabledStaticPersistentsRegistration--; | |
| 1350 } | |
| 1351 #endif | |
| 1352 | |
| 1353 ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads() | 1320 ThreadState::AttachedThreadStateSet& ThreadState::attachedThreads() |
| 1354 { | 1321 { |
| 1355 DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ()); | 1322 DEFINE_STATIC_LOCAL(AttachedThreadStateSet, threads, ()); |
| 1356 return threads; | 1323 return threads; |
| 1357 } | 1324 } |
| 1358 | 1325 |
| 1359 void ThreadState::lockThreadAttachMutex() | 1326 void ThreadState::lockThreadAttachMutex() |
| 1360 { | 1327 { |
| 1361 threadAttachMutex().lock(); | 1328 threadAttachMutex().lock(); |
| 1362 } | 1329 } |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1483 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1517 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1484 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1518 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1485 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1519 | 1486 |
| 1520 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1487 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c
reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1521 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1488 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()-
>createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1522 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); | 1489 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners
hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1523 } | 1490 } |
| 1524 | 1491 |
| 1525 } // namespace blink | 1492 } // namespace blink |
| OLD | NEW |