Changeset 155219 in webkit


Ignore:
Timestamp:
Sep 6, 2013 3:32:08 PM (11 years ago)
Author:
andersca@apple.com
Message:

Stop using fastNew/fastDelete in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=120898

Reviewed by Oliver Hunt.

Source/JavaScriptCore:

Change all the hash table members in ExecState to be OwnPtrs and use
adoptPtr instead. Also, since none of the hash tables can be null, change their getters
to return references and propagate the reference types wherever we know that a HashTable can't be null.

  • interpreter/CallFrame.h:

(JSC::ExecState::arrayConstructorTable):
(JSC::ExecState::arrayPrototypeTable):
(JSC::ExecState::booleanPrototypeTable):
(JSC::ExecState::dataViewTable):
(JSC::ExecState::dateTable):
(JSC::ExecState::dateConstructorTable):
(JSC::ExecState::errorPrototypeTable):
(JSC::ExecState::globalObjectTable):
(JSC::ExecState::jsonTable):
(JSC::ExecState::numberConstructorTable):
(JSC::ExecState::numberPrototypeTable):
(JSC::ExecState::objectConstructorTable):
(JSC::ExecState::privateNamePrototypeTable):
(JSC::ExecState::regExpTable):
(JSC::ExecState::regExpConstructorTable):
(JSC::ExecState::regExpPrototypeTable):
(JSC::ExecState::stringConstructorTable):
(JSC::ExecState::promisePrototypeTable):
(JSC::ExecState::promiseConstructorTable):
(JSC::ExecState::promiseResolverPrototypeTable):

  • runtime/ClassInfo.h:

(JSC::ClassInfo::propHashTable):

  • runtime/Lookup.h:

(JSC::getStaticPropertySlot):
(JSC::getStaticFunctionSlot):
(JSC::getStaticValueSlot):
(JSC::lookupPut):

  • runtime/VM.cpp:

(JSC::VM::VM):
(JSC::VM::~VM):

  • runtime/VM.h:

Source/WebCore:

Update for changes to JavaScriptCore.

  • bindings/js/DOMObjectHashTableMap.h:

(WebCore::DOMObjectHashTableMap::get):

  • bindings/js/JSDOMBinding.cpp:

(WebCore::getHashTableForGlobalData):

  • bindings/js/JSDOMBinding.h:
  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::put):

  • bindings/js/JSPluginElementFunctions.h:

(WebCore::pluginElementCustomGetOwnPropertySlot):

  • bindings/js/JSStorageCustom.cpp:

(WebCore::JSStorage::deleteProperty):
(WebCore::JSStorage::putDelegate):

  • bindings/scripts/CodeGeneratorJS.pm:

(hashTableAccessor):
(prototypeHashTableAccessor):
(constructorHashTableAccessor):
(GenerateGetOwnPropertySlotBody):
(GenerateImplementation):
(GenerateConstructorHelperMethods):

