Chromium Code Reviews| Index: Source/platform/heap/ThreadState.cpp |
| diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
| index 0f9ad60c7a86af4e5bbdbb5d69f936234ae0bcf6..0b9fc38ef4610ca7c3bd1544e5056499b11e0673 100644 |
| --- a/Source/platform/heap/ThreadState.cpp |
| +++ b/Source/platform/heap/ThreadState.cpp |
| @@ -110,10 +110,6 @@ static void* getStackStart() |
| #endif |
| } |
| -// The maximum number of WrapperPersistentRegions to keep around in the |
| -// m_pooledWrapperPersistentRegions pool. |
| -static const size_t MaxPooledWrapperPersistentRegionCount = 2; |
| - |
| WTF::ThreadSpecific<ThreadState*>* ThreadState::s_threadSpecific = 0; |
| uint8_t ThreadState::s_mainThreadStateStorage[sizeof(ThreadState)]; |
| SafePointBarrier* ThreadState::s_safePointBarrier = 0; |
| @@ -299,9 +295,6 @@ template<> struct InitializeHeaps<0> { |
| ThreadState::ThreadState() |
| : m_thread(currentThread()) |
| - , m_liveWrapperPersistents(new WrapperPersistentRegion()) |
| - , m_pooledWrapperPersistents(0) |
| - , m_pooledWrapperPersistentRegionCount(0) |
| , m_persistents(adoptPtr(new PersistentAnchor())) |
| , m_startOfStack(reinterpret_cast<intptr_t*>(getStackStart())) |
| , m_endOfStack(reinterpret_cast<intptr_t*>(getStackStart())) |
| @@ -318,6 +311,7 @@ ThreadState::ThreadState() |
| , m_shouldFlushHeapDoesNotContainCache(false) |
| , m_lowCollectionRate(false) |
| , m_numberOfSweeperTasks(0) |
| + , m_traceDOMWrappers(0) |
|
tkent
2014/10/15 03:48:35
nit: We can use |nullptr|.
|
| #if defined(ADDRESS_SANITIZER) |
| , m_asanFakeStack(__asan_get_current_fake_stack()) |
| #endif |
| @@ -341,14 +335,6 @@ ThreadState::~ThreadState() |
| for (int i = 0; i < NumberOfHeaps; i++) |
| delete m_heaps[i]; |
| deleteAllValues(m_interruptors); |
| - while (m_liveWrapperPersistents) { |
| - WrapperPersistentRegion* region = WrapperPersistentRegion::removeHead(&m_liveWrapperPersistents); |
| - delete region; |
| - } |
| - while (m_pooledWrapperPersistents) { |
| - WrapperPersistentRegion* region = WrapperPersistentRegion::removeHead(&m_pooledWrapperPersistents); |
| - delete region; |
| - } |
| **s_threadSpecific = 0; |
| } |
| @@ -584,9 +570,9 @@ void ThreadState::visitStack(Visitor* visitor) |
| void ThreadState::visitPersistents(Visitor* visitor) |
| { |
| m_persistents->trace(visitor); |
| - { |
| - TRACE_EVENT0("blink_gc", "WrapperPersistentRegion::trace"); |
| - WrapperPersistentRegion::trace(m_liveWrapperPersistents, visitor); |
| + if (m_traceDOMWrappers) { |
| + TRACE_EVENT0("blink_gc", "V8GCController::traceDOMWrappers"); |
|
sof
2014/10/12 20:40:43
Push this down into V8GCController::traceDOMrapper
|
| + m_traceDOMWrappers(visitor); |
| } |
| } |
| @@ -695,34 +681,6 @@ bool ThreadState::popAndInvokeWeakPointerCallback(Visitor* visitor) |
| return false; |
| } |
| -WrapperPersistentRegion* ThreadState::takeWrapperPersistentRegion() |
| -{ |
| - WrapperPersistentRegion* region; |
| - if (m_pooledWrapperPersistentRegionCount) { |
| - region = WrapperPersistentRegion::removeHead(&m_pooledWrapperPersistents); |
| - m_pooledWrapperPersistentRegionCount--; |
| - } else { |
| - region = new WrapperPersistentRegion(); |
| - } |
| - ASSERT(region); |
| - WrapperPersistentRegion::insertHead(&m_liveWrapperPersistents, region); |
| - return region; |
| -} |
| - |
| -void ThreadState::freeWrapperPersistentRegion(WrapperPersistentRegion* region) |
| -{ |
| - if (!region->removeIfNotLast(&m_liveWrapperPersistents)) |
| - return; |
| - |
| - // Region was removed, ie. it was not the last region in the list. |
| - if (m_pooledWrapperPersistentRegionCount < MaxPooledWrapperPersistentRegionCount) { |
| - WrapperPersistentRegion::insertHead(&m_pooledWrapperPersistents, region); |
| - m_pooledWrapperPersistentRegionCount++; |
| - } else { |
| - delete region; |
| - } |
| -} |
| - |
| PersistentNode* ThreadState::globalRoots() |
| { |
| AtomicallyInitializedStatic(PersistentNode*, anchor = new PersistentAnchor); |