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

Unified Diff: third_party/WebKit/Source/platform/heap/Heap.cpp

Issue 2127453002: Oilpan: Introduce memory pool for CallbackStacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 5 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
Index: third_party/WebKit/Source/platform/heap/Heap.cpp
diff --git a/third_party/WebKit/Source/platform/heap/Heap.cpp b/third_party/WebKit/Source/platform/heap/Heap.cpp
index 4e2ead758d2efd9bba445133d98524b7024b06ee..c6710fdbc88360ee18830cd040fec0252571ae07 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp
@@ -117,6 +117,7 @@ void ProcessHeap::init()
s_isLowEndDevice = base::SysInfo::IsLowEndDevice();
GCInfoTable::init();
+ CallbackStackMemoryPool::instance().initialize();
}
void ProcessHeap::resetHeapCounters()
@@ -135,6 +136,7 @@ void ProcessHeap::shutdown()
RELEASE_ASSERT(ThreadHeap::allHeaps().isEmpty());
}
+ CallbackStackMemoryPool::instance().shutdown();
GCInfoTable::shutdown();
ASSERT(ProcessHeap::totalAllocatedSpace() == 0);
s_shutdownComplete = true;
@@ -225,10 +227,10 @@ ThreadHeap::ThreadHeap()
, m_safePointBarrier(wrapUnique(new SafePointBarrier()))
, m_freePagePool(wrapUnique(new FreePagePool))
, m_orphanedPagePool(wrapUnique(new OrphanedPagePool))
- , m_markingStack(wrapUnique(new CallbackStack()))
- , m_postMarkingCallbackStack(wrapUnique(new CallbackStack()))
- , m_globalWeakCallbackStack(wrapUnique(new CallbackStack()))
- , m_ephemeronStack(wrapUnique(new CallbackStack(CallbackStack::kMinimalBlockSize)))
+ , m_markingStack(CallbackStack::create())
+ , m_postMarkingCallbackStack(CallbackStack::create())
+ , m_globalWeakCallbackStack(CallbackStack::create())
+ , m_ephemeronStack(CallbackStack::create())
{
if (ThreadState::current()->isMainThread())
s_mainThreadHeap = this;
@@ -437,6 +439,14 @@ bool ThreadHeap::weakTableRegistered(const void* table)
}
#endif
+void ThreadHeap::commitCallbackStacks()
+{
+ m_markingStack->commit();
+ m_postMarkingCallbackStack->commit();
+ m_globalWeakCallbackStack->commit();
+ m_ephemeronStack->commit();
+}
+
void ThreadHeap::decommitCallbackStacks()
{
m_markingStack->decommit();
@@ -515,6 +525,7 @@ void ThreadHeap::collectGarbage(BlinkGC::StackState stackState, BlinkGC::GCType
// finalization that happens when the visitorScope is torn down).
ThreadState::NoAllocationScope noAllocationScope(state);
+ state->heap().commitCallbackStacks();
state->heap().preGC();
StackFrameDepthScope stackDepthScope;
@@ -586,6 +597,7 @@ void ThreadHeap::collectGarbageForTerminatingThread(ThreadState* state)
ThreadState::NoAllocationScope noAllocationScope(state);
+ state->heap().commitCallbackStacks();
state->preGC();
// 1. Trace the thread local persistent roots. For thread local GCs we
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698