https://bugs.webkit.org/show_bug.cgi?id=37745
Move string uniquing tables to (new) WTFThreadData class.
Reviewed by Sam Weinig.
Remove AtomicString's dependency on ThreadGlobalData so that we can move
WebCore's string classes up to WTF.
JavaScriptCore:
WTFThreadData.cpp/.h are based on ThreadGlobalData from WebCore.
Moved JSC & WebCore's string uniquing tables to this class.
This patch introduces a temporary layering violation in providing forward
declarations of classes from JSC and WTF; this will be resolved as we move
more string code up to WTF.
(JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
(JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
(JSC::APICallbackShim::APICallbackShim):
(JSC::APICallbackShim::~APICallbackShim):
(JSC::checkSyntax):
(JSC::evaluate):
(JSC::Identifier::remove):
(JSC::Identifier::checkCurrentIdentifierTable):
- runtime/Identifier.h:
- runtime/InitializeThreading.cpp:
(JSC::initializeThreadingOnce):
- runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::create):
- wtf/WTFThreadData.cpp: Copied from WebCore/platform/ThreadGlobalData.cpp.
(WTF::WTFThreadData::WTFThreadData):
(WTF::WTFThreadData::~WTFThreadData):
- wtf/WTFThreadData.h: Copied from WebCore/platform/ThreadGlobalData.h.
(WTF::WTFThreadData::atomicStringTable):
(WTF::WTFThreadData::initializeIdentifierTable):
(WTF::WTFThreadData::currentIdentifierTable):
(WTF::WTFThreadData::setCurrentIdentifierTable):
(WTF::WTFThreadData::resetCurrentIdentifierTable):
(WTF::wtfThreadData):
JavaScriptGlue:
- ForwardingHeaders/wtf/WTFThreadData.h: Added.
- JSUtils.cpp: Update
(JSGlueAPIEntry::JSGlueAPIEntry):
(JSGlueAPIEntry::~JSGlueAPIEntry):
(JSGlueAPICallback::JSGlueAPICallback):
(JSGlueAPICallback::~JSGlueAPICallback):
WebCore:
- ForwardingHeaders/wtf/WTFThreadData.h: Added.
- platform/ThreadGlobalData.cpp: Remove m_atomicStringTable, all wtfThreadData() to ensure threadsafely initialized.
(WebCore::ThreadGlobalData::ThreadGlobalData):
(WebCore::ThreadGlobalData::~ThreadGlobalData):
- platform/ThreadGlobalData.h: Remove m_atomicStringTable.
(WebCore::ThreadGlobalData::eventNames):
- platform/text/AtomicString.cpp:
(WebCore::AtomicStringTable::create):
(WebCore::AtomicStringTable::table):
(WebCore::AtomicStringTable::destroy):
(WebCore::stringTable): Access the AtomicStringTable on wtfThreadData() rather then threadGlobalData().