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/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()))
Note: See TracChangeset for help on using the changeset viewer.