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

Unified Diff: third_party/WebKit/Source/platform/heap/ThreadState.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
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index 4b975f7563be186de4180620a0a86bc2c6d30bfa..c7a798884f0095e4f71af5433040b9c8a543db31 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -98,6 +98,7 @@ ThreadState::ThreadState(bool perThreadHeapEnabled)
, m_gcMixinMarker(nullptr)
, m_shouldFlushHeapDoesNotContainCache(false)
, m_gcState(NoGCScheduled)
+ , m_threadLocalWeakCallbackStack(CallbackStack::create())
, m_isolate(nullptr)
, m_traceDOMWrappers(nullptr)
, m_invalidateDeadObjectsInWrappersMarkingDeque(nullptr)
@@ -135,18 +136,11 @@ ThreadState::ThreadState(bool perThreadHeapEnabled)
m_likelyToBePromptlyFreed = wrapArrayUnique(new int[likelyToBePromptlyFreedArraySize]);
clearArenaAges();
-
- // There is little use of weak references and collections off the main thread;
- // use a much lower initial block reservation.
- size_t initialBlockSize = isMainThread() ? CallbackStack::kDefaultBlockSize : CallbackStack::kMinimalBlockSize;
- m_threadLocalWeakCallbackStack = new CallbackStack(initialBlockSize);
}
ThreadState::~ThreadState()
{
ASSERT(checkThread());
- delete m_threadLocalWeakCallbackStack;
- m_threadLocalWeakCallbackStack = nullptr;
for (int i = 0; i < BlinkGC::NumberOfArenas; ++i)
delete m_arenas[i];
@@ -963,7 +957,8 @@ void ThreadState::preGC()
// should only process callbacks that's found to be reachable by
// the latest GC, when it eventually gets to next perform
// thread-local weak processing.
- m_threadLocalWeakCallbackStack->clear();
+ m_threadLocalWeakCallbackStack->decommit();
+ m_threadLocalWeakCallbackStack->commit();
}
void ThreadState::postGC(BlinkGC::GCType gcType)
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698