Changeset 57853 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Apr 19, 2010, 4:26:29 PM (15 years ago)
Author:
[email protected]
Message:

This broke windows.

Reviewed by NOBODY (rolling out r57829).

JavaScriptCore:

  • 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):
(JSC::createIdentifierTableSpecificCallback):
(JSC::createIdentifierTableSpecific):

  • runtime/Identifier.h:

(JSC::ThreadIdentifierTableData::ThreadIdentifierTableData):
(JSC::defaultIdentifierTable):
(JSC::setDefaultIdentifierTable):
(JSC::currentIdentifierTable):
(JSC::setCurrentIdentifierTable):
(JSC::resetCurrentIdentifierTable):

  • runtime/InitializeThreading.cpp:

(JSC::initializeThreadingOnce):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::create):

  • wtf/WTFThreadData.cpp: Removed.
  • wtf/WTFThreadData.h: Removed.

JavaScriptGlue:

  • ForwardingHeaders/wtf/WTFThreadData.h: Removed.
  • JSUtils.cpp:

(JSGlueAPIEntry::JSGlueAPIEntry):
(JSGlueAPIEntry::~JSGlueAPIEntry):
(JSGlueAPICallback::JSGlueAPICallback):
(JSGlueAPICallback::~JSGlueAPICallback):

WebCore:

  • ForwardingHeaders/wtf/WTFThreadData.h: Removed.
  • platform/ThreadGlobalData.cpp:

(WebCore::ThreadGlobalData::ThreadGlobalData):
(WebCore::ThreadGlobalData::~ThreadGlobalData):

  • platform/ThreadGlobalData.h:

(WebCore::ThreadGlobalData::atomicStringTable):

  • platform/text/AtomicString.cpp:

(WebCore::stringTable):

Location:
trunk/JavaScriptCore/runtime
Files:
5 edited

Legend:

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

    r57829 r57853  
    3030#include "Parser.h"
    3131#include "Debugger.h"
    32 #include "WTFThreadData.h"
    3332#include <stdio.h>
    3433
     
    3837{
    3938    JSLock lock(exec);
    40     ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
     39    ASSERT(exec->globalData().identifierTable == currentIdentifierTable());
    4140
    4241    RefPtr<ProgramExecutable> program = ProgramExecutable::create(exec, source);
     
    5150{
    5251    JSLock lock(exec);
    53     ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
     52    ASSERT(exec->globalData().identifierTable == currentIdentifierTable());
    5453
    5554    RefPtr<ProgramExecutable> program = ProgramExecutable::create(exec, source);
  • trunk/JavaScriptCore/runtime/Identifier.cpp

    r57829 r57853  
    2929#include <wtf/FastMalloc.h>
    3030#include <wtf/HashSet.h>
    31 #include <wtf/WTFThreadData.h>
    3231
    3332using WTF::ThreadSpecific;
     
    230229void Identifier::remove(UString::Rep* r)
    231230{
    232     wtfThreadData().currentIdentifierTable()->remove(r);
     231    currentIdentifierTable()->remove(r);
    233232}
    234233   
     
    254253    // Check the identifier table accessible through the threadspecific matches the
    255254    // globalData's identifier table.
    256     ASSERT_UNUSED(globalData, globalData->identifierTable == wtfThreadData().currentIdentifierTable());
     255    ASSERT_UNUSED(globalData, globalData->identifierTable == currentIdentifierTable());
    257256}
    258257
     
    271270#endif
    272271
     272ThreadSpecific<ThreadIdentifierTableData>* g_identifierTableSpecific = 0;
     273
     274#if ENABLE(JSC_MULTIPLE_THREADS)
     275
     276pthread_once_t createIdentifierTableSpecificOnce = PTHREAD_ONCE_INIT;
     277static void createIdentifierTableSpecificCallback()
     278{
     279    ASSERT(!g_identifierTableSpecific);
     280    g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>();
     281}
     282void createIdentifierTableSpecific()
     283{
     284    pthread_once(&createIdentifierTableSpecificOnce, createIdentifierTableSpecificCallback);
     285    ASSERT(g_identifierTableSpecific);
     286}
     287
     288#else
     289
     290void createIdentifierTableSpecific()
     291{
     292    ASSERT(!g_identifierTableSpecific);
     293    g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>();
     294}
     295
     296#endif
     297
    273298} // namespace JSC
  • trunk/JavaScriptCore/runtime/Identifier.h

    r57829 r57853  
    141141    void deleteIdentifierTable(IdentifierTable*);
    142142
     143    struct ThreadIdentifierTableData {
     144        ThreadIdentifierTableData()
     145            : defaultIdentifierTable(0)
     146            , currentIdentifierTable(0)
     147        {
     148        }
     149
     150        IdentifierTable* defaultIdentifierTable;
     151        IdentifierTable* currentIdentifierTable;
     152    };
     153
     154    extern WTF::ThreadSpecific<ThreadIdentifierTableData>* g_identifierTableSpecific;
     155    void createIdentifierTableSpecific();
     156
     157    inline IdentifierTable* defaultIdentifierTable()
     158    {
     159        if (!g_identifierTableSpecific)
     160            createIdentifierTableSpecific();
     161        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
     162
     163        return data.defaultIdentifierTable;
     164    }
     165
     166    inline void setDefaultIdentifierTable(IdentifierTable* identifierTable)
     167    {
     168        if (!g_identifierTableSpecific)
     169            createIdentifierTableSpecific();
     170        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
     171
     172        data.defaultIdentifierTable = identifierTable;
     173    }
     174
     175    inline IdentifierTable* currentIdentifierTable()
     176    {
     177        if (!g_identifierTableSpecific)
     178            createIdentifierTableSpecific();
     179        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
     180
     181        return data.currentIdentifierTable;
     182    }
     183
     184    inline IdentifierTable* setCurrentIdentifierTable(IdentifierTable* identifierTable)
     185    {
     186        if (!g_identifierTableSpecific)
     187            createIdentifierTableSpecific();
     188        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
     189
     190        IdentifierTable* oldIdentifierTable = data.currentIdentifierTable;
     191        data.currentIdentifierTable = identifierTable;
     192        return oldIdentifierTable;
     193    }
     194
     195    inline void resetCurrentIdentifierTable()
     196    {
     197        if (!g_identifierTableSpecific)
     198            createIdentifierTableSpecific();
     199        ThreadIdentifierTableData& data = **g_identifierTableSpecific;
     200
     201        data.currentIdentifierTable = data.defaultIdentifierTable;
     202    }
     203
    143204} // namespace JSC
    144205
  • trunk/JavaScriptCore/runtime/InitializeThreading.cpp

    r57829 r57853  
    3737#include <wtf/DateMath.h>
    3838#include <wtf/Threading.h>
    39 #include <wtf/WTFThreadData.h>
    4039
    4140using namespace WTF;
     
    5049{
    5150    WTF::initializeThreading();
    52     wtfThreadData();
    5351    initializeUString();
    5452    JSGlobalData::storeVPtrs();
  • trunk/JavaScriptCore/runtime/JSGlobalData.cpp

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