Ignore:
Timestamp:
Sep 6, 2013, 3:32:08 PM (12 years ago)
Author:
[email protected]
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.