Ignore:
Timestamp:
Jul 31, 2017, 4:23:41 AM (8 years ago)
Author:
Yusuke Suzuki
Message:

Merge WTFThreadData to Thread::current
https://bugs.webkit.org/show_bug.cgi?id=174716

Reviewed by Sam Weinig.

Source/JavaScriptCore:

Use Thread::current() instead.

  • API/JSContext.mm:

(+[JSContext currentContext]):
(+[JSContext currentThis]):
(+[JSContext currentCallee]):
(+[JSContext currentArguments]):
(-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]):
(-[JSContext endCallbackWithData:]):

  • heap/Heap.cpp:

(JSC::Heap::requestCollection):

  • runtime/Completion.cpp:

(JSC::checkSyntax):
(JSC::checkModuleSyntax):
(JSC::evaluate):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
(JSC::importModule):

  • runtime/Identifier.cpp:

(JSC::Identifier::checkCurrentAtomicStringTable):

  • runtime/InitializeThreading.cpp:

(JSC::initializeThreading):

  • runtime/JSLock.cpp:

(JSC::JSLock::didAcquireLock):
(JSC::JSLock::willReleaseLock):
(JSC::JSLock::dropAllLocks):
(JSC::JSLock::grabAllLocks):

  • runtime/JSLock.h:
  • runtime/VM.cpp:

(JSC::VM::VM):
(JSC::VM::updateStackLimits):
(JSC::VM::committedStackByteCount):

  • runtime/VM.h:

(JSC::VM::isSafeToRecurse const):

  • runtime/VMEntryScope.cpp:

(JSC::VMEntryScope::VMEntryScope):

  • runtime/VMInlines.h:

(JSC::VM::ensureStackCapacityFor):

  • yarr/YarrPattern.cpp:

(JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const):

Source/WebCore:

Use Thread::current() instead.

  • fileapi/AsyncFileStream.cpp:
  • platform/ThreadGlobalData.cpp:

(WebCore::ThreadGlobalData::ThreadGlobalData):

  • platform/graphics/cocoa/WebCoreDecompressionSession.h:
  • platform/ios/wak/WebCoreThread.mm:

(StartWebThread):

  • workers/WorkerThread.cpp:

(WebCore::WorkerThread::workerThread):

Source/WTF:

We placed thread specific data in WTFThreadData previously. But now, we have a new good place
to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
before calling WTF::initializeThreading.

  • WTF.xcodeproj/project.pbxproj:
  • wtf/CMakeLists.txt:
  • wtf/LockAlgorithm.h:
  • wtf/LockAlgorithmInlines.h:
  • wtf/MainThread.h:
  • wtf/ParkingLot.cpp:
  • wtf/StackStats.cpp:

(WTF::StackStats::PerThreadStats::PerThreadStats):
(WTF::StackStats::CheckPoint::CheckPoint):
(WTF::StackStats::CheckPoint::~CheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):

  • wtf/ThreadHolder.cpp:

(WTF::ThreadHolder::initializeCurrent):

  • wtf/ThreadHolder.h:

(WTF::ThreadHolder::ThreadHolder):
(WTF::ThreadHolder::currentMayBeNull):
(WTF::ThreadHolder::current):

  • wtf/ThreadHolderPthreads.cpp:

(WTF::ThreadHolder::initialize):
(WTF::ThreadHolder::destruct):
(WTF::ThreadHolder::current): Deleted.

  • wtf/ThreadHolderWin.cpp:

(WTF::ThreadHolder::currentDying):
(WTF::ThreadHolder::initialize):
(WTF::ThreadHolder::current): Deleted.

  • wtf/Threading.cpp:

(WTF::Thread::initializeInThread):
(WTF::Thread::entryPoint):
(WTF::Thread::didExit):
(WTF::initializeThreading):
(WTF::Thread::currentMayBeNull): Deleted.

  • wtf/Threading.h:

(WTF::Thread::atomicStringTable):
(WTF::Thread::setCurrentAtomicStringTable):
(WTF::Thread::stackStats):
(WTF::Thread::savedStackPointerAtVMEntry):
(WTF::Thread::setSavedStackPointerAtVMEntry):
(WTF::Thread::savedLastStackTop):
(WTF::Thread::setSavedLastStackTop):
(WTF::Thread::current):

  • wtf/ThreadingPrimitives.h:
  • wtf/ThreadingPthreads.cpp:

(WTF::Thread::createCurrentThread):
(WTF::Thread::current): Deleted.

  • wtf/ThreadingWin.cpp:

(WTF::Thread::createCurrentThread):
(WTF::Thread::current): Deleted.

  • wtf/WTFThreadData.cpp: Removed.
  • wtf/WTFThreadData.h: Removed.
  • wtf/text/AtomicString.cpp:
  • wtf/text/AtomicStringImpl.cpp:

(WTF::stringTable):

  • wtf/text/AtomicStringTable.cpp:

(WTF::AtomicStringTable::create):

  • wtf/text/AtomicStringTable.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.