[WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 May 2019 22:32:34 +0000 (22:32 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 May 2019 22:32:34 +0000 (22:32 +0000)
commit38d29d481ff9a9f1e6d3e0f80bd96d3ec4e4379c
treed6f35cbf0803ae74b8058bb1e85d6b95ea10a972
parent497a9dbc612a7de6482dcbfd1ec95b9569e584ea
[WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
https://bugs.webkit.org/show_bug.cgi?id=197146

Reviewed by Saam Barati.

Source/JavaScriptCore:

Rename Heap::Thread to Heap::HeapThread to remove conflict between WTF::Thread.

* heap/AlignedMemoryAllocator.cpp:
(JSC::AlignedMemoryAllocator::registerDirectory):
* heap/Heap.cpp:
(JSC::Heap::HeapThread::HeapThread):
(JSC::Heap::Heap):
(JSC::Heap::runCurrentPhase):
(JSC::Heap::runBeginPhase):
(JSC::Heap::resumeThePeriphery):
(JSC::Heap::requestCollection):
(JSC::Heap::isCurrentThreadBusy):
(JSC::Heap::notifyIsSafeToCollect):
(JSC::Heap::Thread::Thread): Deleted.
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::incrementDeferralDepth):
(JSC::Heap::decrementDeferralDepth):
(JSC::Heap::decrementDeferralDepthAndGCIfNeeded):
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::prepareForAllocation):

Source/WebCore:

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::hasPendingActivity const):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::hasPendingActivity const):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::hasPendingActivity const):

Source/WTF:

Since GCThread and CompilationThread flags exist in WTF, we put these flags into WTF::Thread directly instead of holding them in ThreadSpecific<>.
And this patch removes dependency from Threading.h to ThreadSpecific.h. ThreadSpecific.h's OS threading primitives are moved to ThreadingPrimitives.h,
and Threading.h relies on it instead.

* wtf/CompilationThread.cpp:
(WTF::isCompilationThread):
(WTF::initializeCompilationThreads): Deleted.
(WTF::exchangeIsCompilationThread): Deleted.
* wtf/CompilationThread.h:
(WTF::CompilationScope::CompilationScope):
(WTF::CompilationScope::~CompilationScope):
(WTF::CompilationScope::leaveEarly):
* wtf/MainThread.cpp:
(WTF::initializeMainThread):
(WTF::initializeMainThreadToProcessMainThread):
(WTF::isMainThreadOrGCThread):
(WTF::initializeGCThreads): Deleted.
(WTF::registerGCThread): Deleted.
(WTF::mayBeGCThread): Deleted.
* wtf/MainThread.h:
* wtf/ThreadSpecific.h:
(WTF::canBeGCThread>::ThreadSpecific):
(WTF::canBeGCThread>::set):
(WTF::threadSpecificKeyCreate): Deleted.
(WTF::threadSpecificKeyDelete): Deleted.
(WTF::threadSpecificSet): Deleted.
(WTF::threadSpecificGet): Deleted.
* wtf/Threading.cpp:
(WTF::Thread::exchangeIsCompilationThread):
(WTF::Thread::registerGCThread):
(WTF::Thread::mayBeGCThread):
* wtf/Threading.h:
(WTF::Thread::isCompilationThread const):
(WTF::Thread::gcThreadType const):
(WTF::Thread::joinableState const):
(WTF::Thread::hasExited const):
(WTF::Thread::Thread):
(WTF::Thread::joinableState): Deleted.
(WTF::Thread::hasExited): Deleted.
* wtf/ThreadingPrimitives.h:
(WTF::threadSpecificKeyCreate):
(WTF::threadSpecificKeyDelete):
(WTF::threadSpecificSet):
(WTF::threadSpecificGet):
* wtf/win/ThreadSpecificWin.cpp:
(WTF::flsKeys):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/AlignedMemoryAllocator.cpp
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/HeapInlines.h
Source/JavaScriptCore/heap/MarkedSpace.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/CompilationThread.cpp
Source/WTF/wtf/CompilationThread.h
Source/WTF/wtf/MainThread.cpp
Source/WTF/wtf/MainThread.h
Source/WTF/wtf/ThreadSpecific.h
Source/WTF/wtf/Threading.cpp
Source/WTF/wtf/Threading.h
Source/WTF/wtf/ThreadingPrimitives.h
Source/WTF/wtf/win/ThreadSpecificWin.cpp
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp