Index: Source/platform/heap/ThreadState.cpp |
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
index a8528379ef8d18f4e9ee698beaed244cb4250ed0..60f6eca1fd0e166c6b6cb9ebf9d25e059b081568 100644 |
--- a/Source/platform/heap/ThreadState.cpp |
+++ b/Source/platform/heap/ThreadState.cpp |
@@ -134,10 +134,6 @@ static size_t getUnderestimatedStackSize() |
#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; |
uintptr_t ThreadState::s_mainThreadStackStart = 0; |
uintptr_t ThreadState::s_mainThreadUnderestimatedStackSize = 0; |
@@ -325,9 +321,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())) |
@@ -344,6 +337,7 @@ ThreadState::ThreadState() |
, m_shouldFlushHeapDoesNotContainCache(false) |
, m_lowCollectionRate(false) |
, m_numberOfSweeperTasks(0) |
+ , m_traceDOMWrappers(0) |
#if defined(ADDRESS_SANITIZER) |
, m_asanFakeStack(__asan_get_current_fake_stack()) |
#endif |
@@ -372,14 +366,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; |
s_mainThreadStackStart = 0; |
s_mainThreadUnderestimatedStackSize = 0; |
@@ -617,9 +603,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"); |
+ m_traceDOMWrappers(m_isolate, visitor); |
} |
} |
@@ -728,34 +714,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); |