Changeset 99754 in webkit


Ignore:
Timestamp:
Nov 9, 2011 1:09:37 PM (12 years ago)
Author:
mhahnenberg@apple.com
Message:

De-virtualize JSObject::getOwnPropertyDescriptor
https://bugs.webkit.org/show_bug.cgi?id=71523

Reviewed by Sam Weinig.

Source/JavaScriptCore:

Added getOwnPropertyDescriptor to the MethodTable, changed all of the
virtual versions of getOwnPropertyDescriptor to static ones, and
changed all of the call sites to the corresponding lookup in the MethodTable.

  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h:

(JSC::::getOwnPropertyDescriptor):

(JSC::DebuggerActivation::getOwnPropertyDescriptor):

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

(JSC::Arguments::getOwnPropertyDescriptor):

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

(JSC::ArrayConstructor::getOwnPropertyDescriptor):

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

(JSC::ArrayPrototype::getOwnPropertyDescriptor):

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

(JSC::BooleanPrototype::getOwnPropertyDescriptor):

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

(JSC::DateConstructor::getOwnPropertyDescriptor):

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

(JSC::DatePrototype::getOwnPropertyDescriptor):

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

(JSC::ErrorPrototype::getOwnPropertyDescriptor):

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

(JSC::JSArray::getOwnPropertyDescriptor):

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

(JSC::JSByteArray::getOwnPropertyDescriptor):

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

(JSC::JSCell::getOwnPropertyDescriptor):

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

(JSC::JSFunction::getOwnPropertyDescriptor):

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

(JSC::JSGlobalObject::getOwnPropertyDescriptor):

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

(JSC::JSNotAnObject::getOwnPropertyDescriptor):

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

(JSC::JSONObject::getOwnPropertyDescriptor):

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

(JSC::JSObject::vtableAnchor):
(JSC::JSObject::propertyIsEnumerable):
(JSC::JSObject::getOwnPropertyDescriptor):
(JSC::JSObject::getPropertyDescriptor):
(JSC::JSObject::defineOwnProperty):

  • runtime/JSObject.h:
  • runtime/JSString.cpp: Removed getOwnPropertyDescriptor, since this seems to be a relic from a

bygone era when getOwnPropertyDescriptor was rooted in JSCell rather than JSObject. There were
no call sites for this version of getOwnPropertyDescriptor in the entire project.

  • runtime/JSString.h:
  • runtime/Lookup.h:

(JSC::getStaticPropertyDescriptor):
(JSC::getStaticFunctionDescriptor):
(JSC::getStaticValueDescriptor):

  • runtime/MathObject.cpp:

(JSC::MathObject::getOwnPropertyDescriptor):

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

(JSC::NumberConstructor::getOwnPropertyDescriptor):

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

(JSC::NumberPrototype::getOwnPropertyDescriptor):

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

(JSC::ObjectConstructor::getOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyDescriptor):

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

(JSC::ObjectPrototype::getOwnPropertyDescriptor):

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

(JSC::RegExpConstructor::getOwnPropertyDescriptor):

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

(JSC::RegExpMatchesArray::getOwnPropertyDescriptor):

  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::getOwnPropertyDescriptor):

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

(JSC::RegExpPrototype::getOwnPropertyDescriptor):

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

(JSC::StringConstructor::getOwnPropertyDescriptor):

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

(JSC::StringObject::vtableAnchor): Added to prevent a weak vtable.
(JSC::StringObject::getOwnPropertyDescriptor):

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

(JSC::StringPrototype::getOwnPropertyDescriptor):

  • runtime/StringPrototype.h:

Source/WebCore:

No new tests.

Added getOwnPropertyDescriptor to the MethodTable, changed all of the
virtual versions of getOwnPropertyDescriptor to static ones, and
changed all of the call sites to the corresponding lookup in the MethodTable.

  • WebCore.exp.in:
  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getOwnPropertyDescriptor):

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::getOwnPropertyDescriptor):

  • bindings/js/JSDOMWindowShell.h:
  • bindings/js/JSWorkerContextCustom.cpp:

(WebCore::JSWorkerContext::getOwnPropertyDescriptorDelegate):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateGetOwnPropertyDescriptorBody):
(GenerateHeader):
(GenerateImplementation):
(GenerateConstructorDeclaration):
(GenerateConstructorDefinition):

  • bindings/scripts/test/JS/JSTestInterface.cpp:

(WebCore::JSTestInterfaceConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestInterface::getOwnPropertyDescriptor):

  • bindings/scripts/test/JS/JSTestInterface.h:
  • bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:

(WebCore::JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor):
(WebCore::JSTestMediaQueryListListener::getOwnPropertyDescriptor):

  • bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::JSTestObjConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestObjPrototype::getOwnPropertyDescriptor):
(WebCore::JSTestObj::getOwnPropertyDescriptor):

  • bindings/scripts/test/JS/JSTestObj.h:
  • bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:

(WebCore::JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor):

  • bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
  • bridge/objc/objc_runtime.h:
  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertyDescriptor):

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertyDescriptor):
(JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertyDescriptor):

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

(JSC::RuntimeArray::getOwnPropertyDescriptor):

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

(JSC::RuntimeMethod::vtableAnchor): Added to prevent a weak vtable.
(JSC::RuntimeMethod::getOwnPropertyDescriptor):

  • bridge/runtime_method.h: Changed getOwnPropertyDescriptor from private to protected to allow

subclasses to use it in their MethodTables.

  • bridge/runtime_object.cpp:

(JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):

  • bridge/runtime_object.h:

Source/WebKit2:

Added getOwnPropertyDescriptor to the MethodTable, changed all of the
virtual versions of getOwnPropertyDescriptor to static ones, and
changed all of the call sites to the corresponding lookup in the MethodTable.

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::JSNPObject::getOwnPropertyDescriptor):

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackObject.h

    r99312 r99754  
    179179
    180180    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    181     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     181    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    182182   
    183183    static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r99312 r99754  
    185185
    186186template <class Parent>
    187 bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    188 {
     187bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     188{
     189    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(object);
    189190    PropertySlot slot;
    190     if (methodTable()->getOwnPropertySlot(this, exec, propertyName, slot)) {
     191    if (thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot)) {
    191192        // Ideally we should return an access descriptor, but returning a value descriptor is better than nothing.
    192193        JSValue value = slot.getValue(exec, propertyName);
     
    200201    }
    201202
    202     return Parent::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     203    return Parent::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    203204}
    204205
  • trunk/Source/JavaScriptCore/ChangeLog

    r99745 r99754  
     12011-11-09  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        De-virtualize JSObject::getOwnPropertyDescriptor
     4        https://bugs.webkit.org/show_bug.cgi?id=71523
     5
     6        Reviewed by Sam Weinig.
     7
     8        Added getOwnPropertyDescriptor to the MethodTable, changed all of the
     9        virtual versions of getOwnPropertyDescriptor to static ones, and
     10        changed all of the call sites to the corresponding lookup in the MethodTable.
     11
     12        * API/JSCallbackObject.h:
     13        * API/JSCallbackObjectFunctions.h:
     14        (JSC::::getOwnPropertyDescriptor):
     15        * JavaScriptCore.exp:
     16        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
     17        * debugger/DebuggerActivation.cpp:
     18        (JSC::DebuggerActivation::getOwnPropertyDescriptor):
     19        * debugger/DebuggerActivation.h:
     20        * runtime/Arguments.cpp:
     21        (JSC::Arguments::getOwnPropertyDescriptor):
     22        * runtime/Arguments.h:
     23        * runtime/ArrayConstructor.cpp:
     24        (JSC::ArrayConstructor::getOwnPropertyDescriptor):
     25        * runtime/ArrayConstructor.h:
     26        * runtime/ArrayPrototype.cpp:
     27        (JSC::ArrayPrototype::getOwnPropertyDescriptor):
     28        * runtime/ArrayPrototype.h:
     29        * runtime/BooleanPrototype.cpp:
     30        (JSC::BooleanPrototype::getOwnPropertyDescriptor):
     31        * runtime/BooleanPrototype.h:
     32        * runtime/ClassInfo.h:
     33        * runtime/DateConstructor.cpp:
     34        (JSC::DateConstructor::getOwnPropertyDescriptor):
     35        * runtime/DateConstructor.h:
     36        * runtime/DatePrototype.cpp:
     37        (JSC::DatePrototype::getOwnPropertyDescriptor):
     38        * runtime/DatePrototype.h:
     39        * runtime/ErrorPrototype.cpp:
     40        (JSC::ErrorPrototype::getOwnPropertyDescriptor):
     41        * runtime/ErrorPrototype.h:
     42        * runtime/JSArray.cpp:
     43        (JSC::JSArray::getOwnPropertyDescriptor):
     44        * runtime/JSArray.h:
     45        * runtime/JSByteArray.cpp:
     46        (JSC::JSByteArray::getOwnPropertyDescriptor):
     47        * runtime/JSByteArray.h:
     48        * runtime/JSCell.cpp:
     49        (JSC::JSCell::getOwnPropertyDescriptor):
     50        * runtime/JSCell.h:
     51        * runtime/JSFunction.cpp:
     52        (JSC::JSFunction::getOwnPropertyDescriptor):
     53        * runtime/JSFunction.h:
     54        * runtime/JSGlobalObject.cpp:
     55        (JSC::JSGlobalObject::getOwnPropertyDescriptor):
     56        * runtime/JSGlobalObject.h:
     57        * runtime/JSNotAnObject.cpp:
     58        (JSC::JSNotAnObject::getOwnPropertyDescriptor):
     59        * runtime/JSNotAnObject.h:
     60        * runtime/JSONObject.cpp:
     61        (JSC::JSONObject::getOwnPropertyDescriptor):
     62        * runtime/JSONObject.h:
     63        * runtime/JSObject.cpp:
     64        (JSC::JSObject::vtableAnchor):
     65        (JSC::JSObject::propertyIsEnumerable):
     66        (JSC::JSObject::getOwnPropertyDescriptor):
     67        (JSC::JSObject::getPropertyDescriptor):
     68        (JSC::JSObject::defineOwnProperty):
     69        * runtime/JSObject.h:
     70        * runtime/JSString.cpp: Removed getOwnPropertyDescriptor, since this seems to be a relic from a
     71        bygone era when getOwnPropertyDescriptor was rooted in JSCell rather than JSObject.  There were
     72        no call sites for this version of getOwnPropertyDescriptor in the entire project.
     73        * runtime/JSString.h:
     74        * runtime/Lookup.h:
     75        (JSC::getStaticPropertyDescriptor):
     76        (JSC::getStaticFunctionDescriptor):
     77        (JSC::getStaticValueDescriptor):
     78        * runtime/MathObject.cpp:
     79        (JSC::MathObject::getOwnPropertyDescriptor):
     80        * runtime/MathObject.h:
     81        * runtime/NumberConstructor.cpp:
     82        (JSC::NumberConstructor::getOwnPropertyDescriptor):
     83        * runtime/NumberConstructor.h:
     84        * runtime/NumberPrototype.cpp:
     85        (JSC::NumberPrototype::getOwnPropertyDescriptor):
     86        * runtime/NumberPrototype.h:
     87        * runtime/ObjectConstructor.cpp:
     88        (JSC::ObjectConstructor::getOwnPropertyDescriptor):
     89        (JSC::objectConstructorGetOwnPropertyDescriptor):
     90        * runtime/ObjectConstructor.h:
     91        * runtime/ObjectPrototype.cpp:
     92        (JSC::ObjectPrototype::getOwnPropertyDescriptor):
     93        * runtime/ObjectPrototype.h:
     94        * runtime/RegExpConstructor.cpp:
     95        (JSC::RegExpConstructor::getOwnPropertyDescriptor):
     96        * runtime/RegExpConstructor.h:
     97        * runtime/RegExpMatchesArray.h:
     98        (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
     99        * runtime/RegExpObject.cpp:
     100        (JSC::RegExpObject::getOwnPropertyDescriptor):
     101        * runtime/RegExpObject.h:
     102        * runtime/RegExpPrototype.cpp:
     103        (JSC::RegExpPrototype::getOwnPropertyDescriptor):
     104        * runtime/RegExpPrototype.h:
     105        * runtime/StringConstructor.cpp:
     106        (JSC::StringConstructor::getOwnPropertyDescriptor):
     107        * runtime/StringConstructor.h:
     108        * runtime/StringObject.cpp:
     109        (JSC::StringObject::vtableAnchor): Added to prevent a weak vtable.
     110        (JSC::StringObject::getOwnPropertyDescriptor):
     111        * runtime/StringObject.h:
     112        * runtime/StringPrototype.cpp:
     113        (JSC::StringPrototype::getOwnPropertyDescriptor):
     114        * runtime/StringPrototype.h:
     115
    11162011-11-09  Gavin Barraclough  <barraclough@apple.com>
    2117
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r99675 r99754  
    122122__ZN3JSC11JSByteArray18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    123123__ZN3JSC11JSByteArray19getOwnPropertyNamesEPNS_8JSObjectEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
     124__ZN3JSC11JSByteArray24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    124125__ZN3JSC11JSByteArray25getOwnPropertySlotByIndexEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE
    125126__ZN3JSC11JSByteArray3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
     
    157158__ZN3JSC12SmallStrings27createSingleCharacterStringEPNS_12JSGlobalDataEh
    158159__ZN3JSC12StringObject14finishCreationERNS_12JSGlobalDataEPNS_8JSStringE
    159 __ZN3JSC12StringObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    160160__ZN3JSC12StringObject6s_infoE
    161161__ZN3JSC12StringObjectC2ERNS_12JSGlobalDataEPNS_9StructureE
     
    173173__ZN3JSC14JSGlobalObject17putWithAttributesEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
    174174__ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    175 __ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
     175__ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    176176__ZN3JSC14JSGlobalObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
    177177__ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE
     
    312312__ZN3JSC8JSObject12lookupSetterEPNS_9ExecStateERKNS_10IdentifierE
    313313__ZN3JSC8JSObject12toThisObjectEPNS_6JSCellEPNS_9ExecStateE
     314__ZN3JSC8JSObject12vtableAnchorEv
    314315__ZN3JSC8JSObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
    315316__ZN3JSC8JSObject14deletePropertyEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierE
     
    324325__ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE
    325326__ZN3JSC8JSObject23allocatePropertyStorageERNS_12JSGlobalDataEmm
    326 __ZN3JSC8JSObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
     327__ZN3JSC8JSObject24getOwnPropertyDescriptorEPS0_PNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    327328__ZN3JSC8JSObject25getOwnPropertySlotByIndexEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE
    328329__ZN3JSC8JSObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r99675 r99754  
    191191    ?getConstructData@JSCell@JSC@@SA?AW4ConstructType@2@PAV12@AATConstructData@2@@Z
    192192    ?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ
    193     ?getOwnPropertyDescriptor@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
    194     ?getOwnPropertyDescriptor@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
    195     ?getOwnPropertyDescriptor@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
    196     ?getOwnPropertyDescriptor@StringObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
     193    ?getOwnPropertyDescriptor@JSByteArray@JSC@@SA_NPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
     194    ?getOwnPropertyDescriptor@JSGlobalObject@JSC@@SA_NPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
     195    ?getOwnPropertyDescriptor@JSObject@JSC@@SA_NPAV12@PAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
    197196    ?getOwnPropertyNames@JSByteArray@JSC@@SAXPAVJSObject@2@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
    198197    ?getOwnPropertyNames@JSObject@JSC@@SAXPAV12@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
     
    353352    ?visitChildren@JSObject@JSC@@SAXPAVJSCell@2@AAVSlotVisitor@2@@Z
    354353    ?vtableAnchor@InternalFunction@JSC@@EAEXXZ
     354    ?vtableAnchor@JSObject@JSC@@UAEXXZ
    355355    ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
    356356    ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp

    r99497 r99754  
    9292}
    9393
    94 bool DebuggerActivation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     94bool DebuggerActivation::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    9595{
    96     return m_activation->getOwnPropertyDescriptor(exec, propertyName, descriptor);
     96    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(object);
     97    return thisObject->m_activation->methodTable()->getOwnPropertyDescriptor(thisObject->m_activation.get(), exec, propertyName, descriptor);
    9798}
    9899
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h

    r99497 r99754  
    4949        static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
    5050        static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
    51         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     51        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5252        static void defineGetter(JSObject*, ExecState*, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes);
    5353        static void defineSetter(JSObject*, ExecState*, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes);
  • trunk/Source/JavaScriptCore/runtime/Arguments.cpp

    r99675 r99754  
    216216}
    217217
    218 bool Arguments::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    219 {
     218bool Arguments::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     219{
     220    Arguments* thisObject = static_cast<Arguments*>(object);
    220221    bool isArrayIndex;
    221222    unsigned i = propertyName.toArrayIndex(isArrayIndex);
    222     if (isArrayIndex && i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) {
    223         if (i < d->numParameters) {
    224             descriptor.setDescriptor(d->registers[d->firstParameterIndex + i].get(), None);
     223    if (isArrayIndex && i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
     224        if (i < thisObject->d->numParameters) {
     225            descriptor.setDescriptor(thisObject->d->registers[thisObject->d->firstParameterIndex + i].get(), None);
    225226        } else
    226             descriptor.setDescriptor(d->extraArguments[i - d->numParameters].get(), None);
    227         return true;
    228     }
    229    
    230     if (propertyName == exec->propertyNames().length && LIKELY(!d->overrodeLength)) {
    231         descriptor.setDescriptor(jsNumber(d->numArguments), DontEnum);
    232         return true;
    233     }
    234    
    235     if (propertyName == exec->propertyNames().callee && LIKELY(!d->overrodeCallee)) {
    236         if (!d->isStrictMode) {
    237             descriptor.setDescriptor(d->callee.get(), DontEnum);
    238             return true;
    239         }
    240         createStrictModeCalleeIfNecessary(exec);
    241     }
    242 
    243     if (propertyName == exec->propertyNames().caller && d->isStrictMode)
    244         createStrictModeCallerIfNecessary(exec);
    245    
    246     return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     227            descriptor.setDescriptor(thisObject->d->extraArguments[i - thisObject->d->numParameters].get(), None);
     228        return true;
     229    }
     230   
     231    if (propertyName == exec->propertyNames().length && LIKELY(!thisObject->d->overrodeLength)) {
     232        descriptor.setDescriptor(jsNumber(thisObject->d->numArguments), DontEnum);
     233        return true;
     234    }
     235   
     236    if (propertyName == exec->propertyNames().callee && LIKELY(!thisObject->d->overrodeCallee)) {
     237        if (!thisObject->d->isStrictMode) {
     238            descriptor.setDescriptor(thisObject->d->callee.get(), DontEnum);
     239            return true;
     240        }
     241        thisObject->createStrictModeCalleeIfNecessary(exec);
     242    }
     243
     244    if (propertyName == exec->propertyNames().caller && thisObject->d->isStrictMode)
     245        thisObject->createStrictModeCallerIfNecessary(exec);
     246   
     247    return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    247248}
    248249
  • trunk/Source/JavaScriptCore/runtime/Arguments.h

    r99148 r99754  
    138138        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    139139        static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    140         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     140        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    141141        static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
    142142        static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r98501 r99754  
    6969}
    7070
    71 bool ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     71bool ArrayConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    7272{
    73     return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), this, propertyName, descriptor);
     73    return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), static_cast<ArrayConstructor*>(object), propertyName, descriptor);
    7474}
    7575
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r98501 r99754  
    5454        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5555
    56         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     56        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5757
    5858        static ConstructType getConstructData(JSCell*, ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r98501 r99754  
    131131}
    132132
    133 bool ArrayPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    134 {
    135     return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), this, propertyName, descriptor);
     133bool ArrayPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     134{
     135    return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), static_cast<ArrayPrototype*>(object), propertyName, descriptor);
    136136}
    137137
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h

    r98501 r99754  
    4242       
    4343        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    44         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     44        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    4545
    4646        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp

    r98501 r99754  
    6868}
    6969
    70 bool BooleanPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     70bool BooleanPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    7171{
    72     return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, descriptor);
     72    return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), static_cast<BooleanPrototype*>(object), propertyName, descriptor);
    7373}
    7474
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h

    r98501 r99754  
    5252        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5353
    54         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     54        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5555    };
    5656
  • trunk/Source/JavaScriptCore/runtime/ClassInfo.h

    r99675 r99754  
    9090        typedef bool (*DefineOwnPropertyFunctionPtr)(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&, bool);
    9191        DefineOwnPropertyFunctionPtr defineOwnProperty;
     92
     93        typedef bool (*GetOwnPropertyDescriptorFunctionPtr)(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
     94        GetOwnPropertyDescriptorFunctionPtr getOwnPropertyDescriptor;
    9295    };
    9396
     
    131134        &ClassName::putWithAttributes, \
    132135        &ClassName::defineOwnProperty, \
     136        &ClassName::getOwnPropertyDescriptor, \
    133137    }, \
    134138    sizeof(ClassName)
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r98501 r99754  
    9191}
    9292
    93 bool DateConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    94 {
    95     return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::dateConstructorTable(exec), this, propertyName, descriptor);
     93bool DateConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     94{
     95    return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::dateConstructorTable(exec), static_cast<DateConstructor*>(object), propertyName, descriptor);
    9696}
    9797
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r98501 r99754  
    5757        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5858
    59         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     59        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    6060    };
    6161
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp

    r98501 r99754  
    449449}
    450450
    451 bool DatePrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    452 {
    453     return getStaticFunctionDescriptor<JSObject>(exec, ExecState::dateTable(exec), this, propertyName, descriptor);
     451bool DatePrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     452{
     453    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::dateTable(exec), static_cast<DatePrototype*>(object), propertyName, descriptor);
    454454}
    455455
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.h

    r98501 r99754  
    4343        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    4444
    45         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     45        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    4646
    4747        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp

    r98501 r99754  
    6868}
    6969
    70 bool ErrorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     70bool ErrorPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    7171{
    72     return getStaticFunctionDescriptor<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), this, propertyName, descriptor);
     72    return getStaticFunctionDescriptor<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), static_cast<ErrorPrototype*>(object), propertyName, descriptor);
    7373}
    7474
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h

    r98747 r99754  
    5454    private:
    5555        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    56         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     56        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5757    };
    5858
  • trunk/Source/JavaScriptCore/runtime/JSArray.cpp

    r99126 r99754  
    292292}
    293293
    294 bool JSArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    295 {
     294bool JSArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     295{
     296    JSArray* thisObject = static_cast<JSArray*>(object);
    296297    if (propertyName == exec->propertyNames().length) {
    297         descriptor.setDescriptor(jsNumber(length()), DontDelete | DontEnum);
     298        descriptor.setDescriptor(jsNumber(thisObject->length()), DontDelete | DontEnum);
    298299        return true;
    299300    }
    300301
    301     ArrayStorage* storage = m_storage;
     302    ArrayStorage* storage = thisObject->m_storage;
    302303   
    303304    bool isArrayIndex;
     
    306307        if (i >= storage->m_length)
    307308            return false;
    308         if (i < m_vectorLength) {
     309        if (i < thisObject->m_vectorLength) {
    309310            WriteBarrier<Unknown>& value = storage->m_vector[i];
    310311            if (value) {
     
    322323        }
    323324    }
    324     return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     325    return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    325326}
    326327
  • trunk/Source/JavaScriptCore/runtime/JSArray.h

    r99126 r99754  
    9797        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    9898        static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    99         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     99        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    100100        static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
    101101
  • trunk/Source/JavaScriptCore/runtime/JSByteArray.cpp

    r99126 r99754  
    6767}
    6868
    69 bool JSByteArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     69bool JSByteArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    7070{
     71    JSByteArray* thisObject = static_cast<JSByteArray*>(object);
    7172    bool ok;
    7273    unsigned index = propertyName.toUInt32(ok);
    73     if (ok && canAccessIndex(index)) {
    74         descriptor.setDescriptor(getIndex(exec, index), DontDelete);
     74    if (ok && thisObject->canAccessIndex(index)) {
     75        descriptor.setDescriptor(thisObject->getIndex(exec, index), DontDelete);
    7576        return true;
    7677    }
    77     return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     78    return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    7879}
    7980
  • trunk/Source/JavaScriptCore/runtime/JSByteArray.h

    r99126 r99754  
    9191        static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    9292        static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
    93         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     93        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    9494        static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
    9595        static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue);
  • trunk/Source/JavaScriptCore/runtime/JSCell.cpp

    r99675 r99754  
    208208}
    209209
     210bool JSCell::getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&)
     211{
     212    ASSERT_NOT_REACHED();
     213    return false;
     214}
     215
    210216} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r99675 r99754  
    151151        static NO_RETURN_DUE_TO_ASSERT void putWithAttributes(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
    152152        static bool defineOwnProperty(JSObject*, ExecState*, const Identifier& propertyName, PropertyDescriptor&, bool shouldThrow);
     153        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    153154
    154155    private:
  • trunk/Source/JavaScriptCore/runtime/JSFunction.cpp

    r99126 r99754  
    252252}
    253253
    254 bool JSFunction::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    255 {
    256     if (isHostFunction())
    257         return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     254bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     255{
     256    JSFunction* thisObject = static_cast<JSFunction*>(object);
     257    if (thisObject->isHostFunction())
     258        return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    258259   
    259260    if (propertyName == exec->propertyNames().prototype) {
    260261        PropertySlot slot;
    261         methodTable()->getOwnPropertySlot(this, exec, propertyName, slot);
    262         return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     262        thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot);
     263        return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    263264    }
    264265   
    265266    if (propertyName == exec->propertyNames().arguments) {
    266         if (jsExecutable()->isStrictMode()) {
    267             bool result = Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     267        if (thisObject->jsExecutable()->isStrictMode()) {
     268            bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    268269            if (!result) {
    269                 initializeGetterSetterProperty(exec, propertyName, globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);
    270                 result = Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     270                thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);
     271                result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    271272                ASSERT(result);
    272273            }
    273274            return result;
    274275        }
    275         descriptor.setDescriptor(exec->interpreter()->retrieveArguments(exec, this), ReadOnly | DontEnum | DontDelete);
     276        descriptor.setDescriptor(exec->interpreter()->retrieveArguments(exec, thisObject), ReadOnly | DontEnum | DontDelete);
    276277        return true;
    277278    }
    278279   
    279280    if (propertyName == exec->propertyNames().length) {
    280         descriptor.setDescriptor(jsNumber(jsExecutable()->parameterCount()), ReadOnly | DontEnum | DontDelete);
     281        descriptor.setDescriptor(jsNumber(thisObject->jsExecutable()->parameterCount()), ReadOnly | DontEnum | DontDelete);
    281282        return true;
    282283    }
    283284   
    284285    if (propertyName == exec->propertyNames().caller) {
    285         if (jsExecutable()->isStrictMode()) {
    286             bool result = Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     286        if (thisObject->jsExecutable()->isStrictMode()) {
     287            bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    287288            if (!result) {
    288                 initializeGetterSetterProperty(exec, propertyName, globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);
    289                 result = Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     289                thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);
     290                result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    290291                ASSERT(result);
    291292            }
    292293            return result;
    293294        }
    294         descriptor.setDescriptor(exec->interpreter()->retrieveCaller(exec, this), ReadOnly | DontEnum | DontDelete);
    295         return true;
    296     }
    297    
    298     return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     295        descriptor.setDescriptor(exec->interpreter()->retrieveCaller(exec, thisObject), ReadOnly | DontEnum | DontDelete);
     296        return true;
     297    }
     298   
     299    return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    299300}
    300301
  • trunk/Source/JavaScriptCore/runtime/JSFunction.h

    r99126 r99754  
    131131
    132132        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    133         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     133        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    134134        static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
    135135
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r99497 r99754  
    441441}
    442442
    443 bool JSGlobalObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    444 {
    445     if (getStaticFunctionDescriptor<JSVariableObject>(exec, ExecState::globalObjectTable(exec), this, propertyName, descriptor))
     443bool JSGlobalObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     444{
     445    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(object);
     446    if (getStaticFunctionDescriptor<JSVariableObject>(exec, ExecState::globalObjectTable(exec), thisObject, propertyName, descriptor))
    446447        return true;
    447     return symbolTableGet(propertyName, descriptor);
     448    return thisObject->symbolTableGet(propertyName, descriptor);
    448449}
    449450
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r99497 r99754  
    184184
    185185        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    186         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     186        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    187187        virtual bool hasOwnPropertyForWrite(ExecState*, const Identifier&);
    188188        static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.cpp

    r99126 r99754  
    5959}
    6060
    61 bool JSNotAnObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier&, PropertyDescriptor&)
     61bool JSNotAnObject::getOwnPropertyDescriptor(JSObject*, ExecState* exec, const Identifier&, PropertyDescriptor&)
    6262{
    6363    ASSERT_UNUSED(exec, exec->hadException());
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h

    r99126 r99754  
    7171        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    7272        static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    73         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     73        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    7474
    7575        static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r99126 r99754  
    604604}
    605605
    606 bool JSONObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    607 {
    608     return getStaticFunctionDescriptor<JSObject>(exec, ExecState::jsonTable(exec), this, propertyName, descriptor);
     606bool JSONObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     607{
     608    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::jsonTable(exec), static_cast<JSONObject*>(object), propertyName, descriptor);
    609609}
    610610
  • trunk/Source/JavaScriptCore/runtime/JSONObject.h

    r98501 r99754  
    5858        JSONObject(JSGlobalObject*, Structure*);
    5959        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    60         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     60        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    6161
    6262    };
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r99675 r99754  
    7777}
    7878
     79void JSObject::vtableAnchor()
     80{
     81}
     82
    7983void JSObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
    8084{
     
    456460{
    457461    PropertyDescriptor descriptor;
    458     if (!const_cast<JSObject*>(this)->getOwnPropertyDescriptor(exec, propertyName, descriptor))
     462    if (!const_cast<JSObject*>(this)->methodTable()->getOwnPropertyDescriptor(const_cast<JSObject*>(this), exec, propertyName, descriptor))
    459463        return false;
    460464    return descriptor.enumerable();
     
    647651}
    648652
    649 bool JSObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     653bool JSObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    650654{
    651655    unsigned attributes = 0;
    652656    JSCell* cell = 0;
    653     size_t offset = structure()->get(exec->globalData(), propertyName, attributes, cell);
     657    size_t offset = object->structure()->get(exec->globalData(), propertyName, attributes, cell);
    654658    if (offset == WTF::notFound)
    655659        return false;
    656     descriptor.setDescriptor(getDirectOffset(offset), attributes);
     660    descriptor.setDescriptor(object->getDirectOffset(offset), attributes);
    657661    return true;
    658662}
     
    662666    JSObject* object = this;
    663667    while (true) {
    664         if (object->getOwnPropertyDescriptor(exec, propertyName, descriptor))
     668        if (object->methodTable()->getOwnPropertyDescriptor(object, exec, propertyName, descriptor))
    665669            return true;
    666670        JSValue prototype = object->prototype();
     
    709713    // If we have a new property we can just put it on normally
    710714    PropertyDescriptor current;
    711     if (!object->getOwnPropertyDescriptor(exec, propertyName, current)) {
     715    if (!object->methodTable()->getOwnPropertyDescriptor(object, exec, propertyName, current)) {
    712716        // unless extensions are prevented!
    713717        if (!object->isExtensible()) {
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r99675 r99754  
    8181        typedef JSCell Base;
    8282
     83        virtual void vtableAnchor();
     84
    8385        static void visitChildren(JSCell*, SlotVisitor&);
    8486
     
    102104        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    103105        static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    104         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     106        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    105107
    106108        static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r98624 r99754  
    241241}
    242242
    243 bool JSString::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    244 {
    245     if (getStringPropertyDescriptor(exec, propertyName, descriptor))
    246         return true;
    247     if (propertyName != exec->propertyNames().underscoreProto)
    248         return false;
    249     descriptor.setDescriptor(exec->lexicalGlobalObject()->stringPrototype(), DontEnum);
    250     return true;
    251 }
    252 
    253243bool JSString::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
    254244{
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r98593 r99754  
    253253        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    254254        static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    255         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    256255
    257256        static const unsigned s_maxInternalRopeLength = 3;
  • trunk/Source/JavaScriptCore/runtime/Lookup.h

    r97537 r99754  
    286286       
    287287        if (!entry) // not found, forward to parent
    288             return thisObj->ParentImp::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     288            return ParentImp::getOwnPropertyDescriptor(thisObj, exec, propertyName, descriptor);
    289289 
    290290        PropertySlot slot;
     
    327327    inline bool getStaticFunctionDescriptor(ExecState* exec, const HashTable* table, JSObject* thisObj, const Identifier& propertyName, PropertyDescriptor& descriptor)
    328328    {
    329         if (static_cast<ParentImp*>(thisObj)->ParentImp::getOwnPropertyDescriptor(exec, propertyName, descriptor))
     329        if (ParentImp::getOwnPropertyDescriptor(static_cast<ParentImp*>(thisObj), exec, propertyName, descriptor))
    330330            return true;
    331331       
     
    369369       
    370370        if (!entry) // not found, forward to parent
    371             return thisObj->ParentImp::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     371            return ParentImp::getOwnPropertyDescriptor(thisObj, exec, propertyName, descriptor);
    372372       
    373373        ASSERT(!(entry->attributes() & Function));
  • trunk/Source/JavaScriptCore/runtime/MathObject.cpp

    r98501 r99754  
    110110}
    111111
    112 bool MathObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    113 {
    114     return getStaticFunctionDescriptor<JSObject>(exec, ExecState::mathTable(exec), this, propertyName, descriptor);
     112bool MathObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     113{
     114    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::mathTable(exec), static_cast<MathObject*>(object), propertyName, descriptor);
    115115}
    116116
  • trunk/Source/JavaScriptCore/runtime/MathObject.h

    r98501 r99754  
    4040        }
    4141        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    42         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     42        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    4343
    4444        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r98501 r99754  
    7777}
    7878
    79 bool NumberConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     79bool NumberConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    8080{
    81     return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), this, propertyName, descriptor);
     81    return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), static_cast<NumberConstructor*>(object), propertyName, descriptor);
    8282}
    8383
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r98501 r99754  
    4040
    4141        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    42         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     42        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    4343        JSValue getValueProperty(ExecState*, int token) const;
    4444
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp

    r98501 r99754  
    8989}
    9090
    91 bool NumberPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    92 {
    93     return getStaticFunctionDescriptor<NumberObject>(exec, ExecState::numberPrototypeTable(exec), this, propertyName, descriptor);
     91bool NumberPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     92{
     93    return getStaticFunctionDescriptor<NumberObject>(exec, ExecState::numberPrototypeTable(exec), static_cast<NumberPrototype*>(object), propertyName, descriptor);
    9494}
    9595
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.h

    r98501 r99754  
    5151        NumberPrototype(ExecState*, Structure*);
    5252        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    53         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     53        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5454    };
    5555
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r99675 r99754  
    9595}
    9696
    97 bool ObjectConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    98 {
    99     return getStaticFunctionDescriptor<JSObject>(exec, ExecState::objectConstructorTable(exec), this, propertyName, descriptor);
     97bool ObjectConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     98{
     99    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::objectConstructorTable(exec), static_cast<ObjectConstructor*>(object), propertyName, descriptor);
    100100}
    101101
     
    153153    JSObject* object = asObject(exec->argument(0));
    154154    PropertyDescriptor descriptor;
    155     if (!object->getOwnPropertyDescriptor(exec, Identifier(exec, propertyName), descriptor))
     155    if (!object->methodTable()->getOwnPropertyDescriptor(object, exec, Identifier(exec, propertyName), descriptor))
    156156        return JSValue::encode(jsUndefined());
    157157    if (exec->hadException())
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h

    r98501 r99754  
    4040
    4141        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    42         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     42        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    4343
    4444        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp

    r99223 r99754  
    101101}
    102102
    103 bool ObjectPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    104 {
    105     return getStaticFunctionDescriptor<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), this, propertyName, descriptor);
     103bool ObjectPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     104{
     105    return getStaticFunctionDescriptor<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), static_cast<ObjectPrototype*>(object), propertyName, descriptor);
    106106}
    107107
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h

    r98501 r99754  
    5555        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5656        static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    57         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     57        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5858
    5959        bool m_hasNoPropertiesWithUInt32Names;
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r98501 r99754  
    210210}
    211211
    212 bool RegExpConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    213 {
    214     return getStaticValueDescriptor<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), this, propertyName, descriptor);
     212bool RegExpConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     213{
     214    return getStaticValueDescriptor<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), static_cast<RegExpConstructor*>(object), propertyName, descriptor);
    215215}
    216216
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r98501 r99754  
    7575
    7676        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    77         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     77        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    7878
    7979        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h

    r99126 r99754  
    6767        }
    6868
    69         virtual bool getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     69        static bool getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    7070        {
    71             if (subclassData())
    72                 fillArrayInstance(exec);
    73             return JSArray::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     71            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(object);
     72            if (thisObject->subclassData())
     73                thisObject->fillArrayInstance(exec);
     74            return JSArray::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    7475        }
    7576
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp

    r98501 r99754  
    9797}
    9898
    99 bool RegExpObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    100 {
    101     return getStaticValueDescriptor<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), this, propertyName, descriptor);
     99bool RegExpObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     100{
     101    return getStaticValueDescriptor<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), static_cast<RegExpObject*>(object), propertyName, descriptor);
    102102}
    103103
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.h

    r98501 r99754  
    6767
    6868        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    69         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     69        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    7070        static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
    7171
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r98501 r99754  
    7373}
    7474
    75 bool RegExpPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     75bool RegExpPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    7676{
    77     return getStaticFunctionDescriptor<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), this, propertyName, descriptor);
     77    return getStaticFunctionDescriptor<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), static_cast<RegExpPrototype*>(object), propertyName, descriptor);
    7878}
    7979
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h

    r98501 r99754  
    5151    private:
    5252        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    53         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     53        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5454    };
    5555
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r98501 r99754  
    6565}
    6666
    67 bool StringConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     67bool StringConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    6868{
    69     return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::stringConstructorTable(exec), this, propertyName, descriptor);
     69    return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::stringConstructorTable(exec), static_cast<StringConstructor*>(object), propertyName, descriptor);
    7070}
    7171
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r98501 r99754  
    5656
    5757        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    58         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     58        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5959    };
    6060
  • trunk/Source/JavaScriptCore/runtime/StringObject.cpp

    r99126 r99754  
    3535}
    3636
     37void StringObject::vtableAnchor()
     38{
     39}
     40
    3741void StringObject::finishCreation(JSGlobalData& globalData, JSString* string)
    3842{
     
    5862}
    5963
    60 bool StringObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     64bool StringObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    6165{
    62     if (internalValue()->getStringPropertyDescriptor(exec, propertyName, descriptor))
     66    StringObject* thisObject = static_cast<StringObject*>(object);
     67    if (thisObject->internalValue()->getStringPropertyDescriptor(exec, propertyName, descriptor))
    6368        return true;   
    64     return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     69    return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    6570}
    6671
  • trunk/Source/JavaScriptCore/runtime/StringObject.h

    r99126 r99754  
    3131        typedef JSWrapperObject Base;
    3232
     33        virtual void vtableAnchor();
     34
    3335        static StringObject* create(ExecState* exec, Structure* structure)
    3436        {
     
    4850        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    4951        static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    50         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     52        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5153
    5254        static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r98624 r99754  
    151151}
    152152
    153 bool StringPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    154 {
    155     return getStaticFunctionDescriptor<StringObject>(exec, ExecState::stringTable(exec), this, propertyName, descriptor);
     153bool StringPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     154{
     155    return getStaticFunctionDescriptor<StringObject>(exec, ExecState::stringTable(exec), static_cast<StringPrototype*>(object), propertyName, descriptor);
    156156}
    157157
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.h

    r98501 r99754  
    4444
    4545        static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    46         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     46        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    4747
    4848        static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
  • trunk/Source/WebCore/ChangeLog

    r99752 r99754  
     12011-11-09  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        De-virtualize JSObject::getOwnPropertyDescriptor
     4        https://bugs.webkit.org/show_bug.cgi?id=71523
     5
     6        Reviewed by Sam Weinig.
     7
     8        No new tests.
     9
     10        Added getOwnPropertyDescriptor to the MethodTable, changed all of the
     11        virtual versions of getOwnPropertyDescriptor to static ones, and
     12        changed all of the call sites to the corresponding lookup in the MethodTable.
     13
     14        * WebCore.exp.in:
     15        * bindings/js/JSDOMWindowCustom.cpp:
     16        (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
     17        * bindings/js/JSDOMWindowShell.cpp:
     18        (WebCore::JSDOMWindowShell::getOwnPropertyDescriptor):
     19        * bindings/js/JSDOMWindowShell.h:
     20        * bindings/js/JSWorkerContextCustom.cpp:
     21        (WebCore::JSWorkerContext::getOwnPropertyDescriptorDelegate):
     22        * bindings/scripts/CodeGeneratorJS.pm:
     23        (GenerateGetOwnPropertyDescriptorBody):
     24        (GenerateHeader):
     25        (GenerateImplementation):
     26        (GenerateConstructorDeclaration):
     27        (GenerateConstructorDefinition):
     28        * bindings/scripts/test/JS/JSTestInterface.cpp:
     29        (WebCore::JSTestInterfaceConstructor::getOwnPropertyDescriptor):
     30        (WebCore::JSTestInterface::getOwnPropertyDescriptor):
     31        * bindings/scripts/test/JS/JSTestInterface.h:
     32        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
     33        (WebCore::JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor):
     34        (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor):
     35        (WebCore::JSTestMediaQueryListListener::getOwnPropertyDescriptor):
     36        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
     37        * bindings/scripts/test/JS/JSTestObj.cpp:
     38        (WebCore::JSTestObjConstructor::getOwnPropertyDescriptor):
     39        (WebCore::JSTestObjPrototype::getOwnPropertyDescriptor):
     40        (WebCore::JSTestObj::getOwnPropertyDescriptor):
     41        * bindings/scripts/test/JS/JSTestObj.h:
     42        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
     43        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor):
     44        (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor):
     45        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
     46        * bridge/objc/objc_runtime.h:
     47        * bridge/objc/objc_runtime.mm:
     48        (JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertyDescriptor):
     49        * bridge/qt/qt_runtime.cpp:
     50        (JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertyDescriptor):
     51        (JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertyDescriptor):
     52        * bridge/qt/qt_runtime.h:
     53        * bridge/runtime_array.cpp:
     54        (JSC::RuntimeArray::getOwnPropertyDescriptor):
     55        * bridge/runtime_array.h:
     56        * bridge/runtime_method.cpp:
     57        (JSC::RuntimeMethod::vtableAnchor): Added to prevent a weak vtable.
     58        (JSC::RuntimeMethod::getOwnPropertyDescriptor):
     59        * bridge/runtime_method.h: Changed getOwnPropertyDescriptor from private to protected to allow
     60        subclasses to use it in their MethodTables.
     61        * bridge/runtime_object.cpp:
     62        (JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):
     63        * bridge/runtime_object.h:
     64
    1652011-11-09  Julien Chaffraix  <jchaffraix@webkit.org>
    266
  • trunk/Source/WebCore/WebCore.exp.in

    r99665 r99754  
    17071707#if USE(PLUGIN_HOST_PROCESS)
    17081708__ZN3JSC13RuntimeMethod11getCallDataEPNS_6JSCellERNS_8CallDataE
     1709__ZN3JSC13RuntimeMethod12vtableAnchorEv
    17091710__ZN3JSC13RuntimeMethod14finishCreationERNS_12JSGlobalDataERKNS_10IdentifierE
    17101711__ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    1711 __ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
     1712__ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    17121713__ZN3JSC13RuntimeMethod6s_infoE
    17131714__ZN3JSC13RuntimeMethodC2EPNS_14JSGlobalObjectEPNS_9StructureERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE
     
    17201721__ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    17211722__ZN3JSC8Bindings13RuntimeObject19getOwnPropertyNamesEPNS_8JSObjectEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
    1722 __ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
     1723__ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    17231724__ZN3JSC8Bindings13RuntimeObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
    17241725__ZN3JSC8Bindings13RuntimeObject6s_infoE
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r99675 r99754  
    268268}
    269269
    270 bool JSDOMWindow::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    271 {
     270bool JSDOMWindow::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     271{
     272    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(object);
    272273    // Never allow cross-domain getOwnPropertyDescriptor
    273     if (!allowsAccessFrom(exec))
     274    if (!thisObject->allowsAccessFrom(exec))
    274275        return false;
    275276
     
    277278   
    278279    // We don't want any properties other than "close" and "closed" on a closed window.
    279     if (!impl()->frame()) {
     280    if (!thisObject->impl()->frame()) {
    280281        // The following code is safe for cross-domain and same domain use.
    281282        // It ignores any custom properties that might be set on the DOMWindow (including a custom prototype).
     
    288289        if (entry && (entry->attributes() & Function) && entry->function() == jsDOMWindowPrototypeFunctionClose) {
    289290            PropertySlot slot;
    290             slot.setCustom(this, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
     291            slot.setCustom(thisObject, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
    291292            descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
    292293            return true;
     
    299300    if (entry) {
    300301        PropertySlot slot;
    301         slot.setCustom(this, entry->propertyGetter());
     302        slot.setCustom(thisObject, entry->propertyGetter());
    302303        descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
    303304        return true;
     
    309310    // are in Moz but not IE. Since we have some of these, we have to do
    310311    // it the Moz way.
    311     if (impl()->frame()->tree()->child(identifierToAtomicString(propertyName))) {
     312    if (thisObject->impl()->frame()->tree()->child(identifierToAtomicString(propertyName))) {
    312313        PropertySlot slot;
    313         slot.setCustom(this, childFrameGetter);
     314        slot.setCustom(thisObject, childFrameGetter);
    314315        descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
    315316        return true;
     
    318319    bool ok;
    319320    unsigned i = propertyName.toArrayIndex(ok);
    320     if (ok && i < impl()->frame()->tree()->childCount()) {
     321    if (ok && i < thisObject->impl()->frame()->tree()->childCount()) {
    321322        PropertySlot slot;
    322         slot.setCustomIndex(this, i, indexGetter);
     323        slot.setCustomIndex(thisObject, i, indexGetter);
    323324        descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
    324325        return true;
     
    326327
    327328    // Allow shortcuts like 'Image1' instead of document.images.Image1
    328     Document* document = impl()->frame()->document();
     329    Document* document = thisObject->impl()->frame()->document();
    329330    if (document->isHTMLDocument()) {
    330331        AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
    331332        if (atomicPropertyName && (static_cast<HTMLDocument*>(document)->hasNamedItem(atomicPropertyName) || document->hasElementWithId(atomicPropertyName))) {
    332333            PropertySlot slot;
    333             slot.setCustom(this, namedItemGetter);
     334            slot.setCustom(thisObject, namedItemGetter);
    334335            descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
    335336            return true;
     
    337338    }
    338339   
    339     return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     340    return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    340341}
    341342
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp

    r99675 r99754  
    9797}
    9898
    99 bool JSDOMWindowShell::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     99bool JSDOMWindowShell::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    100100{
    101     return window()->getOwnPropertyDescriptor(exec, propertyName, descriptor);
     101    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object);
     102    return thisObject->window()->methodTable()->getOwnPropertyDescriptor(thisObject->window(), exec, propertyName, descriptor);
    102103}
    103104
  • trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h

    r99675 r99754  
    8181        static JSC::UString className(const JSC::JSObject*);
    8282        static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    83         virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
     83        static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    8484        static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
    8585        static void putWithAttributes(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, unsigned attributes);
  • trunk/Source/WebCore/bindings/js/JSWorkerContextCustom.cpp

    r97537 r99754  
    8181{
    8282    // Look for overrides before looking at any of our own properties.
    83     if (JSGlobalObject::getOwnPropertyDescriptor(exec, propertyName, descriptor))
     83    if (JSGlobalObject::getOwnPropertyDescriptor(this, exec, propertyName, descriptor))
    8484        return true;
    8585    return false;
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r99675 r99754  
    518518    if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) {
    519519        if ($interfaceName eq "DOMWindow") {
    520             push(@implContent, "    if (!static_cast<$className*>(thisObject)->allowsAccessFrom(exec))\n");
     520            push(@implContent, "    if (!thisObject->allowsAccessFrom(exec))\n");
    521521        } else {
    522             push(@implContent, "    if (!allowsAccessFromFrame(exec, static_cast<$className*>(thisObject)->impl()->frame()))\n");
     522            push(@implContent, "    if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))\n");
    523523        }
    524524        push(@implContent, "        return false;\n");
     
    526526   
    527527    if ($interfaceName eq "NamedNodeMap" or $interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") {
    528         push(@getOwnPropertyDescriptorImpl, "    ${namespaceMaybe}JSValue proto = prototype();\n");
     528        push(@getOwnPropertyDescriptorImpl, "    ${namespaceMaybe}JSValue proto = thisObject->prototype();\n");
    529529        push(@getOwnPropertyDescriptorImpl, "    if (proto.isObject() && static_cast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n");
    530530        push(@getOwnPropertyDescriptorImpl, "        return false;\n\n");
     
    537537            push(@getOwnPropertyDescriptorImpl, "    if (entry) {\n");
    538538            push(@getOwnPropertyDescriptorImpl, "        PropertySlot slot;\n");
    539             push(@getOwnPropertyDescriptorImpl, "        slot.setCustom(this, entry->propertyGetter());\n");
     539            push(@getOwnPropertyDescriptorImpl, "        slot.setCustom(thisObject, entry->propertyGetter());\n");
    540540            push(@getOwnPropertyDescriptorImpl, "        descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());\n");
    541541            push(@getOwnPropertyDescriptorImpl, "        return true;\n");
     
    551551        push(@getOwnPropertyDescriptorImpl, "    bool ok;\n");
    552552        push(@getOwnPropertyDescriptorImpl, "    unsigned index = propertyName.toUInt32(ok);\n");
    553         push(@getOwnPropertyDescriptorImpl, "    if (ok && index < static_cast<$implClassName*>(impl())->length()) {\n");
     553        push(@getOwnPropertyDescriptorImpl, "    if (ok && index < static_cast<$implClassName*>(thisObject->impl())->length()) {\n");
    554554        if ($dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
    555555            # Assume that if there's a setter, the index will be writable
    556556            if ($dataNode->extendedAttributes->{"HasIndexSetter"} || $dataNode->extendedAttributes->{"HasCustomIndexSetter"}) {
    557                 push(@getOwnPropertyDescriptorImpl, "        descriptor.setDescriptor(getByIndex(exec, index), ${namespaceMaybe}DontDelete);\n");
     557                push(@getOwnPropertyDescriptorImpl, "        descriptor.setDescriptor(thisObject->getByIndex(exec, index), ${namespaceMaybe}DontDelete);\n");
    558558            } else {
    559                 push(@getOwnPropertyDescriptorImpl, "        descriptor.setDescriptor(getByIndex(exec, index), ${namespaceMaybe}DontDelete | ${namespaceMaybe}ReadOnly);\n");
     559                push(@getOwnPropertyDescriptorImpl, "        descriptor.setDescriptor(thisObject->getByIndex(exec, index), ${namespaceMaybe}DontDelete | ${namespaceMaybe}ReadOnly);\n");
    560560            }
    561561        } else {
    562562            push(@getOwnPropertyDescriptorImpl, "        ${namespaceMaybe}PropertySlot slot;\n");
    563             push(@getOwnPropertyDescriptorImpl, "        slot.setCustomIndex(this, index, indexGetter);\n");
     563            push(@getOwnPropertyDescriptorImpl, "        slot.setCustomIndex(thisObject, index, indexGetter);\n");
    564564            # Assume that if there's a setter, the index will be writable
    565565            if ($dataNode->extendedAttributes->{"HasIndexSetter"} || $dataNode->extendedAttributes->{"HasCustomIndexSetter"}) {
     
    574574   
    575575    if ($dataNode->extendedAttributes->{"HasNameGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
    576         push(@getOwnPropertyDescriptorImpl, "    if (canGetItemsForName(exec, static_cast<$implClassName*>(impl()), propertyName)) {\n");
     576        push(@getOwnPropertyDescriptorImpl, "    if (canGetItemsForName(exec, static_cast<$implClassName*>(thisObject->impl()), propertyName)) {\n");
    577577        push(@getOwnPropertyDescriptorImpl, "        ${namespaceMaybe}PropertySlot slot;\n");
    578         push(@getOwnPropertyDescriptorImpl, "        slot.setCustom(this, nameGetter);\n");
     578        push(@getOwnPropertyDescriptorImpl, "        slot.setCustom(thisObject, nameGetter);\n");
    579579        push(@getOwnPropertyDescriptorImpl, "        descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);\n");
    580580        push(@getOwnPropertyDescriptorImpl, "        return true;\n");
     
    592592   
    593593    if ($dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"}) {
    594         push(@getOwnPropertyDescriptorImpl, "    if (getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n");
     594        push(@getOwnPropertyDescriptorImpl, "    if (thisObject->getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n");
    595595        push(@getOwnPropertyDescriptorImpl, "        return true;\n");
    596596    }
     
    599599        if ($inlined) {
    600600            die "Cannot inline if NoStaticTables is set." if ($dataNode->extendedAttributes->{"NoStaticTables"});
    601             push(@getOwnPropertyDescriptorImpl, "    return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, s_info.staticPropHashTable, this, propertyName, descriptor);\n");
     601            push(@getOwnPropertyDescriptorImpl, "    return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, s_info.staticPropHashTable, thisObject, propertyName, descriptor);\n");
    602602        } else {
    603             push(@getOwnPropertyDescriptorImpl, "    return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, " . hashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", this, propertyName, descriptor);\n");
     603            push(@getOwnPropertyDescriptorImpl, "    return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, " . hashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n");
    604604        }
    605605    } else {
    606         push(@getOwnPropertyDescriptorImpl, "    return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);\n");
     606        push(@getOwnPropertyDescriptorImpl, "    return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);\n");
    607607    }
    608608   
     
    775775    if ($hasGetter) {
    776776        push(@headerContent, "    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);\n");
    777         push(@headerContent, "    virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);\n");
     777        push(@headerContent, "    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);\n");
    778778        push(@headerContent, "    static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n") if ($dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) && !$dataNode->extendedAttributes->{"HasOverridingNameGetter"};
    779779        push(@headerContent, "    bool getOwnPropertySlotDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"};
     
    972972        push(@headerContent, GenerateGetOwnPropertySlotBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 1));
    973973        push(@headerContent, "}\n\n");
    974         push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertyDescriptor(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor)\n");
     974        push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertyDescriptor(JSC::JSObject* object, JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor)\n");
    975975        push(@headerContent, "{\n");
    976         push(@headerContent, "    ASSERT_GC_OBJECT_INHERITS(this, &s_info);\n");
     976        push(@headerContent, "    ${className}* thisObject = static_cast<${className}*>(object);\n");
     977        push(@headerContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
    977978        push(@headerContent, GenerateGetOwnPropertyDescriptorBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 1));
    978979        push(@headerContent, "}\n\n");
     
    10361037    if ($numFunctions > 0 || $numConstants > 0 || $dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}) {
    10371038        push(@headerContent, "    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n");
    1038         push(@headerContent, "    virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n");
     1039        push(@headerContent, "    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n");
    10391040        push(@headerContent, "    bool getOwnPropertySlotDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"};
    10401041        push(@headerContent, "    bool getOwnPropertyDescriptorDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n") if $dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"};
     
    14531454        push(@implContent, "}\n\n");
    14541455
    1455         push(@implContent, "bool ${className}Prototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");
     1456        push(@implContent, "bool ${className}Prototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");
    14561457        push(@implContent, "{\n");
    1457        
     1458        push(@implContent, "    ${className}Prototype* thisObject = static_cast<${className}Prototype*>(object);\n");
     1459
    14581460        if ($dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}) {
    1459             push(@implContent, "    if (getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n");
     1461            push(@implContent, "    if (thisObject->getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n");
    14601462            push(@implContent, "        return true;\n");
    14611463        }
    14621464       
    14631465        if ($numConstants eq 0 && $numFunctions eq 0) {
    1464             push(@implContent, "    return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);\n");       
     1466            push(@implContent, "    return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);\n");       
    14651467        } elsif ($numConstants eq 0) {
    1466             push(@implContent, "    return getStaticFunctionDescriptor<JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", this, propertyName, descriptor);\n");
     1468            push(@implContent, "    return getStaticFunctionDescriptor<JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n");
    14671469        } elsif ($numFunctions eq 0) {
    1468             push(@implContent, "    return getStaticValueDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", this, propertyName, descriptor);\n");
     1470            push(@implContent, "    return getStaticValueDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n");
    14691471        } else {
    1470             push(@implContent, "    return getStaticPropertyDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", this, propertyName, descriptor);\n");
     1472            push(@implContent, "    return getStaticPropertyDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n");
    14711473        }
    14721474        push(@implContent, "}\n\n");
     
    15741576            push(@implContent, GenerateGetOwnPropertySlotBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 0));
    15751577            push(@implContent, "}\n\n");
    1576             push(@implContent, "bool ${className}::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");
     1578            push(@implContent, "bool ${className}::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");
    15771579            push(@implContent, "{\n");
    1578             push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(this, &s_info);\n");
     1580            push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(object);\n");
     1581            push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
    15791582            push(@implContent, GenerateGetOwnPropertyDescriptorBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 0));
    15801583            push(@implContent, "}\n\n");
     
    32073210
    32083211    push(@$outputArray, "    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n");
    3209     push(@$outputArray, "    virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n");
     3212    push(@$outputArray, "    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n");
    32103213    push(@$outputArray, "    static const JSC::ClassInfo s_info;\n");
    32113214
     
    32623265    push(@$outputArray, "}\n\n");
    32633266
    3264     push(@$outputArray, "bool ${constructorClassName}::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");
     3267    push(@$outputArray, "bool ${constructorClassName}::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");
    32653268    push(@$outputArray, "{\n");
    3266     push(@$outputArray, "    return getStaticValueDescriptor<${constructorClassName}, JSDOMWrapper>(exec, &${constructorClassName}Table, this, propertyName, descriptor);\n");
     3269    push(@$outputArray, "    return getStaticValueDescriptor<${constructorClassName}, JSDOMWrapper>(exec, &${constructorClassName}Table, static_cast<${constructorClassName}*>(object), propertyName, descriptor);\n");
    32673270    push(@$outputArray, "}\n\n");
    32683271
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r98695 r99754  
    9595}
    9696
    97 bool JSTestInterfaceConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    98 {
    99     return getStaticValueDescriptor<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, this, propertyName, descriptor);
     97bool JSTestInterfaceConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     98{
     99    return getStaticValueDescriptor<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, static_cast<JSTestInterfaceConstructor*>(object), propertyName, descriptor);
    100100}
    101101
     
    181181}
    182182
    183 bool JSTestInterface::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    184 {
    185     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
    186     return getStaticValueDescriptor<JSTestInterface, Base>(exec, &JSTestInterfaceTable, this, propertyName, descriptor);
     183bool JSTestInterface::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     184{
     185    JSTestInterface* thisObject = static_cast<JSTestInterface*>(object);
     186    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     187    return getStaticValueDescriptor<JSTestInterface, Base>(exec, &JSTestInterfaceTable, thisObject, propertyName, descriptor);
    187188}
    188189
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h

    r98695 r99754  
    4444    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
    4545    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    46     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
     46    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    4747    static const JSC::ClassInfo s_info;
    4848
     
    120120
    121121    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
    122     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
     122    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
    123123    static const JSC::ClassInfo s_info;
    124124    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp

    r99244 r99754  
    9393}
    9494
    95 bool JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    96 {
    97     return getStaticValueDescriptor<JSTestMediaQueryListListenerConstructor, JSDOMWrapper>(exec, &JSTestMediaQueryListListenerConstructorTable, this, propertyName, descriptor);
     95bool JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     96{
     97    return getStaticValueDescriptor<JSTestMediaQueryListListenerConstructor, JSDOMWrapper>(exec, &JSTestMediaQueryListListenerConstructorTable, static_cast<JSTestMediaQueryListListenerConstructor*>(object), propertyName, descriptor);
    9898}
    9999
     
    131131}
    132132
    133 bool JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    134 {
    135     return getStaticFunctionDescriptor<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, this, propertyName, descriptor);
     133bool JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     134{
     135    JSTestMediaQueryListListenerPrototype* thisObject = static_cast<JSTestMediaQueryListListenerPrototype*>(object);
     136    return getStaticFunctionDescriptor<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, thisObject, propertyName, descriptor);
    136137}
    137138
     
    162163}
    163164
    164 bool JSTestMediaQueryListListener::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    165 {
    166     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
    167     return getStaticValueDescriptor<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, this, propertyName, descriptor);
     165bool JSTestMediaQueryListListener::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     166{
     167    JSTestMediaQueryListListener* thisObject = static_cast<JSTestMediaQueryListListener*>(object);
     168    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     169    return getStaticValueDescriptor<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, thisObject, propertyName, descriptor);
    168170}
    169171
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h

    r98552 r99754  
    4242    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
    4343    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    44     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
     44    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    4545    static const JSC::ClassInfo s_info;
    4646
     
    7777    static const JSC::ClassInfo s_info;
    7878    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
    79     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
     79    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
    8080    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
    8181    {
     
    104104
    105105    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
    106     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
     106    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
    107107    static const JSC::ClassInfo s_info;
    108108    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r99673 r99754  
    198198}
    199199
    200 bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    201 {
    202     return getStaticValueDescriptor<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, this, propertyName, descriptor);
     200bool JSTestObjConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     201{
     202    return getStaticValueDescriptor<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, static_cast<JSTestObjConstructor*>(object), propertyName, descriptor);
    203203}
    204204
     
    305305}
    306306
    307 bool JSTestObjPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    308 {
    309     return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, descriptor);
     307bool JSTestObjPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     308{
     309    JSTestObjPrototype* thisObject = static_cast<JSTestObjPrototype*>(object);
     310    return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, descriptor);
    310311}
    311312
     
    336337}
    337338
    338 bool JSTestObj::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    339 {
    340     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
    341     return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, descriptor);
     339bool JSTestObj::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     340{
     341    JSTestObj* thisObject = static_cast<JSTestObj*>(object);
     342    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     343    return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, descriptor);
    342344}
    343345
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h

    r99673 r99754  
    4242    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
    4343    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    44     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
     44    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    4545    static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
    4646    static const JSC::ClassInfo s_info;
     
    9090    static const JSC::ClassInfo s_info;
    9191    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
    92     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
     92    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
    9393    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
    9494    {
     
    117117
    118118    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
    119     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
     119    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
    120120    static const JSC::ClassInfo s_info;
    121121    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp

    r98552 r99754  
    9494}
    9595
    96 bool JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     96bool JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    9797{
    98     return getStaticValueDescriptor<JSTestSerializedScriptValueInterfaceConstructor, JSDOMWrapper>(exec, &JSTestSerializedScriptValueInterfaceConstructorTable, this, propertyName, descriptor);
     98    return getStaticValueDescriptor<JSTestSerializedScriptValueInterfaceConstructor, JSDOMWrapper>(exec, &JSTestSerializedScriptValueInterfaceConstructorTable, static_cast<JSTestSerializedScriptValueInterfaceConstructor*>(object), propertyName, descriptor);
    9999}
    100100
     
    151151}
    152152
    153 bool JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     153bool JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    154154{
    155     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
    156     return getStaticValueDescriptor<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, this, propertyName, descriptor);
     155    JSTestSerializedScriptValueInterface* thisObject = static_cast<JSTestSerializedScriptValueInterface*>(object);
     156    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     157    return getStaticValueDescriptor<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, thisObject, propertyName, descriptor);
    157158}
    158159
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h

    r98552 r99754  
    4444    static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
    4545    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    46     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
     46    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    4747    static const JSC::ClassInfo s_info;
    4848
     
    104104
    105105    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
    106     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
     106    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
    107107    static const JSC::ClassInfo s_info;
    108108    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
  • trunk/Source/WebCore/bridge/objc/objc_runtime.h

    r98932 r99754  
    125125    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;
    126126    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    127     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     127    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    128128    static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
    129129    static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/WebCore/bridge/objc/objc_runtime.mm

    r98932 r99754  
    213213}
    214214
    215 bool ObjcFallbackObjectImp::getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor& descriptor)
     215bool ObjcFallbackObjectImp::getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor& descriptor)
    216216{
    217217    // keep the prototype from getting called instead of just returning false
  • trunk/Source/WebCore/bridge/qt/qt_runtime.cpp

    r99436 r99754  
    15121512}
    15131513
    1514 bool QtRuntimeMetaMethod::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    1515 {
     1514bool QtRuntimeMetaMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     1515{
     1516    QtRuntimeMetaMethod* thisObject = static_cast<QtRuntimeMetaMethod*>(object);
    15161517    if (propertyName == "connect") {
    15171518        PropertySlot slot;
    1518         slot.setCustom(this, connectGetter);
     1519        slot.setCustom(thisObject, connectGetter);
    15191520        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
    15201521        return true;
     
    15231524    if (propertyName == "disconnect") {
    15241525        PropertySlot slot;
    1525         slot.setCustom(this, disconnectGetter);
     1526        slot.setCustom(thisObject, disconnectGetter);
    15261527        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
    15271528        return true;
     
    15301531    if (propertyName == exec->propertyNames().length) {
    15311532        PropertySlot slot;
    1532         slot.setCustom(this, lengthGetter);
     1533        slot.setCustom(thisObject, lengthGetter);
    15331534        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
    15341535        return true;
    15351536    }
    15361537
    1537     return QtRuntimeMethod::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     1538    return QtRuntimeMethod::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    15381539}
    15391540
     
    17481749}
    17491750
    1750 bool QtRuntimeConnectionMethod::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    1751 {
     1751bool QtRuntimeConnectionMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     1752{
     1753    QtRuntimeConnectionMethod* thisObject = static_cast<QtRuntimeConnectionMethod*>(object);
    17521754    if (propertyName == exec->propertyNames().length) {
    17531755        PropertySlot slot;
    1754         slot.setCustom(this, lengthGetter);
     1756        slot.setCustom(thisObject, lengthGetter);
    17551757        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
    17561758        return true;
    17571759    }
    17581760
    1759     return QtRuntimeMethod::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     1761    return QtRuntimeMethod::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    17601762}
    17611763
  • trunk/Source/WebCore/bridge/qt/qt_runtime.h

    r99126 r99754  
    166166
    167167    static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&);
    168     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     168    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    169169    static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
    170170
     
    206206
    207207    static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&);
    208     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     208    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    209209    static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
    210210 
  • trunk/Source/WebCore/bridge/runtime_array.cpp

    r99126 r99754  
    100100}
    101101
    102 bool RuntimeArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     102bool RuntimeArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    103103{
     104    RuntimeArray* thisObject = static_cast<RuntimeArray*>(object);
    104105    if (propertyName == exec->propertyNames().length) {
    105106        PropertySlot slot;
    106         slot.setCustom(this, lengthGetter);
     107        slot.setCustom(thisObject, lengthGetter);
    107108        descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
    108109        return true;
     
    112113    unsigned index = propertyName.toArrayIndex(ok);
    113114    if (ok) {
    114         if (index < getLength()) {
     115        if (index < thisObject->getLength()) {
    115116            PropertySlot slot;
    116             slot.setCustomIndex(this, index, indexGetter);
     117            slot.setCustomIndex(thisObject, index, indexGetter);
    117118            descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | DontEnum);
    118119            return true;
     
    120121    }
    121122   
    122     return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     123    return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    123124}
    124125
  • trunk/Source/WebCore/bridge/runtime_array.h

    r99126 r99754  
    5353    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
    5454    static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned, PropertySlot&);
    55     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     55    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    5656    static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
    5757    static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
  • trunk/Source/WebCore/bridge/runtime_method.cpp

    r98501 r99754  
    5151}
    5252
     53void RuntimeMethod::vtableAnchor()
     54{
     55}
     56
    5357void RuntimeMethod::finishCreation(JSGlobalData& globalData, const Identifier& ident)
    5458{
     
    8185}
    8286
    83 bool RuntimeMethod::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor &descriptor)
     87bool RuntimeMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor &descriptor)
    8488{
     89    RuntimeMethod* thisObject = static_cast<RuntimeMethod*>(object);
    8590    if (propertyName == exec->propertyNames().length) {
    8691        PropertySlot slot;
    87         slot.setCustom(this, lengthGetter);
     92        slot.setCustom(thisObject, lengthGetter);
    8893        descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
    8994        return true;
    9095    }
    9196   
    92     return InternalFunction::getOwnPropertyDescriptor(exec, propertyName, descriptor);
     97    return InternalFunction::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    9398}
    9499
  • trunk/Source/WebCore/bridge/runtime_method.h

    r98501 r99754  
    3838    typedef InternalFunction Base;
    3939
     40    virtual void vtableAnchor();
     41
    4042    static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& methodList)
    4143    {
     
    6668
    6769    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
     70    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
    6871
    6972private:
    7073    static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
    71     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    7274
    7375    OwnPtr<Bindings::MethodList> _methodList;
  • trunk/Source/WebCore/bridge/runtime_object.cpp

    r99126 r99754  
    163163}
    164164
    165 bool RuntimeObject::getOwnPropertyDescriptor(ExecState *exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    166 {
    167     if (!m_instance) {
     165bool RuntimeObject::getOwnPropertyDescriptor(JSObject* object, ExecState *exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     166{
     167    RuntimeObject* thisObject = static_cast<RuntimeObject*>(object);
     168    if (!thisObject->m_instance) {
    168169        throwInvalidAccessError(exec);
    169170        return false;
    170171    }
    171172   
    172     RefPtr<Instance> instance = m_instance;
     173    RefPtr<Instance> instance = thisObject->m_instance;
    173174    instance->begin();
    174175   
     
    180181        if (aField) {
    181182            PropertySlot slot;
    182             slot.setCustom(this, fieldGetter);
     183            slot.setCustom(thisObject, fieldGetter);
    183184            instance->end();
    184185            descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete);
     
    190191            if (methodList.size() > 0) {
    191192                PropertySlot slot;
    192                 slot.setCustom(this, methodGetter);
     193                slot.setCustom(thisObject, methodGetter);
    193194                instance->end();
    194195                descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
     
    200201        if (!aClass->fallbackObject(exec, instance.get(), propertyName).isUndefined()) {
    201202            PropertySlot slot;
    202             slot.setCustom(this, fallbackObjectGetter);
     203            slot.setCustom(thisObject, fallbackObjectGetter);
    203204            instance->end();
    204205            descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum);
     
    209210    instance->end();
    210211   
    211     return instance->getOwnPropertyDescriptor(this, exec, propertyName, descriptor);
     212    return instance->getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    212213}
    213214
  • trunk/Source/WebCore/bridge/runtime_object.h

    r99126 r99754  
    4747
    4848    static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
    49     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier& propertyName, PropertyDescriptor&);
     49    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier& propertyName, PropertyDescriptor&);
    5050    static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
    5151    static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
  • trunk/Source/WebKit2/ChangeLog

    r99735 r99754  
     12011-11-09  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        De-virtualize JSObject::getOwnPropertyDescriptor
     4        https://bugs.webkit.org/show_bug.cgi?id=71523
     5
     6        Reviewed by Sam Weinig.
     7
     8        Added getOwnPropertyDescriptor to the MethodTable, changed all of the
     9        virtual versions of getOwnPropertyDescriptor to static ones, and
     10        changed all of the call sites to the corresponding lookup in the MethodTable.
     11
     12        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
     13        (WebKit::JSNPObject::getOwnPropertyDescriptor):
     14        * WebProcess/Plugins/Netscape/JSNPObject.h:
     15
    1162011-11-09  Alexandru Chiculita  <achicu@adobe.com>
    217
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp

    r99126 r99754  
    274274}
    275275
    276 bool JSNPObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    277 {
    278     ASSERT_GC_OBJECT_INHERITS(this, &s_info);
    279     if (!m_npObject) {
     276bool JSNPObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
     277{
     278    JSNPObject* thisObject = static_cast<JSNPObject*>(object);
     279    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     280    if (!thisObject->m_npObject) {
    280281        throwInvalidAccessError(exec);
    281282        return false;
     
    285286
    286287    // First, check if the NPObject has a property with this name.
    287     if (m_npObject->_class->hasProperty && m_npObject->_class->hasProperty(m_npObject, npIdentifier)) {
     288    if (thisObject->m_npObject->_class->hasProperty && thisObject->m_npObject->_class->hasProperty(thisObject->m_npObject, npIdentifier)) {
    288289        PropertySlot slot;
    289         slot.setCustom(this, propertyGetter);
     290        slot.setCustom(thisObject, propertyGetter);
    290291        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete);
    291292        return true;
     
    293294
    294295    // Second, check if the NPObject has a method with this name.
    295     if (m_npObject->_class->hasMethod && m_npObject->_class->hasMethod(m_npObject, npIdentifier)) {
     296    if (thisObject->m_npObject->_class->hasMethod && thisObject->m_npObject->_class->hasMethod(thisObject->m_npObject, npIdentifier)) {
    296297        PropertySlot slot;
    297         slot.setCustom(this, methodGetter);
     298        slot.setCustom(thisObject, methodGetter);
    298299        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
    299300        return true;
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h

    r99126 r99754  
    8484
    8585    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
    86     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
     86    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
    8787    static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
    8888
Note: See TracChangeset for help on using the changeset viewer.