Changeset 97015 in webkit


Ignore:
Timestamp:
Oct 8, 2011 2:31:32 PM (13 years ago)
Author:
mhahnenberg@apple.com
Message:

Add static version of JSCell::getOwnPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=69593

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Added static version of getOwnPropertySlot to every class that overrides
JSCell::getOwnPropertySlot. The virtual versions now call the static versions.
This is the first step in de-virtualizing JSCell::getOwnPropertySlot.

(JSC::DebuggerActivation::getOwnPropertySlot):

  • debugger/DebuggerActivation.h:
  • runtime/Arguments.cpp:

(JSC::Arguments::getOwnPropertySlot):

  • runtime/Arguments.h:
  • runtime/ArrayConstructor.h:
  • runtime/ArrayPrototype.cpp:

(JSC::ArrayPrototype::getOwnPropertySlot):

  • runtime/ArrayPrototype.h:
  • runtime/BooleanPrototype.cpp:

(JSC::BooleanPrototype::getOwnPropertySlot):

  • runtime/BooleanPrototype.h:
  • runtime/DateConstructor.cpp:

(JSC::DateConstructor::getOwnPropertySlot):

  • runtime/DateConstructor.h:
  • runtime/DatePrototype.cpp:

(JSC::DatePrototype::getOwnPropertySlot):

  • runtime/DatePrototype.h:
  • runtime/ErrorPrototype.cpp:

(JSC::ErrorPrototype::getOwnPropertySlot):

  • runtime/ErrorPrototype.h:
  • runtime/JSActivation.cpp:

(JSC::JSActivation::getOwnPropertySlot):

  • runtime/JSActivation.h:
  • runtime/JSArray.cpp:

(JSC::JSArray::getOwnPropertySlot):

  • runtime/JSArray.h:
  • runtime/JSBoundFunction.cpp:

(JSC::JSBoundFunction::getOwnPropertySlot):

  • runtime/JSBoundFunction.h:
  • runtime/JSByteArray.cpp:

(JSC::JSByteArray::getOwnPropertySlot):

  • runtime/JSByteArray.h:
  • runtime/JSCell.cpp:

(JSC::JSCell::getOwnPropertySlot):

  • runtime/JSCell.h:
  • runtime/JSFunction.cpp:

(JSC::JSFunction::getOwnPropertySlot):

  • runtime/JSFunction.h:
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::getOwnPropertySlot):

  • runtime/JSGlobalObject.h:
  • runtime/JSNotAnObject.cpp:

(JSC::JSNotAnObject::getOwnPropertySlot):

  • runtime/JSNotAnObject.h:
  • runtime/JSONObject.cpp:

(JSC::JSONObject::getOwnPropertySlot):

  • runtime/JSONObject.h:
  • runtime/JSObject.cpp:

(JSC::JSObject::getOwnPropertySlot):

  • runtime/JSObject.h:

(JSC::JSObject::getOwnPropertySlot):

  • runtime/JSStaticScopeObject.cpp:

(JSC::JSStaticScopeObject::getOwnPropertySlot):

  • runtime/JSStaticScopeObject.h:
  • runtime/JSString.cpp:

(JSC::JSString::getOwnPropertySlot):

  • runtime/JSString.h:
  • runtime/MathObject.cpp:

(JSC::MathObject::getOwnPropertySlot):

  • runtime/MathObject.h:
  • runtime/NumberConstructor.cpp:

(JSC::NumberConstructor::getOwnPropertySlot):

  • runtime/NumberConstructor.h:
  • runtime/NumberPrototype.cpp:

(JSC::NumberPrototype::getOwnPropertySlot):

  • runtime/NumberPrototype.h:
  • runtime/ObjectConstructor.cpp:

(JSC::ObjectConstructor::getOwnPropertySlot):

  • runtime/ObjectConstructor.h:
  • runtime/ObjectPrototype.cpp:

(JSC::ObjectPrototype::getOwnPropertySlot):

  • runtime/ObjectPrototype.h:
  • runtime/RegExpConstructor.cpp:

(JSC::RegExpConstructor::getOwnPropertySlot):

  • runtime/RegExpConstructor.h:
  • runtime/RegExpMatchesArray.h:

(JSC::RegExpMatchesArray::getOwnPropertySlot):

  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::getOwnPropertySlot):

  • runtime/RegExpObject.h:
  • runtime/RegExpPrototype.cpp:

(JSC::RegExpPrototype::getOwnPropertySlot):

  • runtime/RegExpPrototype.h:
  • runtime/StringConstructor.cpp:

(JSC::StringConstructor::getOwnPropertySlot):

  • runtime/StringConstructor.h:
  • runtime/StringObject.cpp:

(JSC::StringObject::getOwnPropertySlot):

  • runtime/StringObject.h:
  • runtime/StringPrototype.cpp:

(JSC::StringPrototype::getOwnPropertySlot):

  • runtime/StringPrototype.h:

Source/JavaScriptGlue:

Added static version of getOwnPropertySlot to every class that overrides
JSCell::getOwnPropertySlot. The virtual versions now call the static versions.
This is the first step in de-virtualizing JSCell::getOwnPropertySlot.

  • UserObjectImp.cpp:

(UserObjectImp::getOwnPropertySlot):

  • UserObjectImp.h:

Source/WebCore:

No new tests.

Added static version of getOwnPropertySlot to every class that overrides
JSCell::getOwnPropertySlot. The virtual versions now call the static versions.
This is the first step in de-virtualizing JSCell::getOwnPropertySlot.

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::getOwnPropertySlot):

  • bindings/js/JSDOMWindowShell.h:
  • bridge/objc/objc_runtime.h:
  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertySlot):

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
(JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):

  • bridge/qt/qt_runtime.h:
  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::getOwnPropertySlot):

  • bridge/runtime_array.h:
  • bridge/runtime_method.cpp:

(JSC::RuntimeMethod::getOwnPropertySlot):

  • bridge/runtime_method.h:
  • bridge/runtime_object.cpp:

(JSC::Bindings::RuntimeObject::getOwnPropertySlot):

  • bridge/runtime_object.h:

Source/WebKit2:

Added static version of getOwnPropertySlot to every class that overrides
JSCell::getOwnPropertySlot. The virtual versions now call the static versions.
This is the first step in de-virtualizing JSCell::getOwnPropertySlot.

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::JSNPObject::getOwnPropertySlot):

  • WebProcess/Plugins/Netscape/JSNPObject.h:
Location:
trunk/Source
Files:
83 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r97014 r97015  
     12011-10-08  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Add static version of JSCell::getOwnPropertySlot
     4        https://bugs.webkit.org/show_bug.cgi?id=69593
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Added static version of getOwnPropertySlot to every class that overrides
     9        JSCell::getOwnPropertySlot.  The virtual versions now call the static versions.
     10        This is the first step in de-virtualizing JSCell::getOwnPropertySlot.
     11
     12        * JavaScriptCore.exp:
     13        * debugger/DebuggerActivation.cpp:
     14        (JSC::DebuggerActivation::getOwnPropertySlot):
     15        * debugger/DebuggerActivation.h:
     16        * runtime/Arguments.cpp:
     17        (JSC::Arguments::getOwnPropertySlot):
     18        * runtime/Arguments.h:
     19        * runtime/ArrayConstructor.h:
     20        * runtime/ArrayPrototype.cpp:
     21        (JSC::ArrayPrototype::getOwnPropertySlot):
     22        * runtime/ArrayPrototype.h:
     23        * runtime/BooleanPrototype.cpp:
     24        (JSC::BooleanPrototype::getOwnPropertySlot):
     25        * runtime/BooleanPrototype.h:
     26        * runtime/DateConstructor.cpp:
     27        (JSC::DateConstructor::getOwnPropertySlot):
     28        * runtime/DateConstructor.h:
     29        * runtime/DatePrototype.cpp:
     30        (JSC::DatePrototype::getOwnPropertySlot):
     31        * runtime/DatePrototype.h:
     32        * runtime/ErrorPrototype.cpp:
     33        (JSC::ErrorPrototype::getOwnPropertySlot):
     34        * runtime/ErrorPrototype.h:
     35        * runtime/JSActivation.cpp:
     36        (JSC::JSActivation::getOwnPropertySlot):
     37        * runtime/JSActivation.h:
     38        * runtime/JSArray.cpp:
     39        (JSC::JSArray::getOwnPropertySlot):
     40        * runtime/JSArray.h:
     41        * runtime/JSBoundFunction.cpp:
     42        (JSC::JSBoundFunction::getOwnPropertySlot):
     43        * runtime/JSBoundFunction.h:
     44        * runtime/JSByteArray.cpp:
     45        (JSC::JSByteArray::getOwnPropertySlot):
     46        * runtime/JSByteArray.h:
     47        * runtime/JSCell.cpp:
     48        (JSC::JSCell::getOwnPropertySlot):
     49        * runtime/JSCell.h:
     50        * runtime/JSFunction.cpp:
     51        (JSC::JSFunction::getOwnPropertySlot):
     52        * runtime/JSFunction.h:
     53        * runtime/JSGlobalObject.cpp:
     54        (JSC::JSGlobalObject::getOwnPropertySlot):
     55        * runtime/JSGlobalObject.h:
     56        * runtime/JSNotAnObject.cpp:
     57        (JSC::JSNotAnObject::getOwnPropertySlot):
     58        * runtime/JSNotAnObject.h:
     59        * runtime/JSONObject.cpp:
     60        (JSC::JSONObject::getOwnPropertySlot):
     61        * runtime/JSONObject.h:
     62        * runtime/JSObject.cpp:
     63        (JSC::JSObject::getOwnPropertySlot):
     64        * runtime/JSObject.h:
     65        (JSC::JSObject::getOwnPropertySlot):
     66        * runtime/JSStaticScopeObject.cpp:
     67        (JSC::JSStaticScopeObject::getOwnPropertySlot):
     68        * runtime/JSStaticScopeObject.h:
     69        * runtime/JSString.cpp:
     70        (JSC::JSString::getOwnPropertySlot):
     71        * runtime/JSString.h:
     72        * runtime/MathObject.cpp:
     73        (JSC::MathObject::getOwnPropertySlot):
     74        * runtime/MathObject.h:
     75        * runtime/NumberConstructor.cpp:
     76        (JSC::NumberConstructor::getOwnPropertySlot):
     77        * runtime/NumberConstructor.h:
     78        * runtime/NumberPrototype.cpp:
     79        (JSC::NumberPrototype::getOwnPropertySlot):
     80        * runtime/NumberPrototype.h:
     81        * runtime/ObjectConstructor.cpp:
     82        (JSC::ObjectConstructor::getOwnPropertySlot):
     83        * runtime/ObjectConstructor.h:
     84        * runtime/ObjectPrototype.cpp:
     85        (JSC::ObjectPrototype::getOwnPropertySlot):
     86        * runtime/ObjectPrototype.h:
     87        * runtime/RegExpConstructor.cpp:
     88        (JSC::RegExpConstructor::getOwnPropertySlot):
     89        * runtime/RegExpConstructor.h:
     90        * runtime/RegExpMatchesArray.h:
     91        (JSC::RegExpMatchesArray::getOwnPropertySlot):
     92        * runtime/RegExpObject.cpp:
     93        (JSC::RegExpObject::getOwnPropertySlot):
     94        * runtime/RegExpObject.h:
     95        * runtime/RegExpPrototype.cpp:
     96        (JSC::RegExpPrototype::getOwnPropertySlot):
     97        * runtime/RegExpPrototype.h:
     98        * runtime/StringConstructor.cpp:
     99        (JSC::StringConstructor::getOwnPropertySlot):
     100        * runtime/StringConstructor.h:
     101        * runtime/StringObject.cpp:
     102        (JSC::StringObject::getOwnPropertySlot):
     103        * runtime/StringObject.h:
     104        * runtime/StringPrototype.cpp:
     105        (JSC::StringPrototype::getOwnPropertySlot):
     106        * runtime/StringPrototype.h:
     107
    11082011-10-08  Yuqiang Xian  <yuqiang.xian@intel.com>
    2109
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r97006 r97015  
    324324__ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEjbRNS_15PutPropertySlotE
    325325__ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateEjNS_7JSValueEj
     326__ZN3JSC8JSObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE
    326327__ZN3JSC8JSObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
    327328__ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp

    r97002 r97015  
    6363bool DebuggerActivation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    6464{
    65     return m_activation->getOwnPropertySlot(exec, propertyName, slot);
     65    return getOwnPropertySlot(this, exec, propertyName, slot);
     66}
     67
     68bool DebuggerActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     69{
     70    return static_cast<DebuggerActivation*>(cell)->m_activation->getOwnPropertySlot(exec, propertyName, slot);
    6671}
    6772
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h

    r97002 r97015  
    4545        virtual UString className() const;
    4646        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     47        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    4748        virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
    4849        static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/Arguments.cpp

    r97002 r97015  
    148148bool Arguments::getOwnPropertySlot(ExecState* exec, unsigned i, PropertySlot& slot)
    149149{
    150     if (i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) {
    151         if (i < d->numParameters) {
    152             slot.setValue(d->registers[d->firstParameterIndex + i].get());
     150    return getOwnPropertySlot(this, exec, i, slot);
     151}
     152
     153bool Arguments::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot)
     154{
     155    Arguments* thisObject = static_cast<Arguments*>(cell);
     156    if (i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
     157        if (i < thisObject->d->numParameters) {
     158            slot.setValue(thisObject->d->registers[thisObject->d->firstParameterIndex + i].get());
    153159        } else
    154             slot.setValue(d->extraArguments[i - d->numParameters].get());
    155         return true;
    156     }
    157 
    158     return JSObject::getOwnPropertySlot(exec, Identifier(exec, UString::number(i)), slot);
     160            slot.setValue(thisObject->d->extraArguments[i - thisObject->d->numParameters].get());
     161        return true;
     162    }
     163
     164    return JSObject::getOwnPropertySlot(thisObject, exec, Identifier(exec, UString::number(i)), slot);
    159165}
    160166   
  • trunk/Source/JavaScriptCore/runtime/Arguments.h

    r97002 r97015  
    126126        void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
    127127        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     128        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    128129        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
     130        static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    129131        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    130132        virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r97006 r97015  
    5353        ArrayConstructor(JSGlobalObject*, Structure*);
    5454        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     55        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
     56
    5557        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5658
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r96438 r97015  
    128128bool ArrayPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    129129{
    130     return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), this, propertyName, slot);
     130    return getOwnPropertySlot(this, exec, propertyName, slot);
     131}
     132
     133bool ArrayPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     134{
     135    return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), static_cast<ArrayPrototype*>(cell), propertyName, slot);
    131136}
    132137
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h

    r94929 r97015  
    4141        }
    4242       
    43         bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     43        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     44        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    4445        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    4546
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp

    r95936 r97015  
    6565bool BooleanPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    6666{
    67     return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, slot);
     67    return getOwnPropertySlot(this, exec, propertyName, slot);
     68}
     69
     70bool BooleanPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     71{
     72    return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), static_cast<BooleanPrototype*>(cell), propertyName, slot);
    6873}
    6974
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h

    r95108 r97015  
    5151        BooleanPrototype(ExecState*, Structure*);
    5252        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     53        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
     54
    5355        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5456    };
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r97006 r97015  
    8888bool DateConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    8989{
    90     return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), this, propertyName, slot);
     90    return getOwnPropertySlot(this, exec, propertyName, slot);
     91}
     92
     93bool DateConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     94{
     95    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), static_cast<DateConstructor*>(cell), propertyName, slot);
    9196}
    9297
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r97006 r97015  
    5757
    5858        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     59        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
     60
    5961        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    6062    };
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp

    r95936 r97015  
    446446bool DatePrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    447447{
    448     return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), this, propertyName, slot);
    449 }
    450 
     448    return getOwnPropertySlot(this, exec, propertyName, slot);
     449}
     450
     451bool DatePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     452{
     453    return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), static_cast<DatePrototype*>(cell), propertyName, slot);
     454}
    451455
    452456bool DatePrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.h

    r95108 r97015  
    4242        }
    4343        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     44        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
     45
    4446        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    4547
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp

    r96438 r97015  
    6565bool ErrorPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    6666{
    67     return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), this, propertyName, slot);
     67    return getOwnPropertySlot(this, exec, propertyName, slot);
     68}
     69
     70bool ErrorPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     71{
     72    return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), static_cast<ErrorPrototype*>(cell), propertyName, slot);
    6873}
    6974
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h

    r94929 r97015  
    5454    private:
    5555        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     56        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5657        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5758    };
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r97002 r97015  
    144144bool JSActivation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    145145{
     146    return getOwnPropertySlot(this, exec, propertyName, slot);
     147}
     148
     149bool JSActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     150{
     151    JSActivation* thisObject = static_cast<JSActivation*>(cell);
    146152    if (propertyName == exec->propertyNames().arguments) {
    147         slot.setCustom(this, getArgumentsGetter());
     153        slot.setCustom(thisObject, thisObject->getArgumentsGetter());
    148154        return true;
    149155    }
    150156
    151     if (symbolTableGet(propertyName, slot))
    152         return true;
    153 
    154     if (WriteBarrierBase<Unknown>* location = getDirectLocation(exec->globalData(), propertyName)) {
     157    if (thisObject->symbolTableGet(propertyName, slot))
     158        return true;
     159
     160    if (WriteBarrierBase<Unknown>* location = thisObject->getDirectLocation(exec->globalData(), propertyName)) {
    155161        slot.setValue(location->get());
    156162        return true;
     
    159165    // We don't call through to JSObject because there's no way to give an
    160166    // activation object getter properties or a prototype.
    161     ASSERT(!hasGetterSetterProperties());
    162     ASSERT(prototype().isNull());
     167    ASSERT(!thisObject->hasGetterSetterProperties());
     168    ASSERT(thisObject->prototype().isNull());
    163169    return false;
    164170}
  • trunk/Source/JavaScriptCore/runtime/JSActivation.h

    r97002 r97015  
    6363
    6464        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     65        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    6566        virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode);
    6667
  • trunk/Source/JavaScriptCore/runtime/JSArray.cpp

    r97002 r97015  
    248248bool JSArray::getOwnPropertySlot(ExecState* exec, unsigned i, PropertySlot& slot)
    249249{
    250     ArrayStorage* storage = m_storage;
     250    return getOwnPropertySlot(this, exec, i, slot);
     251}
     252
     253bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot)
     254{
     255    JSArray* thisObject = static_cast<JSArray*>(cell);
     256    ArrayStorage* storage = thisObject->m_storage;
    251257   
    252258    if (i >= storage->m_length) {
    253259        if (i > MAX_ARRAY_INDEX)
    254             return getOwnPropertySlot(exec, Identifier::from(exec, i), slot);
     260            return thisObject->getOwnPropertySlot(exec, Identifier::from(exec, i), slot);
    255261        return false;
    256262    }
    257263
    258     if (i < m_vectorLength) {
     264    if (i < thisObject->m_vectorLength) {
    259265        JSValue value = storage->m_vector[i].get();
    260266        if (value) {
     
    272278    }
    273279
    274     return JSObject::getOwnPropertySlot(exec, Identifier::from(exec, i), slot);
     280    return JSObject::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, i), slot);
    275281}
    276282
    277283bool JSArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    278284{
     285    return getOwnPropertySlot(this, exec, propertyName, slot);
     286}
     287
     288bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     289{
     290    JSArray* thisObject = static_cast<JSArray*>(cell);
    279291    if (propertyName == exec->propertyNames().length) {
    280         slot.setValue(jsNumber(length()));
     292        slot.setValue(jsNumber(thisObject->length()));
    281293        return true;
    282294    }
     
    285297    unsigned i = propertyName.toArrayIndex(isArrayIndex);
    286298    if (isArrayIndex)
    287         return JSArray::getOwnPropertySlot(exec, i, slot);
    288 
    289     return JSObject::getOwnPropertySlot(exec, propertyName, slot);
     299        return JSArray::getOwnPropertySlot(thisObject, exec, i, slot);
     300
     301    return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    290302}
    291303
  • trunk/Source/JavaScriptCore/runtime/JSArray.h

    r97002 r97015  
    9696
    9797        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     98        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    9899        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
     100        static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    99101        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    100102        virtual void put(ExecState*, unsigned propertyName, JSValue); // FIXME: Make protected and add setItem.
  • trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp

    r96346 r97015  
    9999bool JSBoundFunction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    100100{
     101    return getOwnPropertySlot(this, exec, propertyName, slot);
     102}
     103
     104bool JSBoundFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     105{
    101106    if (propertyName == exec->propertyNames().arguments) {
    102107        throwTypeError(exec, StrictModeArgumentsAccessError);
     
    111116    }
    112117
    113     return Base::getOwnPropertySlot(exec, propertyName, slot);
     118    return Base::getOwnPropertySlot(cell, exec, propertyName, slot);
    114119}
    115120
  • trunk/Source/JavaScriptCore/runtime/JSBoundFunction.h

    r96346 r97015  
    4141
    4242    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     43    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    4344    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    4445
  • trunk/Source/JavaScriptCore/runtime/JSByteArray.cpp

    r96992 r97015  
    5757bool JSByteArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    5858{
     59    return getOwnPropertySlot(this, exec, propertyName, slot);
     60}
     61
     62bool JSByteArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     63{
     64    JSByteArray* thisObject = static_cast<JSByteArray*>(cell);
    5965    bool ok;
    6066    unsigned index = propertyName.toUInt32(ok);
    61     if (ok && canAccessIndex(index)) {
    62         slot.setValue(getIndex(exec, index));
     67    if (ok && thisObject->canAccessIndex(index)) {
     68        slot.setValue(thisObject->getIndex(exec, index));
    6369        return true;
    6470    }
    65     return JSObject::getOwnPropertySlot(exec, propertyName, slot);
     71    return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    6672}
    6773
     
    7985bool JSByteArray::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
    8086{
    81     if (canAccessIndex(propertyName)) {
    82         slot.setValue(getIndex(exec, propertyName));
     87    return getOwnPropertySlot(this, exec, propertyName, slot);
     88}
     89
     90bool JSByteArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     91{
     92    JSByteArray* thisObject = static_cast<JSByteArray*>(cell);
     93    if (thisObject->canAccessIndex(propertyName)) {
     94        slot.setValue(thisObject->getIndex(exec, propertyName));
    8395        return true;
    8496    }
    85     return JSObject::getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot);
     97    return JSObject::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
    8698}
    8799
  • trunk/Source/JavaScriptCore/runtime/JSByteArray.h

    r96992 r97015  
    9090
    9191        virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     92        static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    9293        virtual bool getOwnPropertySlot(JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
     94        static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
    9395        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    9496        virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/JSCell.cpp

    r97006 r97015  
    7272bool JSCell::getOwnPropertySlot(ExecState* exec, const Identifier& identifier, PropertySlot& slot)
    7373{
     74    return getOwnPropertySlot(this, exec, identifier, slot);
     75}
     76
     77bool JSCell::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& identifier, PropertySlot& slot)
     78{
    7479    // This is not a general purpose implementation of getOwnPropertySlot.
    7580    // It should only be called by JSValue::get.
    7681    // It calls getPropertySlot, not getOwnPropertySlot.
    77     JSObject* object = toObject(exec, exec->lexicalGlobalObject());
     82    JSObject* object = cell->toObject(exec, exec->lexicalGlobalObject());
    7883    slot.setBase(object);
    7984    if (!object->getPropertySlot(exec, identifier, slot))
     
    8489bool JSCell::getOwnPropertySlot(ExecState* exec, unsigned identifier, PropertySlot& slot)
    8590{
     91    return getOwnPropertySlot(this, exec, identifier, slot);
     92}
     93
     94bool JSCell::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned identifier, PropertySlot& slot)
     95{
    8696    // This is not a general purpose implementation of getOwnPropertySlot.
    8797    // It should only be called by JSValue::get.
    8898    // It calls getPropertySlot, not getOwnPropertySlot.
    89     JSObject* object = toObject(exec, exec->lexicalGlobalObject());
     99    JSObject* object = cell->toObject(exec, exec->lexicalGlobalObject());
    90100    slot.setBase(object);
    91101    if (!object->getPropertySlot(exec, identifier, slot))
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r97006 r97015  
    137137        // Base implementation; for non-object classes implements getPropertySlot.
    138138        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     139        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    139140        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
     141        static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    140142       
    141143        WriteBarrier<Structure> m_structure;
  • trunk/Source/JavaScriptCore/runtime/JSFunction.cpp

    r97006 r97015  
    205205bool JSFunction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    206206{
    207     if (isHostFunction())
    208         return Base::getOwnPropertySlot(exec, propertyName, slot);
     207    return getOwnPropertySlot(this, exec, propertyName, slot);
     208}
     209
     210bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     211{
     212    JSFunction* thisObject = static_cast<JSFunction*>(cell);
     213    if (thisObject->isHostFunction())
     214        return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    209215
    210216    if (propertyName == exec->propertyNames().prototype) {
    211         WriteBarrierBase<Unknown>* location = getDirectLocation(exec->globalData(), propertyName);
     217        WriteBarrierBase<Unknown>* location = thisObject->getDirectLocation(exec->globalData(), propertyName);
    212218
    213219        if (!location) {
    214             JSObject* prototype = constructEmptyObject(exec, globalObject()->emptyObjectStructure());
    215             prototype->putDirect(exec->globalData(), exec->propertyNames().constructor, this, DontEnum);
     220            JSObject* prototype = constructEmptyObject(exec, thisObject->globalObject()->emptyObjectStructure());
     221            prototype->putDirect(exec->globalData(), exec->propertyNames().constructor, thisObject, DontEnum);
    216222            PutPropertySlot slot;
    217             putDirect(exec->globalData(), exec->propertyNames().prototype, prototype, DontDelete | DontEnum, false, slot);
    218             location = getDirectLocation(exec->globalData(), exec->propertyNames().prototype);
    219         }
    220 
    221         slot.setValue(this, location->get(), offsetForLocation(location));
     223            thisObject->putDirect(exec->globalData(), exec->propertyNames().prototype, prototype, DontDelete | DontEnum, false, slot);
     224            location = thisObject->getDirectLocation(exec->globalData(), exec->propertyNames().prototype);
     225        }
     226
     227        slot.setValue(thisObject, location->get(), thisObject->offsetForLocation(location));
    222228    }
    223229
    224230    if (propertyName == exec->propertyNames().arguments) {
    225         if (jsExecutable()->isStrictMode()) {
     231        if (thisObject->jsExecutable()->isStrictMode()) {
    226232            throwTypeError(exec, StrictModeArgumentsAccessError);
    227233            slot.setValue(jsNull());
     
    229235        }
    230236   
    231         slot.setCacheableCustom(this, argumentsGetter);
     237        slot.setCacheableCustom(thisObject, argumentsGetter);
    232238        return true;
    233239    }
    234240
    235241    if (propertyName == exec->propertyNames().length) {
    236         slot.setCacheableCustom(this, lengthGetter);
     242        slot.setCacheableCustom(thisObject, lengthGetter);
    237243        return true;
    238244    }
    239245
    240246    if (propertyName == exec->propertyNames().caller) {
    241         if (jsExecutable()->isStrictMode()) {
     247        if (thisObject->jsExecutable()->isStrictMode()) {
    242248            throwTypeError(exec, StrictModeCallerAccessError);
    243249            slot.setValue(jsNull());
    244250            return true;
    245251        }
    246         slot.setCacheableCustom(this, callerGetter);
    247         return true;
    248     }
    249 
    250     return Base::getOwnPropertySlot(exec, propertyName, slot);
     252        slot.setCacheableCustom(thisObject, callerGetter);
     253        return true;
     254    }
     255
     256    return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    251257}
    252258
  • trunk/Source/JavaScriptCore/runtime/JSFunction.h

    r97006 r97015  
    133133
    134134        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     135        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    135136        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    136137        virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r97006 r97015  
    423423bool JSGlobalObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    424424{
    425     if (getStaticFunctionSlot<JSVariableObject>(exec, ExecState::globalObjectTable(exec), this, propertyName, slot))
     425    return getOwnPropertySlot(this, exec, propertyName, slot);
     426}
     427
     428bool JSGlobalObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     429{
     430    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(cell);
     431    if (getStaticFunctionSlot<JSVariableObject>(exec, ExecState::globalObjectTable(exec), thisObject, propertyName, slot))
    426432        return true;
    427     return symbolTableGet(propertyName, slot);
     433    return thisObject->symbolTableGet(propertyName, slot);
    428434}
    429435
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r97006 r97015  
    181181
    182182        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     183        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    183184        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    184185        virtual bool hasOwnPropertyForWrite(ExecState*, const Identifier&);
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.cpp

    r97002 r97015  
    5858}
    5959
     60bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, const Identifier& identifier, PropertySlot& slot)
     61{
     62    return getOwnPropertySlot(this, exec, identifier, slot);
     63}
     64
    6065// JSObject methods
    61 bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, const Identifier&, PropertySlot&)
     66bool JSNotAnObject::getOwnPropertySlot(JSCell*, ExecState* exec, const Identifier&, PropertySlot&)
    6267{
    6368    ASSERT_UNUSED(exec, exec->hadException());
     
    6570}
    6671
    67 bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, unsigned, PropertySlot&)
     72bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
     73{
     74    return getOwnPropertySlot(this, exec, propertyName, slot);
     75}
     76
     77bool JSNotAnObject::getOwnPropertySlot(JSCell*, ExecState* exec, unsigned, PropertySlot&)
    6878{
    6979    ASSERT_UNUSED(exec, exec->hadException());
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h

    r97002 r97015  
    7272        // JSObject methods
    7373        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     74        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    7475        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
     76        static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    7577        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    7678
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r97006 r97015  
    601601bool JSONObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    602602{
    603     return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), this, propertyName, slot);
     603    return getOwnPropertySlot(this, exec, propertyName, slot);
     604}
     605
     606bool JSONObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     607{
     608    return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), static_cast<JSONObject*>(cell), propertyName, slot);
    604609}
    605610
  • trunk/Source/JavaScriptCore/runtime/JSONObject.h

    r95901 r97015  
    5858        JSONObject(JSGlobalObject*, Structure*);
    5959        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     60        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    6061        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    6162
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r97006 r97015  
    9696bool JSObject::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
    9797{
    98     return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot);
     98    return getOwnPropertySlot(this, exec, propertyName, slot);
     99}
     100
     101bool JSObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     102{
     103    return static_cast<JSObject*>(cell)->getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot);
    99104}
    100105
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r97006 r97015  
    103103
    104104        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     105        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    105106        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
     107        static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    106108        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    107109
     
    513515}
    514516
     517ALWAYS_INLINE bool JSObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     518{
     519    return getOwnPropertySlot(this, exec, propertyName, slot);
     520}
     521
    515522// It may seem crazy to inline a function this large, especially a virtual function,
    516523// but it makes a big difference to property lookup that derived classes can inline their
    517524// base class call to this.
    518 ALWAYS_INLINE bool JSObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    519 {
    520     return inlineGetOwnPropertySlot(exec, propertyName, slot);
     525ALWAYS_INLINE bool JSObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     526{
     527    return static_cast<JSObject*>(cell)->inlineGetOwnPropertySlot(exec, propertyName, slot);
    521528}
    522529
  • trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp

    r96992 r97015  
    9292}
    9393
    94 bool JSStaticScopeObject::getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot& slot)
     94bool JSStaticScopeObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    9595{
    96     return symbolTableGet(propertyName, slot);
     96    return getOwnPropertySlot(this, exec, propertyName, slot);
     97}
     98
     99bool JSStaticScopeObject::getOwnPropertySlot(JSCell* cell, ExecState*, const Identifier& propertyName, PropertySlot& slot)
     100{
     101    return static_cast<JSStaticScopeObject*>(cell)->symbolTableGet(propertyName, slot);
    97102}
    98103
  • trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.h

    r96992 r97015  
    4646        virtual JSObject* toThisObject(ExecState*) const;
    4747        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     48        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    4849        virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&);
    4950        static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r96143 r97015  
    316316bool JSString::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    317317{
     318    return getOwnPropertySlot(this, exec, propertyName, slot);
     319}
     320
     321bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     322{
     323    JSString* thisObject = static_cast<JSString*>(cell);
    318324    // The semantics here are really getPropertySlot, not getOwnPropertySlot.
    319325    // This function should only be called by JSValue::get.
    320     if (getStringPropertySlot(exec, propertyName, slot))
     326    if (thisObject->getStringPropertySlot(exec, propertyName, slot))
    321327        return true;
    322328    if (propertyName == exec->propertyNames().underscoreProto) {
     
    324330        return true;
    325331    }
    326     slot.setBase(this);
     332    slot.setBase(thisObject);
    327333    JSObject* object;
    328334    for (JSValue prototype = exec->lexicalGlobalObject()->stringPrototype(); !prototype.isNull(); prototype = object->prototype()) {
     
    364370bool JSString::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
    365371{
     372    return getOwnPropertySlot(this, exec, propertyName, slot);
     373}
     374
     375bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     376{
     377    JSString* thisObject = static_cast<JSString*>(cell);
    366378    // The semantics here are really getPropertySlot, not getOwnPropertySlot.
    367379    // This function should only be called by JSValue::get.
    368     if (getStringPropertySlot(exec, propertyName, slot))
    369         return true;
    370     return JSString::getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot);
     380    if (thisObject->getStringPropertySlot(exec, propertyName, slot))
     381        return true;
     382    return JSString::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
    371383}
    372384
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r96983 r97015  
    509509        // Actually getPropertySlot, not getOwnPropertySlot (see JSCell).
    510510        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     511        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    511512        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
     513        static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    512514        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    513515
  • trunk/Source/JavaScriptCore/runtime/MathObject.cpp

    r95936 r97015  
    107107bool MathObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    108108{
    109     return getStaticFunctionSlot<JSObject>(exec, ExecState::mathTable(exec), this, propertyName, slot);
     109    return getOwnPropertySlot(this, exec, propertyName, slot);
     110}
     111
     112bool MathObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     113{
     114    return getStaticFunctionSlot<JSObject>(exec, ExecState::mathTable(exec), static_cast<MathObject*>(cell), propertyName, slot);
    110115}
    111116
  • trunk/Source/JavaScriptCore/runtime/MathObject.h

    r94929 r97015  
    4040        }
    4141        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     42        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    4243        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    4344
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r97006 r97015  
    7474bool NumberConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    7575{
    76     return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), this, propertyName, slot);
     76    return getOwnPropertySlot(this, exec, propertyName, slot);
     77}
     78
     79bool NumberConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     80{
     81    return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), static_cast<NumberConstructor*>(cell), propertyName, slot);
    7782}
    7883
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r97006 r97015  
    4040
    4141        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     42        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    4243        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    4344        JSValue getValueProperty(ExecState*, int token) const;
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp

    r96673 r97015  
    8686bool NumberPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    8787{
    88     return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), this, propertyName, slot);
     88    return getOwnPropertySlot(this, exec, propertyName, slot);
     89}
     90
     91bool NumberPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     92{
     93    return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), static_cast<NumberPrototype*>(cell), propertyName, slot);
    8994}
    9095
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.h

    r95893 r97015  
    5151        NumberPrototype(ExecState*, Structure*);
    5252        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     53        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5354        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5455    };
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r97006 r97015  
    9292bool ObjectConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    9393{
    94     return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), this, propertyName, slot);
     94    return getOwnPropertySlot(this, exec, propertyName, slot);
     95}
     96
     97bool ObjectConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     98{
     99    return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), static_cast<ObjectConstructor*>(cell), propertyName, slot);
    95100}
    96101
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h

    r97006 r97015  
    4040
    4141        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     42        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    4243        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    4344
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp

    r96992 r97015  
    9595bool ObjectPrototype::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
    9696{
    97     if (m_hasNoPropertiesWithUInt32Names)
     97    return getOwnPropertySlot(this, exec, propertyName, slot);
     98}
     99
     100bool ObjectPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     101{
     102    ObjectPrototype* thisObject = static_cast<ObjectPrototype*>(cell);
     103    if (thisObject->m_hasNoPropertiesWithUInt32Names)
    98104        return false;
    99     return JSNonFinalObject::getOwnPropertySlot(exec, propertyName, slot);
    100 }
    101 
    102 bool ObjectPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    103 {
    104     return getStaticFunctionSlot<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), this, propertyName, slot);
     105    return JSNonFinalObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
     106}
     107
     108bool ObjectPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     109{
     110    return getOwnPropertySlot(this, exec, propertyName, slot);
     111}
     112
     113bool ObjectPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     114{
     115    return getStaticFunctionSlot<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), static_cast<ObjectPrototype*>(cell), propertyName, slot);
    105116}
    106117
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h

    r96992 r97015  
    5555
    5656        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     57        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5758        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
     59        static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    5860        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5961
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r97006 r97015  
    205205bool RegExpConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    206206{
    207     return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), this, propertyName, slot);
     207    return getOwnPropertySlot(this, exec, propertyName, slot);
     208}
     209
     210bool RegExpConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     211{
     212    return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), static_cast<RegExpConstructor*>(cell), propertyName, slot);
    208213}
    209214
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r97006 r97015  
    7676
    7777        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     78        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    7879        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    7980
  • trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h

    r97002 r97015  
    4646        virtual bool getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    4747        {
    48             if (subclassData())
    49                 fillArrayInstance(exec);
    50             return JSArray::getOwnPropertySlot(exec, propertyName, slot);
     48            return getOwnPropertySlot(this, exec, propertyName, slot);
     49        }
     50
     51        static bool getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     52        {
     53            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
     54            if (thisObject->subclassData())
     55                thisObject->fillArrayInstance(exec);
     56            return JSArray::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    5157        }
    5258
    5359        virtual bool getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
    5460        {
    55             if (subclassData())
    56                 fillArrayInstance(exec);
    57             return JSArray::getOwnPropertySlot(exec, propertyName, slot);
     61            return getOwnPropertySlot(this, exec, propertyName, slot);
     62        }
     63
     64        static bool getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     65        {
     66            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
     67            if (thisObject->subclassData())
     68                thisObject->fillArrayInstance(exec);
     69            return JSArray::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    5870        }
    5971
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp

    r96992 r97015  
    9494bool RegExpObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    9595{
    96     return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), this, propertyName, slot);
     96    return getOwnPropertySlot(this, exec, propertyName, slot);
     97}
     98
     99bool RegExpObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     100{
     101    return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), static_cast<RegExpObject*>(cell), propertyName, slot);
    97102}
    98103
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.h

    r96992 r97015  
    6767
    6868        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     69        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    6970        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    7071        virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r96438 r97015  
    7070bool RegExpPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    7171{
    72     return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), this, propertyName, slot);
     72    return getOwnPropertySlot(this, exec, propertyName, slot);
     73}
     74
     75bool RegExpPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     76{
     77    return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), static_cast<RegExpPrototype*>(cell), propertyName, slot);
    7378}
    7479
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h

    r95108 r97015  
    5151    private:
    5252        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     53        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5354        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5455    };
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r97006 r97015  
    6262bool StringConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    6363{
    64     return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), this, propertyName, slot);
     64    return getOwnPropertySlot(this, exec, propertyName, slot);
     65}
     66
     67bool StringConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     68{
     69    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), static_cast<StringConstructor*>(cell), propertyName, slot);
    6570}
    6671
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r97006 r97015  
    5757
    5858        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     59        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5960        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    6061    };
  • trunk/Source/JavaScriptCore/runtime/StringObject.cpp

    r97002 r97015  
    4444bool StringObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    4545{
    46     if (internalValue()->getStringPropertySlot(exec, propertyName, slot))
     46    return getOwnPropertySlot(this, exec, propertyName, slot);
     47}
     48
     49bool StringObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     50{
     51    StringObject* thisObject = static_cast<StringObject*>(cell);
     52    if (thisObject->internalValue()->getStringPropertySlot(exec, propertyName, slot))
    4753        return true;
    48     return JSObject::getOwnPropertySlot(exec, propertyName, slot);
     54    return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    4955}
    5056   
    5157bool StringObject::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
    5258{
    53     if (internalValue()->getStringPropertySlot(exec, propertyName, slot))
     59    return getOwnPropertySlot(this, exec, propertyName, slot);
     60}
     61
     62bool StringObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     63{
     64    StringObject* thisObject = static_cast<StringObject*>(cell);
     65    if (thisObject->internalValue()->getStringPropertySlot(exec, propertyName, slot))
    5466        return true;   
    55     return JSObject::getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot);
     67    return JSObject::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
    5668}
    5769
  • trunk/Source/JavaScriptCore/runtime/StringObject.h

    r97002 r97015  
    4848
    4949        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     50        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    5051        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
     52        static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    5153        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5254
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r95936 r97015  
    148148bool StringPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    149149{
    150     return getStaticFunctionSlot<StringObject>(exec, ExecState::stringTable(exec), this, propertyName, slot);
     150    return getOwnPropertySlot(this, exec, propertyName, slot);
     151}
     152
     153bool StringPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     154{
     155    return getStaticFunctionSlot<StringObject>(exec, ExecState::stringTable(exec), static_cast<StringPrototype*>(cell), propertyName, slot);
    151156}
    152157
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.h

    r95108 r97015  
    4444
    4545        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     46        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    4647        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    4748
  • trunk/Source/JavaScriptGlue/ChangeLog

    r97006 r97015  
     12011-10-08  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Add static version of JSCell::getOwnPropertySlot
     4        https://bugs.webkit.org/show_bug.cgi?id=69593
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Added static version of getOwnPropertySlot to every class that overrides
     9        JSCell::getOwnPropertySlot.  The virtual versions now call the static versions.
     10        This is the first step in de-virtualizing JSCell::getOwnPropertySlot.
     11
     12        * UserObjectImp.cpp:
     13        (UserObjectImp::getOwnPropertySlot):
     14        * UserObjectImp.h:
     15
    1162011-10-08  Sheriff Bot  <webkit.review.bot@gmail.com>
    217
  • trunk/Source/JavaScriptGlue/UserObjectImp.cpp

    r97006 r97015  
    131131bool UserObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
    132132{
    133     if (!fJSUserObject)
     133    return getOwnPropertySlot(this, exec, propertyName, slot);
     134}
     135
     136bool UserObjectImp::getOwnPropertySlot(JSCell* cell, ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
     137{
     138    UserObjectImp* thisObject = static_cast<UserObjectImp*>(cell);
     139    if (!thisObject->fJSUserObject)
    134140        return false;
    135141
    136142    CFStringRef cfPropName = IdentifierToCFString(propertyName);
    137     JSUserObject *jsResult = fJSUserObject->CopyProperty(cfPropName);
     143    JSUserObject* jsResult = thisObject->fJSUserObject->CopyProperty(cfPropName);
    138144    ReleaseCFType(cfPropName);
    139145    if (jsResult) {
    140         slot.setCustom(this, userObjectGetter);
     146        slot.setCustom(thisObject, userObjectGetter);
    141147        jsResult->Release();
    142148        return true;
    143149    } else {
    144         JSValue kjsValue = toPrimitive(exec);
     150        JSValue kjsValue = thisObject->toPrimitive(exec);
    145151        if (!kjsValue.isUndefinedOrNull()) {
    146152            JSObject* kjsObject = kjsValue.toObject(exec);
     
    149155        }
    150156    }
    151     return JSObject::getOwnPropertySlot(exec, propertyName, slot);
     157    return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    152158}
    153159
  • trunk/Source/JavaScriptGlue/UserObjectImp.h

    r97006 r97015  
    5757    virtual JSValue callAsFunction(ExecState *exec);
    5858    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
     59    static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&);
    5960    virtual void put(ExecState *exec, const Identifier &propertyName, JSValue value, PutPropertySlot&);
    6061    static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/WebCore/ChangeLog

    r97012 r97015  
     12011-10-08  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Add static version of JSCell::getOwnPropertySlot
     4        https://bugs.webkit.org/show_bug.cgi?id=69593
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        No new tests.
     9
     10        Added static version of getOwnPropertySlot to every class that overrides
     11        JSCell::getOwnPropertySlot.  The virtual versions now call the static versions.
     12        This is the first step in de-virtualizing JSCell::getOwnPropertySlot.
     13
     14        * bindings/js/JSDOMWindowShell.cpp:
     15        (WebCore::JSDOMWindowShell::getOwnPropertySlot):
     16        * bindings/js/JSDOMWindowShell.h:
     17        * bridge/objc/objc_runtime.h:
     18        * bridge/objc/objc_runtime.mm:
     19        (JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertySlot):
     20        * bridge/qt/qt_runtime.cpp:
     21        (JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
     22        (JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):
     23        * bridge/qt/qt_runtime.h:
     24        * bridge/runtime_array.cpp:
     25        (JSC::RuntimeArray::getOwnPropertySlot):
     26        * bridge/runtime_array.h:
     27        * bridge/runtime_method.cpp:
     28        (JSC::RuntimeMethod::getOwnPropertySlot):
     29        * bridge/runtime_method.h:
     30        * bridge/runtime_object.cpp:
     31        (JSC::Bindings::RuntimeObject::getOwnPropertySlot):
     32        * bridge/runtime_object.h:
     33
    1342011-10-03  Carlos Garcia Campos  <cgarcia@igalia.com> and Martin Robinson  <mrobinson@igalia.com>
    235
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp

    r96465 r97015  
    103103bool JSDOMWindowShell::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    104104{
    105     return m_window->getOwnPropertySlot(exec, propertyName, slot);
     105    return getOwnPropertySlot(this, exec, propertyName, slot);
     106}
     107
     108bool JSDOMWindowShell::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     109{
     110    return static_cast<JSDOMWindowShell*>(cell)->m_window->getOwnPropertySlot(exec, propertyName, slot);
    106111}
    107112
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h

    r96836 r97015  
    8282        virtual JSC::UString className() const;
    8383        virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     84        static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    8485        virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    8586        virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
  • trunk/Source/WebCore/bridge/objc/objc_runtime.h

    r97006 r97015  
    125125    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;
    126126    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     127    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    127128    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    128129    virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/WebCore/bridge/objc/objc_runtime.mm

    r97006 r97015  
    206206}
    207207
    208 bool ObjcFallbackObjectImp::getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot& slot)
     208bool ObjcFallbackObjectImp::getOwnPropertySlot(ExecState* exec, const Identifier& identifier, PropertySlot& slot)
     209{
     210    return getOwnPropertySlot(this, exec, identifier, slot);
     211}
     212
     213bool ObjcFallbackObjectImp::getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot& slot)
    209214{
    210215    // keep the prototype from getting called instead of just returning false
  • trunk/Source/WebCore/bridge/qt/qt_runtime.cpp

    r97006 r97015  
    15021502bool QtRuntimeMetaMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    15031503{
     1504    return getOwnPropertySlot(this, exec, propertyName, slot);
     1505}
     1506
     1507bool QtRuntimeMetaMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     1508{
     1509    QtRuntimeMetaMethod* thisObject = static_cast<QtRuntimeMetaMethod*>(cell);
    15041510    if (propertyName == "connect") {
    1505         slot.setCustom(this, connectGetter);
     1511        slot.setCustom(thisObject, thisObject->connectGetter);
    15061512        return true;
    15071513    } else if (propertyName == "disconnect") {
    1508         slot.setCustom(this, disconnectGetter);
     1514        slot.setCustom(thisObject, thisObject->disconnectGetter);
    15091515        return true;
    15101516    } else if (propertyName == exec->propertyNames().length) {
    1511         slot.setCustom(this, lengthGetter);
     1517        slot.setCustom(thisObject, thisObject->lengthGetter);
    15121518        return true;
    15131519    }
    15141520
    1515     return QtRuntimeMethod::getOwnPropertySlot(exec, propertyName, slot);
     1521    return QtRuntimeMethod::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    15161522}
    15171523
     
    17481754bool QtRuntimeConnectionMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    17491755{
     1756    return getOwnPropertySlot(this, exec, propertyName, slot);
     1757}
     1758
     1759bool QtRuntimeConnectionMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     1760{
     1761    QtRuntimeConnectionMethod* thisObject = static_cast<QtRuntimeConnectionMethod*>(cell);
    17501762    if (propertyName == exec->propertyNames().length) {
    1751         slot.setCustom(this, lengthGetter);
     1763        slot.setCustom(thisObject, thisObject->lengthGetter);
    17521764        return true;
    17531765    }
    17541766
    1755     return QtRuntimeMethod::getOwnPropertySlot(exec, propertyName, slot);
     1767    return QtRuntimeMethod::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    17561768}
    17571769
  • trunk/Source/WebCore/bridge/qt/qt_runtime.h

    r97006 r97015  
    166166
    167167    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
     168    static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&);
    168169    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    169170    virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
     
    202203
    203204    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
     205    static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&);
    204206    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    205207    virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
  • trunk/Source/WebCore/bridge/runtime_array.cpp

    r97002 r97015  
    8181bool RuntimeArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    8282{
     83    return getOwnPropertySlot(this, exec, propertyName, slot);
     84}
     85
     86bool RuntimeArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     87{
     88    RuntimeArray* thisObject = static_cast<RuntimeArray*>(cell);
    8389    if (propertyName == exec->propertyNames().length) {
    84         slot.setCacheableCustom(this, lengthGetter);
     90        slot.setCacheableCustom(thisObject, thisObject->lengthGetter);
    8591        return true;
    8692    }
     
    8995    unsigned index = propertyName.toArrayIndex(ok);
    9096    if (ok) {
    91         if (index < getLength()) {
    92             slot.setCustomIndex(this, index, indexGetter);
     97        if (index < thisObject->getLength()) {
     98            slot.setCustomIndex(thisObject, index, thisObject->indexGetter);
    9399            return true;
    94100        }
    95101    }
    96102   
    97     return JSObject::getOwnPropertySlot(exec, propertyName, slot);
     103    return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    98104}
    99105
     
    123129bool RuntimeArray::getOwnPropertySlot(ExecState *exec, unsigned index, PropertySlot& slot)
    124130{
    125     if (index < getLength()) {
    126         slot.setCustomIndex(this, index, indexGetter);
     131    return getOwnPropertySlot(this, exec, index, slot);
     132}
     133
     134bool RuntimeArray::getOwnPropertySlot(JSCell* cell, ExecState *exec, unsigned index, PropertySlot& slot)
     135{
     136    RuntimeArray* thisObject = static_cast<RuntimeArray*>(cell);
     137    if (index < thisObject->getLength()) {
     138        slot.setCustomIndex(thisObject, index, thisObject->indexGetter);
    127139        return true;
    128140    }
    129141   
    130     return JSObject::getOwnPropertySlot(exec, index, slot);
     142    return JSObject::getOwnPropertySlot(thisObject, exec, index, slot);
    131143}
    132144
  • trunk/Source/WebCore/bridge/runtime_array.h

    r97002 r97015  
    5252    virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
    5353    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     54    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5455    virtual bool getOwnPropertySlot(ExecState*, unsigned, PropertySlot&);
     56    static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned, PropertySlot&);
    5557    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5658    virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/WebCore/bridge/runtime_method.cpp

    r97006 r97015  
    7272bool RuntimeMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    7373{
     74    return getOwnPropertySlot(this, exec, propertyName, slot);
     75}
     76
     77bool RuntimeMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
     78{
     79    RuntimeMethod* thisObject = static_cast<RuntimeMethod*>(cell);
    7480    if (propertyName == exec->propertyNames().length) {
    75         slot.setCacheableCustom(this, lengthGetter);
     81        slot.setCacheableCustom(thisObject, thisObject->lengthGetter);
    7682        return true;
    7783    }
    7884   
    79     return InternalFunction::getOwnPropertySlot(exec, propertyName, slot);
     85    return InternalFunction::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    8086}
    8187
  • trunk/Source/WebCore/bridge/runtime_method.h

    r97006 r97015  
    6969    static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
    7070    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     71    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    7172    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    7273
  • trunk/Source/WebCore/bridge/runtime_object.cpp

    r97006 r97015  
    119119bool RuntimeObject::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
    120120{
    121     if (!m_instance) {
     121    return getOwnPropertySlot(this, exec, propertyName, slot);
     122}
     123
     124bool RuntimeObject::getOwnPropertySlot(JSCell* cell, ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
     125{
     126    RuntimeObject* thisObject = static_cast<RuntimeObject*>(cell);
     127    if (!thisObject->m_instance) {
    122128        throwInvalidAccessError(exec);
    123129        return false;
    124130    }
    125131   
    126     RefPtr<Instance> instance = m_instance;
     132    RefPtr<Instance> instance = thisObject->m_instance;
    127133
    128134    instance->begin();
     
    134140        Field *aField = aClass->fieldNamed(propertyName, instance.get());
    135141        if (aField) {
    136             slot.setCustom(this, fieldGetter);
     142            slot.setCustom(thisObject, thisObject->fieldGetter);
    137143            instance->end();
    138144            return true;
     
    142148            MethodList methodList = aClass->methodsNamed(propertyName, instance.get());
    143149            if (methodList.size() > 0) {
    144                 slot.setCustom(this, methodGetter);
     150                slot.setCustom(thisObject, thisObject->methodGetter);
    145151               
    146152                instance->end();
     
    151157        // Try a fallback object.
    152158        if (!aClass->fallbackObject(exec, instance.get(), propertyName).isUndefined()) {
    153             slot.setCustom(this, fallbackObjectGetter);
     159            slot.setCustom(thisObject, thisObject->fallbackObjectGetter);
    154160            instance->end();
    155161            return true;
     
    159165    instance->end();
    160166   
    161     return instance->getOwnPropertySlot(this, exec, propertyName, slot);
     167    return instance->getOwnPropertySlot(thisObject, exec, propertyName, slot);
    162168}
    163169
  • trunk/Source/WebCore/bridge/runtime_object.h

    r97006 r97015  
    4747
    4848    virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     49    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    4950    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier& propertyName, PropertyDescriptor&);
    5051    virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/WebKit2/ChangeLog

    r97012 r97015  
     12011-10-08  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Add static version of JSCell::getOwnPropertySlot
     4        https://bugs.webkit.org/show_bug.cgi?id=69593
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Added static version of getOwnPropertySlot to every class that overrides
     9        JSCell::getOwnPropertySlot.  The virtual versions now call the static versions.
     10        This is the first step in de-virtualizing JSCell::getOwnPropertySlot.
     11
     12        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
     13        (WebKit::JSNPObject::getOwnPropertySlot):
     14        * WebProcess/Plugins/Netscape/JSNPObject.h:
     15
    1162011-10-03  Carlos Garcia Campos  <cgarcia@igalia.com> and Martin Robinson  <mrobinson@igalia.com>
    217
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp

    r97006 r97015  
    254254bool JSNPObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    255255{
    256     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
    257     if (!m_npObject) {
     256    return getOwnPropertySlot(this, exec, propertyName, slot);
     257}
     258
     259bool JSNPObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     260{
     261    JSNPObject* thisObject = static_cast<JSNPObject*>(cell);
     262    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     263    if (!thisObject->m_npObject) {
    258264        throwInvalidAccessError(exec);
    259265        return false;
     
    263269
    264270    // First, check if the NPObject has a property with this name.
    265     if (m_npObject->_class->hasProperty && m_npObject->_class->hasProperty(m_npObject, npIdentifier)) {
    266         slot.setCustom(this, propertyGetter);
     271    if (thisObject->m_npObject->_class->hasProperty && thisObject->m_npObject->_class->hasProperty(thisObject->m_npObject, npIdentifier)) {
     272        slot.setCustom(thisObject, thisObject->propertyGetter);
    267273        return true;
    268274    }
    269275
    270276    // Second, check if the NPObject has a method with this name.
    271     if (m_npObject->_class->hasMethod && m_npObject->_class->hasMethod(m_npObject, npIdentifier)) {
    272         slot.setCustom(this, methodGetter);
     277    if (thisObject->m_npObject->_class->hasMethod && thisObject->m_npObject->_class->hasMethod(thisObject->m_npObject, npIdentifier)) {
     278        slot.setCustom(thisObject, thisObject->methodGetter);
    273279        return true;
    274280    }
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h

    r97006 r97015  
    8585
    8686    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
     87    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    8788    virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    8889    virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
Note: See TracChangeset for help on using the changeset viewer.