| Index: Source/platform/heap/Heap.cpp
|
| diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp
|
| index c3c3eaddbfea5bb8fecfd098a1bce0840bbdaae0..c963e14bcebbdec15fffaf486e4d5323c29e2b57 100644
|
| --- a/Source/platform/heap/Heap.cpp
|
| +++ b/Source/platform/heap/Heap.cpp
|
| @@ -1962,18 +1962,10 @@ void Heap::flushHeapDoesNotContainCache()
|
| void Heap::init()
|
| {
|
| ThreadState::init();
|
| - s_markingStack = new CallbackStack();
|
| - s_postMarkingCallbackStack = new CallbackStack();
|
| - s_weakCallbackStack = new CallbackStack();
|
| - s_ephemeronStack = new CallbackStack();
|
| - s_heapDoesNotContainCache = new HeapDoesNotContainCache();
|
| s_markingVisitor = new MarkingVisitor<Visitor::GlobalMarking>();
|
| + s_heapDoesNotContainCache = new HeapDoesNotContainCache();
|
| s_freePagePool = new FreePagePool();
|
| s_orphanedPagePool = new OrphanedPagePool();
|
| - s_allocatedObjectSize = 0;
|
| - s_allocatedSpace = 0;
|
| - s_markedObjectSize = 0;
|
| - s_estimatedMarkingTimePerByte = 0.0;
|
|
|
| GCInfoTable::init();
|
| }
|
| @@ -2259,6 +2251,7 @@ void Heap::collectGarbage(ThreadState::StackState stackState, ThreadState::GCTyp
|
| ThreadState::NoAllocationScope noAllocationScope(state);
|
|
|
| preGC();
|
| + Heap::ensureCallbackStacks();
|
| StackFrameDepth::configureStackLimit();
|
| ASSERT(StackFrameDepth::isSafeToRecurse());
|
|
|
| @@ -2320,6 +2313,7 @@ void Heap::collectGarbageForTerminatingThread(ThreadState* state)
|
| ThreadState::NoAllocationScope noAllocationScope(state);
|
|
|
| state->preGC();
|
| + Heap::ensureCallbackStacks();
|
| StackFrameDepth::configureStackLimit();
|
| ASSERT(StackFrameDepth::isSafeToRecurse());
|
|
|
| @@ -2674,11 +2668,22 @@ void Heap::resetHeapCounters()
|
| s_externalObjectSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages();
|
| }
|
|
|
| +void Heap::ensureCallbackStacks()
|
| +{
|
| + if (s_markingStack)
|
| + return;
|
| +
|
| + s_markingStack = new CallbackStack(CallbackStack::MarkingStackBlockSize);
|
| + s_postMarkingCallbackStack = new CallbackStack(CallbackStack::PostMarkingStackBlockSize);
|
| + s_weakCallbackStack = new CallbackStack(CallbackStack::WeakCallbackStackBlockSize);
|
| + s_ephemeronStack = new CallbackStack(CallbackStack::EphemeronCallbackStackBlockSize);
|
| +}
|
| +
|
| Visitor* Heap::s_markingVisitor;
|
| -CallbackStack* Heap::s_markingStack;
|
| -CallbackStack* Heap::s_postMarkingCallbackStack;
|
| -CallbackStack* Heap::s_weakCallbackStack;
|
| -CallbackStack* Heap::s_ephemeronStack;
|
| +CallbackStack* Heap::s_markingStack = nullptr;
|
| +CallbackStack* Heap::s_postMarkingCallbackStack = nullptr;
|
| +CallbackStack* Heap::s_weakCallbackStack = nullptr;
|
| +CallbackStack* Heap::s_ephemeronStack = nullptr;
|
| HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache;
|
| bool Heap::s_shutdownCalled = false;
|
| bool Heap::s_lastGCWasConservative = false;
|
|
|