Merge WTFThreadData to Thread::current
https://bugs.webkit.org/show_bug.cgi?id=174716
Reviewed by Sam Weinig.
Source/JavaScriptCore:
Use Thread::current() instead.
(+[JSContext currentContext]):
(+[JSContext currentThis]):
(+[JSContext currentCallee]):
(+[JSContext currentArguments]):
(-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]):
(-[JSContext endCallbackWithData:]):
(JSC::Heap::requestCollection):
(JSC::checkSyntax):
(JSC::checkModuleSyntax):
(JSC::evaluate):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
(JSC::importModule):
(JSC::Identifier::checkCurrentAtomicStringTable):
- runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
(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):
(JSC::VM::isSafeToRecurse const):
- runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
(JSC::VM::ensureStackCapacityFor):
(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::initializeCurrent):
(WTF::ThreadHolder::ThreadHolder):
(WTF::ThreadHolder::currentMayBeNull):
(WTF::ThreadHolder::current):
- wtf/ThreadHolderPthreads.cpp:
(WTF::ThreadHolder::initialize):
(WTF::ThreadHolder::destruct):
(WTF::ThreadHolder::current): Deleted.
(WTF::ThreadHolder::currentDying):
(WTF::ThreadHolder::initialize):
(WTF::ThreadHolder::current): Deleted.
(WTF::Thread::initializeInThread):
(WTF::Thread::entryPoint):
(WTF::Thread::didExit):
(WTF::initializeThreading):
(WTF::Thread::currentMayBeNull): Deleted.
(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::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: