Chromium Code Reviews| 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..2dccaa0d9fad80dde208efd247dc12218951d4f5 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; |
| @@ -228,7 +230,7 @@ ThreadHeap::ThreadHeap() |
| , m_markingStack(wrapUnique(new CallbackStack())) |
|
sof
2016/07/05 14:19:02
Let's add CallbackStack::create() ?
|
| , m_postMarkingCallbackStack(wrapUnique(new CallbackStack())) |
| , m_globalWeakCallbackStack(wrapUnique(new CallbackStack())) |
| - , m_ephemeronStack(wrapUnique(new CallbackStack(CallbackStack::kMinimalBlockSize))) |
| + , m_ephemeronStack(wrapUnique(new CallbackStack())) |
| { |
| 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 |