Chromium Code Reviews| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 , m_noAllocationCount(0) | 94 , m_noAllocationCount(0) |
| 95 , m_gcForbiddenCount(0) | 95 , m_gcForbiddenCount(0) |
| 96 , m_accumulatedSweepingTime(0) | 96 , m_accumulatedSweepingTime(0) |
| 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 ENABLE(ASSERT) | |
| 105 , m_numberOfSelfRefs(0) | |
| 106 #endif | |
| 104 #if defined(ADDRESS_SANITIZER) | 107 #if defined(ADDRESS_SANITIZER) |
| 105 , m_asanFakeStack(__asan_get_current_fake_stack()) | 108 , m_asanFakeStack(__asan_get_current_fake_stack()) |
| 106 #endif | 109 #endif |
| 107 { | 110 { |
| 108 ASSERT(checkThread()); | 111 ASSERT(checkThread()); |
| 109 ASSERT(!**s_threadSpecific); | 112 ASSERT(!**s_threadSpecific); |
| 110 **s_threadSpecific = this; | 113 **s_threadSpecific = this; |
| 111 | 114 |
| 112 if (isMainThread()) { | 115 if (isMainThread()) { |
| 113 s_mainThreadStackStart = reinterpret_cast<uintptr_t>(m_startOfStack) - s izeof(void*); | 116 s_mainThreadStackStart = reinterpret_cast<uintptr_t>(m_startOfStack) - s izeof(void*); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 int oldCount = -1; | 283 int oldCount = -1; |
| 281 int currentCount = persistentRegion()->numberOfPersistents(); | 284 int currentCount = persistentRegion()->numberOfPersistents(); |
| 282 ASSERT(currentCount >= 0); | 285 ASSERT(currentCount >= 0); |
| 283 while (currentCount != oldCount) { | 286 while (currentCount != oldCount) { |
| 284 Heap::collectGarbageForTerminatingThread(this); | 287 Heap::collectGarbageForTerminatingThread(this); |
| 285 oldCount = currentCount; | 288 oldCount = currentCount; |
| 286 currentCount = persistentRegion()->numberOfPersistents(); | 289 currentCount = persistentRegion()->numberOfPersistents(); |
| 287 } | 290 } |
| 288 // We should not have any persistents left when getting to this point, | 291 // We should not have any persistents left when getting to this point, |
| 289 // if we have it is probably a bug so adding a debug ASSERT to catch thi s. | 292 // if we have it is probably a bug so adding a debug ASSERT to catch thi s. |
| 290 ASSERT(!currentCount); | 293 ASSERT(currentCount == m_numberOfSelfRefs); |
|
sof
2015/11/24 08:41:47
If this holds, tell the persistentRegion() to clea
| |
| 291 // All of pre-finalizers should be consumed. | 294 // All of pre-finalizers should be consumed. |
| 292 ASSERT(m_orderedPreFinalizers.isEmpty()); | 295 ASSERT(m_orderedPreFinalizers.isEmpty()); |
| 293 RELEASE_ASSERT(gcState() == NoGCScheduled); | 296 RELEASE_ASSERT(gcState() == NoGCScheduled); |
| 294 | 297 |
| 295 // Add pages to the orphaned page pool to ensure any global GCs from thi s point | 298 // Add pages to the orphaned page pool to ensure any global GCs from thi s point |
| 296 // on will not trace objects on this thread's heaps. | 299 // on will not trace objects on this thread's heaps. |
| 297 cleanupPages(); | 300 cleanupPages(); |
| 298 | 301 |
| 299 ASSERT(attachedThreads().contains(this)); | 302 ASSERT(attachedThreads().contains(this)); |
| 300 attachedThreads().remove(this); | 303 attachedThreads().remove(this); |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1483 threadDump->addScalar("dead_count", "objects", totalDeadCount); | 1486 threadDump->addScalar("dead_count", "objects", totalDeadCount); |
| 1484 threadDump->addScalar("live_size", "bytes", totalLiveSize); | 1487 threadDump->addScalar("live_size", "bytes", totalLiveSize); |
| 1485 threadDump->addScalar("dead_size", "bytes", totalDeadSize); | 1488 threadDump->addScalar("dead_size", "bytes", totalDeadSize); |
| 1486 | 1489 |
| 1487 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); | 1490 WebMemoryAllocatorDump* heapsDump = BlinkGCMemoryDumpProvider::instance()->c reateMemoryAllocatorDumpForCurrentGC(heapsDumpName); |
| 1488 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); | 1491 WebMemoryAllocatorDump* classesDump = BlinkGCMemoryDumpProvider::instance()- >createMemoryAllocatorDumpForCurrentGC(classesDumpName); |
| 1489 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); | 1492 BlinkGCMemoryDumpProvider::instance()->currentProcessMemoryDump()->addOwners hipEdge(classesDump->guid(), heapsDump->guid()); |
| 1490 } | 1493 } |
| 1491 | 1494 |
| 1492 } // namespace blink | 1495 } // namespace blink |
| OLD | NEW |