Ignore:
Timestamp:
Apr 28, 2008, 11:22:14 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Darin.

Fix run-webkit-tests --threading
and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661>
Proxy server issue in Sunday's Nightly

Changed ClassInfo objects for built-in objects to hold a getter function returning
a per-thread instance. This makes it safe to share these ClassInfo objects between threads -
and these are the only ones that need to be shared.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ExecState.h

    r32259 r32652  
    3939    class FunctionImp;
    4040    class GlobalFuncImp;
     41    struct HashTable;
    4142    class Interpreter;
    4243    class JSGlobalObject;
     
    4647   
    4748    enum CodeType { GlobalCode, EvalCode, FunctionCode };
     49
     50    struct PerThreadData {
     51        const HashTable* arrayTable;
     52        const HashTable* dateTable;
     53        const HashTable* mathTable;
     54        const HashTable* numberTable;
     55        const HashTable* RegExpImpTable;
     56        const HashTable* RegExpObjectImpTable;
     57        const HashTable* stringTable;
     58
     59        CommonIdentifiers* propertyNames;
     60        const List emptyList;
     61    };
    4862
    4963    // Represents the current state of script execution.
     
    97111        // These pointers are used to avoid accessing global variables for these,
    98112        // to avoid taking PIC branches in Mach-O binaries.
    99         const CommonIdentifiers& propertyNames() const { return *m_propertyNames; }
    100         const List& emptyList() const { return *m_emptyList; }
     113        const CommonIdentifiers& propertyNames() const { return *m_perThreadData->propertyNames; }
     114        const List& emptyList() const { return m_perThreadData->emptyList; }
     115        static const HashTable* arrayTable(ExecState* exec) { return exec->m_perThreadData->arrayTable; }
     116        static const HashTable* dateTable(ExecState* exec) { return exec->m_perThreadData->dateTable; }
     117        static const HashTable* mathTable(ExecState* exec) { return exec->m_perThreadData->mathTable; }
     118        static const HashTable* numberTable(ExecState* exec) { return exec->m_perThreadData->numberTable; }
     119        static const HashTable* RegExpImpTable(ExecState* exec) { return exec->m_perThreadData->RegExpImpTable; }
     120        static const HashTable* RegExpObjectImpTable(ExecState* exec) { return exec->m_perThreadData->RegExpObjectImpTable; }
     121        static const HashTable* stringTable(ExecState* exec) { return exec->m_perThreadData->stringTable; }
    101122
    102123        LocalStorage& localStorage() { return *m_localStorage; }
     
    177198        JSGlobalObject* m_globalObject;
    178199        JSValue* m_exception;
    179         CommonIdentifiers* m_propertyNames;
    180         const List* m_emptyList;
    181200
    182201        ExecState* m_callingExec;
     202
     203        const PerThreadData* m_perThreadData;
    183204
    184205        ScopeNode* m_scopeNode;
Note: See TracChangeset for help on using the changeset viewer.