| 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 137daa4aa50d7907021466e8f70c0a75b474b94b..e1294ec308fb758f3ef5f6e26e3ba3df415c4253 100644
|
| --- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
|
| +++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
|
| @@ -73,7 +73,7 @@ uintptr_t ThreadState::s_mainThreadStackStart = 0;
|
| uintptr_t ThreadState::s_mainThreadUnderestimatedStackSize = 0;
|
| uint8_t ThreadState::s_mainThreadStateStorage[sizeof(ThreadState)];
|
|
|
| -ThreadState::ThreadState()
|
| +ThreadState::ThreadState(bool perThreadHeapEnabled)
|
| : m_thread(currentThread())
|
| , m_persistentRegion(adoptPtr(new PersistentRegion()))
|
| #if OS(WIN) && COMPILER(MSVC)
|
| @@ -90,6 +90,7 @@ ThreadState::ThreadState()
|
| , m_accumulatedSweepingTime(0)
|
| , m_vectorBackingArenaIndex(BlinkGC::Vector1ArenaIndex)
|
| , m_currentArenaAges(0)
|
| + , m_perThreadHeapEnabled(perThreadHeapEnabled)
|
| , m_isTerminating(false)
|
| , m_gcMixinMarker(nullptr)
|
| , m_shouldFlushHeapDoesNotContainCache(false)
|
| @@ -110,7 +111,12 @@ ThreadState::ThreadState()
|
| ASSERT(!**s_threadSpecific);
|
| **s_threadSpecific = this;
|
|
|
| - if (isMainThread()) {
|
| + // TODO(keishi) Remove when per thread heap is ready.
|
| + CHECK(!m_perThreadHeapEnabled);
|
| +
|
| + if (m_perThreadHeapEnabled) {
|
| + m_heap = new ThreadHeap();
|
| + } else if (isMainThread()) {
|
| s_mainThreadStackStart = reinterpret_cast<uintptr_t>(m_startOfStack) - sizeof(void*);
|
| size_t underestimatedStackSize = StackFrameDepth::getUnderestimatedStackSize();
|
| if (underestimatedStackSize > sizeof(void*))
|
| @@ -189,13 +195,13 @@ void ThreadState::attachMainThread()
|
| {
|
| RELEASE_ASSERT(!ProcessHeap::s_shutdownComplete);
|
| s_threadSpecific = new WTF::ThreadSpecific<ThreadState*>();
|
| - new (s_mainThreadStateStorage) ThreadState();
|
| + new (s_mainThreadStateStorage) ThreadState(false);
|
| }
|
|
|
| -void ThreadState::attachCurrentThread()
|
| +void ThreadState::attachCurrentThread(bool perThreadHeapEnabled)
|
| {
|
| RELEASE_ASSERT(!ProcessHeap::s_shutdownComplete);
|
| - new ThreadState();
|
| + new ThreadState(perThreadHeapEnabled);
|
| }
|
|
|
| void ThreadState::cleanupPages()
|
|
|