Location:
trunk/Source
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r155209 r155219  
     12013-09-06  Anders Carlsson  <andersca@apple.com>
     2
     3        Stop using fastNew/fastDelete in JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=120898
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Change all the hash table members in ExecState to be OwnPtrs and use
     9        adoptPtr instead. Also, since none of the hash tables can be null, change their getters
     10        to return references and propagate the reference types wherever we know that a HashTable can't be null.
     11
     12        * interpreter/CallFrame.h:
     13        (JSC::ExecState::arrayConstructorTable):
     14        (JSC::ExecState::arrayPrototypeTable):
     15        (JSC::ExecState::booleanPrototypeTable):
     16        (JSC::ExecState::dataViewTable):
     17        (JSC::ExecState::dateTable):
     18        (JSC::ExecState::dateConstructorTable):
     19        (JSC::ExecState::errorPrototypeTable):
     20        (JSC::ExecState::globalObjectTable):
     21        (JSC::ExecState::jsonTable):
     22        (JSC::ExecState::numberConstructorTable):
     23        (JSC::ExecState::numberPrototypeTable):
     24        (JSC::ExecState::objectConstructorTable):
     25        (JSC::ExecState::privateNamePrototypeTable):
     26        (JSC::ExecState::regExpTable):
     27        (JSC::ExecState::regExpConstructorTable):
     28        (JSC::ExecState::regExpPrototypeTable):
     29        (JSC::ExecState::stringConstructorTable):
     30        (JSC::ExecState::promisePrototypeTable):
     31        (JSC::ExecState::promiseConstructorTable):
     32        (JSC::ExecState::promiseResolverPrototypeTable):
     33        * runtime/ClassInfo.h:
     34        (JSC::ClassInfo::propHashTable):
     35        * runtime/Lookup.h:
     36        (JSC::getStaticPropertySlot):
     37        (JSC::getStaticFunctionSlot):
     38        (JSC::getStaticValueSlot):
     39        (JSC::lookupPut):
     40        * runtime/VM.cpp:
     41        (JSC::VM::VM):
     42        (JSC::VM::~VM):
     43        * runtime/VM.h:
     44
    1452013-09-06  Filip Pizlo  <fpizlo@apple.com>
    246
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r155081 r155219  
    8585        void dumpCaller();
    8686#endif
    87         static const HashTable* arrayConstructorTable(CallFrame* callFrame) { return callFrame->vm().arrayConstructorTable; }
    88         static const HashTable* arrayPrototypeTable(CallFrame* callFrame) { return callFrame->vm().arrayPrototypeTable; }
    89         static const HashTable* booleanPrototypeTable(CallFrame* callFrame) { return callFrame->vm().booleanPrototypeTable; }
    90         static const HashTable* dataViewTable(CallFrame* callFrame) { return callFrame->vm().dataViewTable; }
    91         static const HashTable* dateTable(CallFrame* callFrame) { return callFrame->vm().dateTable; }
    92         static const HashTable* dateConstructorTable(CallFrame* callFrame) { return callFrame->vm().dateConstructorTable; }
    93         static const HashTable* errorPrototypeTable(CallFrame* callFrame) { return callFrame->vm().errorPrototypeTable; }
    94         static const HashTable* globalObjectTable(CallFrame* callFrame) { return callFrame->vm().globalObjectTable; }
    95         static const HashTable* jsonTable(CallFrame* callFrame) { return callFrame->vm().jsonTable; }
    96         static const HashTable* numberConstructorTable(CallFrame* callFrame) { return callFrame->vm().numberConstructorTable; }
    97         static const HashTable* numberPrototypeTable(CallFrame* callFrame) { return callFrame->vm().numberPrototypeTable; }
    98         static const HashTable* objectConstructorTable(CallFrame* callFrame) { return callFrame->vm().objectConstructorTable; }
    99         static const HashTable* privateNamePrototypeTable(CallFrame* callFrame) { return callFrame->vm().privateNamePrototypeTable; }
    100         static const HashTable* regExpTable(CallFrame* callFrame) { return callFrame->vm().regExpTable; }
    101         static const HashTable* regExpConstructorTable(CallFrame* callFrame) { return callFrame->vm().regExpConstructorTable; }
    102         static const HashTable* regExpPrototypeTable(CallFrame* callFrame) { return callFrame->vm().regExpPrototypeTable; }
    103         static const HashTable* stringConstructorTable(CallFrame* callFrame) { return callFrame->vm().stringConstructorTable; }
     87        static const HashTable& arrayConstructorTable(CallFrame* callFrame) { return *callFrame->vm().arrayConstructorTable; }
     88        static const HashTable& arrayPrototypeTable(CallFrame* callFrame) { return *callFrame->vm().arrayPrototypeTable; }
     89        static const HashTable& booleanPrototypeTable(CallFrame* callFrame) { return *callFrame->vm().booleanPrototypeTable; }
     90        static const HashTable& dataViewTable(CallFrame* callFrame) { return *callFrame->vm().dataViewTable; }
     91        static const HashTable& dateTable(CallFrame* callFrame) { return *callFrame->vm().dateTable; }
     92        static const HashTable& dateConstructorTable(CallFrame* callFrame) { return *callFrame->vm().dateConstructorTable; }
     93        static const HashTable& errorPrototypeTable(CallFrame* callFrame) { return *callFrame->vm().errorPrototypeTable; }
     94        static const HashTable& globalObjectTable(CallFrame* callFrame) { return *callFrame->vm().globalObjectTable; }
     95        static const HashTable& jsonTable(CallFrame* callFrame) { return *callFrame->vm().jsonTable; }
     96        static const HashTable& numberConstructorTable(CallFrame* callFrame) { return *callFrame->vm().numberConstructorTable; }
     97        static const HashTable& numberPrototypeTable(CallFrame* callFrame) { return *callFrame->vm().numberPrototypeTable; }
     98        static const HashTable& objectConstructorTable(CallFrame* callFrame) { return *callFrame->vm().objectConstructorTable; }
     99        static const HashTable& privateNamePrototypeTable(CallFrame* callFrame) { return *callFrame->vm().privateNamePrototypeTable; }
     100        static const HashTable& regExpTable(CallFrame* callFrame) { return *callFrame->vm().regExpTable; }
     101        static const HashTable& regExpConstructorTable(CallFrame* callFrame) { return *callFrame->vm().regExpConstructorTable; }
     102        static const HashTable& regExpPrototypeTable(CallFrame* callFrame) { return *callFrame->vm().regExpPrototypeTable; }
     103        static const HashTable& stringConstructorTable(CallFrame* callFrame) { return *callFrame->vm().stringConstructorTable; }
    104104#if ENABLE(PROMISES)
    105         static const HashTable* promisePrototypeTable(CallFrame* callFrame) { return callFrame->vm().promisePrototypeTable; }
    106         static const HashTable* promiseConstructorTable(CallFrame* callFrame) { return callFrame->vm().promiseConstructorTable; }
    107         static const HashTable* promiseResolverPrototypeTable(CallFrame* callFrame) { return callFrame->vm().promiseResolverPrototypeTable; }
     105        static const HashTable& promisePrototypeTable(CallFrame* callFrame) { return *callFrame->vm().promisePrototypeTable; }
     106        static const HashTable& promiseConstructorTable(CallFrame* callFrame) { return *callFrame->vm().promiseConstructorTable; }
     107        static const HashTable& promiseResolverPrototypeTable(CallFrame* callFrame) { return *callFrame->vm().promiseResolverPrototypeTable; }
    108108#endif
    109109
  • trunk/Source/JavaScriptCore/runtime/ClassInfo.h

    r154459 r155219  
    145145
    146146struct ClassInfo {
    147     /**
    148      * A string denoting the class name. Example: "Window".
    149      */
     147    // A string denoting the class name. Example: "Window".
    150148    const char* className;
    151149
    152     /**
    153      * Pointer to the class information of the base class.
    154      * 0L if there is none.
    155      */
     150    // Pointer to the class information of the base class.
     151    // nullptrif there is none.
    156152    const ClassInfo* parentClass;
    157     /**
    158      * Static hash-table of properties.
    159      * For classes that can be used from multiple threads, it is accessed via a getter function that would typically return a pointer to thread-specific value.
    160      */
     153
     154    // Static hash-table of properties.
     155    // For classes that can be used from multiple threads, it is accessed via a getter function
     156    // that would typically return a pointer to a thread-specific value.
    161157    const HashTable* propHashTable(ExecState* exec) const
    162158    {
    163159        if (classPropHashTableGetterFunction)
    164             return classPropHashTableGetterFunction(exec);
     160            return &classPropHashTableGetterFunction(exec);
     161
    165162        return staticPropHashTable;
    166163    }
     
    185182
    186183    const HashTable* staticPropHashTable;
    187     typedef const HashTable* (*ClassPropHashTableGetterFunction)(ExecState*);
     184    typedef const HashTable& (*ClassPropHashTableGetterFunction)(ExecState*);
    188185    const ClassPropHashTableGetterFunction classPropHashTableGetterFunction;
    189186
  • trunk/Source/JavaScriptCore/runtime/Lookup.h

    r154336 r155219  
    242242     */
    243243    template <class ThisImp, class ParentImp>
    244     inline bool getStaticPropertySlot(ExecState* exec, const HashTable* table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot)
    245     {
    246         const HashEntry* entry = table->entry(exec, propertyName);
     244    inline bool getStaticPropertySlot(ExecState* exec, const HashTable& table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot)
     245    {
     246        const HashEntry* entry = table.entry(exec, propertyName);
    247247
    248248        if (!entry) // not found, forward to parent
     
    262262     */
    263263    template <class ParentImp>
    264     inline bool getStaticFunctionSlot(ExecState* exec, const HashTable* table, JSObject* thisObj, PropertyName propertyName, PropertySlot& slot)
     264    inline bool getStaticFunctionSlot(ExecState* exec, const HashTable& table, JSObject* thisObj, PropertyName propertyName, PropertySlot& slot)
    265265    {
    266266        if (ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot))
    267267            return true;
    268268
    269         const HashEntry* entry = table->entry(exec, propertyName);
     269        const HashEntry* entry = table.entry(exec, propertyName);
    270270        if (!entry)
    271271            return false;
     
    279279     */
    280280    template <class ThisImp, class ParentImp>
    281     inline bool getStaticValueSlot(ExecState* exec, const HashTable* table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot)
    282     {
    283         const HashEntry* entry = table->entry(exec, propertyName);
     281    inline bool getStaticValueSlot(ExecState* exec, const HashTable& table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot)
     282    {
     283        const HashEntry* entry = table.entry(exec, propertyName);
    284284
    285285        if (!entry) // not found, forward to parent
     
    310310     */
    311311    template <class ThisImp>
    312     inline bool lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable* table, ThisImp* thisObj, bool shouldThrow = false)
    313     {
    314         const HashEntry* entry = table->entry(exec, propertyName);
     312    inline bool lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, ThisImp* thisObj, bool shouldThrow = false)
     313    {
     314        const HashEntry* entry = table.entry(exec, propertyName);
    315315       
    316316        if (!entry)
     
    328328     */
    329329    template <class ThisImp, class ParentImp>
    330     inline void lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable* table, ThisImp* thisObj, PutPropertySlot& slot)
     330    inline void lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, ThisImp* thisObj, PutPropertySlot& slot)
    331331    {
    332332        if (!lookupPut<ThisImp>(exec, propertyName, value, table, thisObj, slot.isStrictMode()))
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r155023 r155219  
    156156    , clientData(0)
    157157    , topCallFrame(CallFrame::noCaller()->removeHostCallFrameFlag())
    158     , arrayConstructorTable(fastNew<HashTable>(JSC::arrayConstructorTable))
    159     , arrayPrototypeTable(fastNew<HashTable>(JSC::arrayPrototypeTable))
    160     , booleanPrototypeTable(fastNew<HashTable>(JSC::booleanPrototypeTable))
    161     , dataViewTable(fastNew<HashTable>(JSC::dataViewTable))
    162     , dateTable(fastNew<HashTable>(JSC::dateTable))
    163     , dateConstructorTable(fastNew<HashTable>(JSC::dateConstructorTable))
    164     , errorPrototypeTable(fastNew<HashTable>(JSC::errorPrototypeTable))
    165     , globalObjectTable(fastNew<HashTable>(JSC::globalObjectTable))
    166     , jsonTable(fastNew<HashTable>(JSC::jsonTable))
    167     , numberConstructorTable(fastNew<HashTable>(JSC::numberConstructorTable))
    168     , numberPrototypeTable(fastNew<HashTable>(JSC::numberPrototypeTable))
    169     , objectConstructorTable(fastNew<HashTable>(JSC::objectConstructorTable))
    170     , privateNamePrototypeTable(fastNew<HashTable>(JSC::privateNamePrototypeTable))
    171     , regExpTable(fastNew<HashTable>(JSC::regExpTable))
    172     , regExpConstructorTable(fastNew<HashTable>(JSC::regExpConstructorTable))
    173     , regExpPrototypeTable(fastNew<HashTable>(JSC::regExpPrototypeTable))
    174     , stringConstructorTable(fastNew<HashTable>(JSC::stringConstructorTable))
     158    , arrayConstructorTable(adoptPtr(new HashTable(JSC::arrayConstructorTable)))
     159    , arrayPrototypeTable(adoptPtr(new HashTable(JSC::arrayPrototypeTable)))
     160    , booleanPrototypeTable(adoptPtr(new HashTable(JSC::booleanPrototypeTable)))
     161    , dataViewTable(adoptPtr(new HashTable(JSC::dataViewTable)))
     162    , dateTable(adoptPtr(new HashTable(JSC::dateTable)))
     163    , dateConstructorTable(adoptPtr(new HashTable(JSC::dateConstructorTable)))
     164    , errorPrototypeTable(adoptPtr(new HashTable(JSC::errorPrototypeTable)))
     165    , globalObjectTable(adoptPtr(new HashTable(JSC::globalObjectTable)))
     166    , jsonTable(adoptPtr(new HashTable(JSC::jsonTable)))
     167    , numberConstructorTable(adoptPtr(new HashTable(JSC::numberConstructorTable)))
     168    , numberPrototypeTable(adoptPtr(new HashTable(JSC::numberPrototypeTable)))
     169    , objectConstructorTable(adoptPtr(new HashTable(JSC::objectConstructorTable)))
     170    , privateNamePrototypeTable(adoptPtr(new HashTable(JSC::privateNamePrototypeTable)))
     171    , regExpTable(adoptPtr(new HashTable(JSC::regExpTable)))
     172    , regExpConstructorTable(adoptPtr(new HashTable(JSC::regExpConstructorTable)))
     173    , regExpPrototypeTable(adoptPtr(new HashTable(JSC::regExpPrototypeTable)))
     174    , stringConstructorTable(adoptPtr(new HashTable(JSC::stringConstructorTable)))
    175175#if ENABLE(PROMISES)
    176     , promisePrototypeTable(fastNew<HashTable>(JSC::promisePrototypeTable))
    177     , promiseConstructorTable(fastNew<HashTable>(JSC::promiseConstructorTable))
    178     , promiseResolverPrototypeTable(fastNew<HashTable>(JSC::promiseResolverPrototypeTable))
     176    , promisePrototypeTable(adoptPtr(new HashTable(JSC::promisePrototypeTable)))
     177    , promiseConstructorTable(adoptPtr(new HashTable(JSC::promiseConstructorTable)))
     178    , promiseResolverPrototypeTable(adoptPtr(new HashTable(JSC::promiseResolverPrototypeTable)))
    179179#endif
    180180    , identifierTable(vmType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable())
     
    333333#endif
    334334
    335     fastDelete(const_cast<HashTable*>(arrayConstructorTable));
    336     fastDelete(const_cast<HashTable*>(arrayPrototypeTable));
    337     fastDelete(const_cast<HashTable*>(booleanPrototypeTable));
    338     fastDelete(const_cast<HashTable*>(dataViewTable));
    339     fastDelete(const_cast<HashTable*>(dateTable));
    340     fastDelete(const_cast<HashTable*>(dateConstructorTable));
    341     fastDelete(const_cast<HashTable*>(errorPrototypeTable));
    342     fastDelete(const_cast<HashTable*>(globalObjectTable));
    343     fastDelete(const_cast<HashTable*>(jsonTable));
    344     fastDelete(const_cast<HashTable*>(numberConstructorTable));
    345     fastDelete(const_cast<HashTable*>(numberPrototypeTable));
    346     fastDelete(const_cast<HashTable*>(objectConstructorTable));
    347     fastDelete(const_cast<HashTable*>(privateNamePrototypeTable));
    348     fastDelete(const_cast<HashTable*>(regExpTable));
    349     fastDelete(const_cast<HashTable*>(regExpConstructorTable));
    350     fastDelete(const_cast<HashTable*>(regExpPrototypeTable));
    351     fastDelete(const_cast<HashTable*>(stringConstructorTable));
    352 #if ENABLE(PROMISES)
    353     fastDelete(const_cast<HashTable*>(promisePrototypeTable));
    354     fastDelete(const_cast<HashTable*>(promiseConstructorTable));
    355     fastDelete(const_cast<HashTable*>(promiseResolverPrototypeTable));
    356 #endif
    357 
    358335    delete emptyList;
    359336
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r155023 r155219  
    223223        Watchdog watchdog;
    224224
    225         const HashTable* arrayConstructorTable;
    226         const HashTable* arrayPrototypeTable;
    227         const HashTable* booleanPrototypeTable;
    228         const HashTable* dataViewTable;
    229         const HashTable* dateTable;
    230         const HashTable* dateConstructorTable;
    231         const HashTable* errorPrototypeTable;
    232         const HashTable* globalObjectTable;
    233         const HashTable* jsonTable;
    234         const HashTable* numberConstructorTable;
    235         const HashTable* numberPrototypeTable;
    236         const HashTable* objectConstructorTable;
    237         const HashTable* privateNamePrototypeTable;
    238         const HashTable* regExpTable;
    239         const HashTable* regExpConstructorTable;
    240         const HashTable* regExpPrototypeTable;
    241         const HashTable* stringConstructorTable;
     225        const OwnPtr<const HashTable> arrayConstructorTable;
     226        const OwnPtr<const HashTable> arrayPrototypeTable;
     227        const OwnPtr<const HashTable> booleanPrototypeTable;
     228        const OwnPtr<const HashTable> dataViewTable;
     229        const OwnPtr<const HashTable> dateTable;
     230        const OwnPtr<const HashTable> dateConstructorTable;
     231        const OwnPtr<const HashTable> errorPrototypeTable;
     232        const OwnPtr<const HashTable> globalObjectTable;
     233        const OwnPtr<const HashTable> jsonTable;
     234        const OwnPtr<const HashTable> numberConstructorTable;
     235        const OwnPtr<const HashTable> numberPrototypeTable;
     236        const OwnPtr<const HashTable> objectConstructorTable;
     237        const OwnPtr<const HashTable> privateNamePrototypeTable;
     238        const OwnPtr<const HashTable> regExpTable;
     239        const OwnPtr<const HashTable> regExpConstructorTable;
     240        const OwnPtr<const HashTable> regExpPrototypeTable;
     241        const OwnPtr<const HashTable> stringConstructorTable;
    242242#if ENABLE(PROMISES)
    243         const HashTable* promisePrototypeTable;
    244         const HashTable* promiseConstructorTable;
    245         const HashTable* promiseResolverPrototypeTable;
     243        const OwnPtr<const HashTable> promisePrototypeTable;
     244        const OwnPtr<const HashTable> promiseConstructorTable;
     245        const OwnPtr<const HashTable> promiseResolverPrototypeTable;
    246246#endif
    247247
  • trunk/Source/WebCore/ChangeLog

    r155217 r155219  
     12013-09-06  Anders Carlsson  <andersca@apple.com>
     2
     3        Stop using fastNew/fastDelete in JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=120898
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Update for changes to JavaScriptCore.
     9
     10        * bindings/js/DOMObjectHashTableMap.h:
     11        (WebCore::DOMObjectHashTableMap::get):
     12        * bindings/js/JSDOMBinding.cpp:
     13        (WebCore::getHashTableForGlobalData):
     14        * bindings/js/JSDOMBinding.h:
     15        * bindings/js/JSDOMWindowCustom.cpp:
     16        (WebCore::JSDOMWindow::put):
     17        * bindings/js/JSPluginElementFunctions.h:
     18        (WebCore::pluginElementCustomGetOwnPropertySlot):
     19        * bindings/js/JSStorageCustom.cpp:
     20        (WebCore::JSStorage::deleteProperty):
     21        (WebCore::JSStorage::putDelegate):
     22        * bindings/scripts/CodeGeneratorJS.pm:
     23        (hashTableAccessor):
     24        (prototypeHashTableAccessor):
     25        (constructorHashTableAccessor):
     26        (GenerateGetOwnPropertySlotBody):
     27        (GenerateImplementation):
     28        (GenerateConstructorHelperMethods):
     29
    1302013-09-06  Andreas Kling  <akling@apple.com>
    231
  • trunk/Source/WebCore/bindings/js/DOMObjectHashTableMap.h

    r148696 r155219  
    4343    }
    4444
    45     const JSC::HashTable* get(const JSC::HashTable* staticTable)
     45    const JSC::HashTable& get(const JSC::HashTable& staticTable)
    4646    {
    47         HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.find(staticTable);
     47        HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.find(&staticTable);
    4848        if (iter != m_map.end())
    49             return &iter->value;
    50         return &m_map.set(staticTable, staticTable->copy()).iterator->value;
     49            return iter->value;
     50        return m_map.set(&staticTable, staticTable.copy()).iterator->value;
    5151    }
    5252
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp

    r155143 r155219  
    4949STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(DOMConstructorWithDocument);
    5050
    51 const JSC::HashTable* getHashTableForGlobalData(VM& vm, const JSC::HashTable* staticTable)
     51const JSC::HashTable& getHashTableForGlobalData(VM& vm, const JSC::HashTable& staticTable)
    5252{
    5353    return DOMObjectHashTableMap::mapFor(vm).get(staticTable);
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r154127 r155219  
    258258    }
    259259
    260     const JSC::HashTable* getHashTableForGlobalData(JSC::VM&, const JSC::HashTable* staticTable);
     260    const JSC::HashTable& getHashTableForGlobalData(JSC::VM&, const JSC::HashTable& staticTable);
    261261
    262262    void reportException(JSC::ExecState*, JSC::JSValue exception, CachedScript* = 0);
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r154558 r155219  
    345345    }
    346346
    347     if (lookupPut<JSDOMWindow>(exec, propertyName, value, s_info.propHashTable(exec), thisObject))
     347    if (lookupPut<JSDOMWindow>(exec, propertyName, value, *s_info.propHashTable(exec), thisObject))
    348348        return;
    349349
  • trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.h

    r154336 r155219  
    4747    {
    4848        if (!element->globalObject()->world()->isNormal()) {
    49             if (JSC::getStaticValueSlot<Type, Base>(exec, Type::info()->staticPropHashTable, element, propertyName, slot))
     49            if (JSC::getStaticValueSlot<Type, Base>(exec, *Type::info()->staticPropHashTable, element, propertyName, slot))
    5050                return true;
    5151
  • trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp

    r153677 r155219  
    6464    // the native property slots manually.
    6565    PropertySlot slot(thisObject);
    66     if (getStaticValueSlot<JSStorage, Base>(exec, s_info.propHashTable(exec), thisObject, propertyName, slot))
     66    if (getStaticValueSlot<JSStorage, Base>(exec, *s_info.propHashTable(exec), thisObject, propertyName, slot))
    6767        return false;
    6868       
     
    106106    // the native property slots manually.
    107107    PropertySlot slot(this);
    108     if (getStaticValueSlot<JSStorage, Base>(exec, s_info.propHashTable(exec), this, propertyName, slot))
     108    if (getStaticValueSlot<JSStorage, Base>(exec, *s_info.propHashTable(exec), this, propertyName, slot))
    109109        return false;
    110110       
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r154422 r155219  
    296296        return "get${className}Table(exec)";
    297297    } else {
    298         return "&${className}Table";
     298        return "${className}Table";
    299299    }
    300300}
     
    307307        return "get${className}PrototypeTable(exec)";
    308308    } else {
    309         return "&${className}PrototypeTable";
     309        return "${className}PrototypeTable";
    310310    }
    311311}
     
    318318        return "get${constructorClassName}Table(exec)";
    319319    } else {
    320         return "&${constructorClassName}Table";
     320        return "${constructorClassName}Table";
    321321    }
    322322}
     
    421421        if ($inlined) {
    422422            die "Cannot inline if NoStaticTables is set." if ($interface->extendedAttributes->{"JSNoStaticTables"});
    423             push(@getOwnPropertySlotImpl, "    return ${namespaceMaybe}getStaticValueSlot<$className, Base>(exec, info()->staticPropHashTable, thisObject, propertyName, slot);\n");
     423            push(@getOwnPropertySlotImpl, "    return ${namespaceMaybe}getStaticValueSlot<$className, Base>(exec, *info()->staticPropHashTable, thisObject, propertyName, slot);\n");
    424424        } else {
    425425            push(@getOwnPropertySlotImpl, "    return ${namespaceMaybe}getStaticValueSlot<$className, Base>(exec, " . hashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $className) . ", thisObject, propertyName, slot);\n");
     
    16261626
    16271627    if ($interface->extendedAttributes->{"JSNoStaticTables"}) {
    1628         push(@implContent, "static const HashTable* get${className}PrototypeTable(ExecState* exec)\n");
     1628        push(@implContent, "static const HashTable& get${className}PrototypeTable(ExecState* exec)\n");
    16291629        push(@implContent, "{\n");
    1630         push(@implContent, "    return getHashTableForGlobalData(exec->vm(), &${className}PrototypeTable);\n");
     1630        push(@implContent, "    return getHashTableForGlobalData(exec->vm(), ${className}PrototypeTable);\n");
    16311631        push(@implContent, "}\n\n");
    16321632        push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleInterfaceName}Prototype\", &Base::s_info, 0, get${className}PrototypeTable, CREATE_METHOD_TABLE(${className}Prototype) };\n\n");
     
    16701670    # - Initialize static ClassInfo object
    16711671    if ($numAttributes > 0 && $interface->extendedAttributes->{"JSNoStaticTables"}) {
    1672         push(@implContent, "static const HashTable* get${className}Table(ExecState* exec)\n");
     1672        push(@implContent, "static const HashTable& get${className}Table(ExecState* exec)\n");
    16731673        push(@implContent, "{\n");
    1674         push(@implContent, "    return getHashTableForGlobalData(exec->vm(), &${className}Table);\n");
     1674        push(@implContent, "    return getHashTableForGlobalData(exec->vm(), ${className}Table);\n");
    16751675        push(@implContent, "}\n\n");
    16761676    }
     
    40614061    } else {
    40624062        if ($interface->extendedAttributes->{"JSNoStaticTables"}) {
    4063             push(@$outputArray, "static const HashTable* get${constructorClassName}Table(ExecState* exec)\n");
     4063            push(@$outputArray, "static const HashTable& get${constructorClassName}Table(ExecState* exec)\n");
    40644064            push(@$outputArray, "{\n");
    4065             push(@$outputArray, "    return getHashTableForGlobalData(exec->vm(), &${constructorClassName}Table);\n");
     4065            push(@$outputArray, "    return getHashTableForGlobalData(exec->vm(), ${constructorClassName}Table);\n");
    40664066            push(@$outputArray, "}\n\n");
    40674067            push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleInterfaceName}Constructor\", &Base::s_info, 0, get${constructorClassName}Table, CREATE_METHOD_TABLE($constructorClassName) };\n\n");
Note: See TracChangeset for help on using the changeset viewer.