Changeset 57879 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Apr 20, 2010, 1:30:12 AM (15 years ago)
Author:
[email protected]
Message:

Rubber stamped by Maciej Stachowiak (relanding r57829).
Added missing JS_EXPORTDATA

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):

  • runtime/Identifier.h:
  • runtime/InitializeThreading.cpp:

(JSC::initializeThreadingOnce):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::create):

  • wtf/WTFThreadData.cpp: Copied from JavaScriptCore/wtf/WTFThreadData.cpp.
  • wtf/WTFThreadData.h: Copied from JavaScriptCore/wtf/WTFThreadData.h.

JavaScriptGlue:

  • ForwardingHeaders/wtf/WTFThreadData.h: Copied from JavaScriptGlue/ForwardingHeaders/wtf/WTFThreadData.h.
  • JSUtils.cpp:

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

WebCore:

  • ForwardingHeaders/wtf/WTFThreadData.h: Copied from WebCore/ForwardingHeaders/wtf/WTFThreadData.h.
  • platform/ThreadGlobalData.cpp:

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

  • platform/ThreadGlobalData.h:

(WebCore::ThreadGlobalData::eventNames):

  • platform/text/AtomicString.cpp:

(WebCore::AtomicStringTable::create):
(WebCore::AtomicStringTable::table):
(WebCore::AtomicStringTable::destroy):
(WebCore::stringTable):

Location:
trunk/JavaScriptCore/runtime
Files:
5 edited

Legend:

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

    r57853 r57879  
    3030#include "Parser.h"
    3131#include "Debugger.h"
     32#include "WTFThreadData.h"
    3233#include <stdio.h>
    3334
     
    3738{
    3839    JSLock lock(exec);
    39     ASSERT(exec->globalData().identifierTable == currentIdentifierTable());
     40    ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
    4041
    4142    RefPtr<ProgramExecutable> program = ProgramExecutable::create(exec, source);
     
    5051{
    5152    JSLock lock(exec);
    52     ASSERT(exec->globalData().identifierTable == currentIdentifierTable());
     53    ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
    5354
    5455    RefPtr<ProgramExecutable> program = ProgramExecutable::create(exec, source);
  • trunk/JavaScriptCore/runtime/Identifier.cpp

    r57853 r57879  
    2929#include <wtf/FastMalloc.h>
    3030#include <wtf/HashSet.h>
     31#include <wtf/WTFThreadData.h>
    3132
    3233using WTF::ThreadSpecific;
     
    229230void Identifier::remove(UString::Rep* r)
    230231{
    231     currentIdentifierTable()->remove(r);
     232    wtfThreadData().currentIdentifierTable()->remove(r);
    232233}
    233234   
     
    253254    // Check the identifier table accessible through the threadspecific matches the
    254255    // globalData's identifier table.
    255     ASSERT_UNUSED(globalData, globalData->identifierTable == currentIdentifierTable());
     256    ASSERT_UNUSED(globalData, globalData->identifierTable == wtfThreadData().currentIdentifierTable());
    256257}
    257258
     
    270271#endif
    271272
    272 ThreadSpecific<ThreadIdentifierTableData>* g_identifierTableSpecific = 0;
    273 
    274 #if ENABLE(JSC_MULTIPLE_THREADS)
    275 
    276 pthread_once_t createIdentifierTableSpecificOnce = PTHREAD_ONCE_INIT;
    277 static void createIdentifierTableSpecificCallback()
    278 {
    279     ASSERT(!g_identifierTableSpecific);
    280     g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>();
    281 }
    282 void createIdentifierTableSpecific()
    283 {
    284     pthread_once(&createIdentifierTableSpecificOnce, createIdentifierTableSpecificCallback);
    285     ASSERT(g_identifierTableSpecific);
    286 }
    287 
    288 #else
    289 
    290 void createIdentifierTableSpecific()
    291 {
    292     ASSERT(!g_identifierTableSpecific);
    293     g_identifierTableSpecific = new ThreadSpecific<ThreadIdentifierTableData>();
    294 }
    295 
    296 #endif
    297 
    298273} // namespace JSC
  • trunk/JavaScriptCore/runtime/Identifier.h

    r57853 r57879  
    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 
    204143} // namespace JSC
    205144
  • trunk/JavaScriptCore/runtime/InitializeThreading.cpp

    r57853 r57879  
    3737#include <wtf/DateMath.h>
    3838#include <wtf/Threading.h>
     39#include <wtf/WTFThreadData.h>
    3940
    4041using namespace WTF;
     
    4950{
    5051    WTF::initializeThreading();
     52    wtfThreadData();
    5153    initializeUString();
    5254    JSGlobalData::storeVPtrs();
  • trunk/JavaScriptCore/runtime/JSGlobalData.cpp

    r57853 r57879  
    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.