Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2299)

Unified Diff: Source/platform/heap/ThreadState.cpp

Issue 651713002: Oilpan: DOM wrappers don't need to keep persistent handles (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/heap/ThreadState.h ('k') | Source/platform/heap/blink_heap.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « Source/platform/heap/ThreadState.h ('k') | Source/platform/heap/blink_heap.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698