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

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

Issue 2625293002: Remove ThreadHeapMode (Closed)
Patch Set: Created 3 years, 11 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/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index fa04eda6ea2814d6d4ea93f8e6ccceb6981c6e72..e9bef27aff5f8c4fc9d2ebfa00cb9d6d571599b7 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -139,7 +139,7 @@ class ParkThreadsScope final {
bool m_shouldResumeThreads;
};
-ThreadState::ThreadState(BlinkGC::ThreadHeapMode threadHeapMode)
+ThreadState::ThreadState()
: m_thread(currentThread()),
m_persistentRegion(WTF::makeUnique<PersistentRegion>()),
#if OS(WIN) && COMPILER(MSVC)
@@ -159,7 +159,6 @@ ThreadState::ThreadState(BlinkGC::ThreadHeapMode threadHeapMode)
m_accumulatedSweepingTime(0),
m_vectorBackingArenaIndex(BlinkGC::Vector1ArenaIndex),
m_currentArenaAges(0),
- m_threadHeapMode(threadHeapMode),
m_isTerminating(false),
m_gcMixinMarker(nullptr),
m_shouldFlushHeapDoesNotContainCache(false),
@@ -181,25 +180,17 @@ ThreadState::ThreadState(BlinkGC::ThreadHeapMode threadHeapMode)
ASSERT(!**s_threadSpecific);
**s_threadSpecific = this;
- switch (m_threadHeapMode) {
- case BlinkGC::MainThreadHeapMode:
- if (isMainThread()) {
- s_mainThreadStackStart =
- reinterpret_cast<uintptr_t>(m_startOfStack) - sizeof(void*);
- size_t underestimatedStackSize =
- StackFrameDepth::getUnderestimatedStackSize();
- if (underestimatedStackSize > sizeof(void*))
- s_mainThreadUnderestimatedStackSize =
- underestimatedStackSize - sizeof(void*);
- m_heap = new ThreadHeap();
- } else {
- m_heap = &ThreadState::mainThreadState()->heap();
- }
- break;
- case BlinkGC::PerThreadHeapMode:
- m_heap = new ThreadHeap();
- break;
+ if (isMainThread()) {
+ s_mainThreadStackStart =
+ reinterpret_cast<uintptr_t>(m_startOfStack) - sizeof(void*);
+ size_t underestimatedStackSize =
+ StackFrameDepth::getUnderestimatedStackSize();
+ if (underestimatedStackSize > sizeof(void*)) {
+ s_mainThreadUnderestimatedStackSize =
+ underestimatedStackSize - sizeof(void*);
+ }
}
+ m_heap = new ThreadHeap();
ASSERT(m_heap);
m_heap->attach(this);
sof 2017/01/12 08:29:30 It is possible to now also consider simplifying Th
keishi 2017/01/12 08:31:40 I am working on that next.
@@ -265,12 +256,12 @@ size_t ThreadState::threadStackSize() {
void ThreadState::attachMainThread() {
RELEASE_ASSERT(!ProcessHeap::s_shutdownComplete);
s_threadSpecific = new WTF::ThreadSpecific<ThreadState*>();
- new (s_mainThreadStateStorage) ThreadState(BlinkGC::MainThreadHeapMode);
+ new (s_mainThreadStateStorage) ThreadState();
}
-void ThreadState::attachCurrentThread(BlinkGC::ThreadHeapMode threadHeapMode) {
+void ThreadState::attachCurrentThread() {
RELEASE_ASSERT(!ProcessHeap::s_shutdownComplete);
- new ThreadState(threadHeapMode);
+ new ThreadState();
}
void ThreadState::cleanupPages() {

Powered by Google App Engine
This is Rietveld 408576698