Ignore:
Timestamp:
Apr 19, 2010, 1:05:53 PM (15 years ago)
Author:
[email protected]
Message:

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.

  • API/APIShims.h:

(JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
(JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
(JSC::APICallbackShim::APICallbackShim):
(JSC::APICallbackShim::~APICallbackShim):

(JSC::checkSyntax):
(JSC::evaluate):

  • runtime/Identifier.cpp:

(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().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalData.cpp

    r57192 r57829  
    5050#include "Nodes.h"
    5151#include "Parser.h"
     52#include <wtf/WTFThreadData.h>
    5253
    5354#if ENABLE(JSC_MULTIPLE_THREADS)
     
    204205{
    205206    JSGlobalData* globalData = new JSGlobalData(false);
    206     setDefaultIdentifierTable(globalData->identifierTable);
    207     setCurrentIdentifierTable(globalData->identifierTable);
     207    wtfThreadData().initializeIdentifierTable(globalData->identifierTable);
    208208    return adoptRef(globalData);
    209209}
Note: See TracChangeset for help on using the changeset viewer.