Changeset 96996 in webkit


Ignore:
Timestamp:
Oct 7, 2011 6:44:10 PM (13 years ago)
Author:
mhahnenberg@apple.com
Message:

Remove getCallDataVirtual methods
https://bugs.webkit.org/show_bug.cgi?id=69186

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Removed all getCallDataVirtual methods and replaced their call sites
with an explicit lookup in the MethodTable.

  • API/JSCallbackFunction.cpp:
  • API/JSCallbackFunction.h:
  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h:
  • API/JSObjectRef.cpp:

(JSObjectIsFunction):
(JSObjectCallAsFunction):

(JSC::Interpreter::privateExecute):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/ArrayConstructor.cpp:
  • runtime/ArrayConstructor.h:
  • runtime/BooleanConstructor.cpp:
  • runtime/BooleanConstructor.h:
  • runtime/DateConstructor.cpp:
  • runtime/DateConstructor.h:
  • runtime/Error.cpp:

(JSC::createTypeErrorFunction):

Moved StrictModeTypeErrorFunction to Error.h in order to be able to include
the class definition in JSGlobalObject.cpp.

  • runtime/Error.h:

(JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
(JSC::StrictModeTypeErrorFunction::create):
(JSC::StrictModeTypeErrorFunction::constructThrowTypeError):
(JSC::StrictModeTypeErrorFunction::getConstructData):
(JSC::StrictModeTypeErrorFunction::callThrowTypeError):
(JSC::StrictModeTypeErrorFunction::getCallData):
(JSC::StrictModeTypeErrorFunction::createStructure):

  • runtime/ErrorConstructor.cpp:
  • runtime/ErrorConstructor.h:
  • runtime/FunctionConstructor.cpp:
  • runtime/FunctionConstructor.h:
  • runtime/FunctionPrototype.cpp:
  • runtime/FunctionPrototype.h:

To allow subclasses of InternalFunction (e.g. QtRuntimeMethod) to not have
to declare their own ClassInfo if they don't override getCallData, provided
an implementation that calls ASSERT_NOT_REACHED if called, providing roughly the same
functionality as of the pure virtual method InternalFunction used to have.
Also made this new implementation protected rather than private for the same reason.
Also added an ASSERT in InternalFunction::finishCreation to make sure that whatever
object is being created provides their own implementation of getCallData. This
just makes execution fail earlier in a place where the source of the error is
easy to trace. These ASSERTs are better than putting a null in the MethodTable because
they appear much more intentional to anybody who fails to provide their own
implementation or who tries to explicitly call InternalFunction::getCallData.

  • runtime/InternalFunction.cpp:

(JSC::InternalFunction::finishCreation):
(JSC::InternalFunction::getCallData):

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

Added a global structure to JSGlobalObject for StrictModeTypeErrorFunction to enable
it to be reused rather than creating a new Structure every time we instantiate it.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):
(JSC::JSGlobalObject::visitChildren):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::strictModeTypeErrorFunctionStructure):

  • runtime/JSONObject.cpp:

(JSC::Stringifier::Stringifier):
(JSC::Stringifier::toJSON):
(JSC::Stringifier::appendStringifiedValue):

  • runtime/JSObject.cpp:

(JSC::JSObject::put):

  • runtime/JSObject.h:

(JSC::getCallData):

  • runtime/NativeErrorConstructor.cpp:
  • runtime/NativeErrorConstructor.h:
  • runtime/NumberConstructor.cpp:
  • runtime/NumberConstructor.h:
  • runtime/ObjectConstructor.cpp:
  • runtime/ObjectConstructor.h:
  • runtime/Operations.cpp:

(JSC::jsTypeStringForValue):
(JSC::jsIsObjectType):
(JSC::jsIsFunctionType):

  • runtime/PropertySlot.cpp:

(JSC::PropertySlot::functionGetter):

  • runtime/RegExpConstructor.cpp:
  • runtime/RegExpConstructor.h:
  • runtime/StringConstructor.cpp:
  • runtime/StringConstructor.h:
  • runtime/Structure.h:

Source/JavaScriptGlue:

Removed all getCallDataVirtual methods and replaced their call sites
with an explicit lookup in the MethodTable.

  • JSValueWrapper.cpp:

(JSValueWrapper::JSObjectCallFunction):

  • UserObjectImp.cpp:
  • UserObjectImp.h:

Source/WebCore:

No new tests.

Removed all getCallDataVirtual methods and replaced their call sites
with an explicit lookup in the MethodTable.

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

(WebCore::JSCallbackData::invokeCallback):

  • bindings/js/JSCustomXPathNSResolver.cpp:

(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):

  • bindings/js/JSErrorHandler.cpp:

(WebCore::JSErrorHandler::handleEvent):

  • bindings/js/JSEventListener.cpp:

(WebCore::JSEventListener::handleEvent):

  • bindings/js/JSHTMLAllCollectionCustom.cpp:
  • bindings/js/JSHTMLAppletElementCustom.cpp:
  • bindings/js/JSHTMLEmbedElementCustom.cpp:
  • bindings/js/JSHTMLObjectElementCustom.cpp:
  • bindings/js/JSInjectedScriptHostCustom.cpp:

(WebCore::JSInjectedScriptHost::evaluate):

  • bindings/js/JSPluginElementFunctions.cpp:

(WebCore::runtimeObjectGetCallData):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):

  • bridge/objc/objc_runtime.h:
  • bridge/objc/objc_runtime.mm:
  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::QtRuntimeConnectionMethod::call):
(JSC::Bindings::isJavaScriptFunction):

  • bridge/qt/qt_runtime.h:

(JSC::Bindings::QtRuntimeMetaMethod::createStructure):
(JSC::Bindings::QtRuntimeConnectionMethod::createStructure):

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

Source/WebKit/mac:

Removed all getCallDataVirtual methods and replaced their call sites
with an explicit lookup in the MethodTable.

  • Plugins/Hosted/NetscapePluginInstanceProxy.mm:

(WebKit::NetscapePluginInstanceProxy::invokeDefault):

Source/WebKit2:

Removed all getCallDataVirtual methods and replaced their call sites
with an explicit lookup in the MethodTable.

  • WebProcess/Plugins/Netscape/JSNPMethod.cpp:
  • WebProcess/Plugins/Netscape/JSNPMethod.h:
  • WebProcess/Plugins/Netscape/JSNPObject.cpp:
  • WebProcess/Plugins/Netscape/JSNPObject.h:
Location:
trunk/Source
Files:
80 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp

    r96627 r96996  
    7979}
    8080
    81 CallType JSCallbackFunction::getCallDataVirtual(CallData& callData)
    82 {
    83     return getCallData(this, callData);
    84 }
    85 
    8681CallType JSCallbackFunction::getCallData(JSCell*, CallData& callData)
    8782{
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.h

    r96627 r96996  
    6060
    6161private:
    62     virtual CallType getCallDataVirtual(CallData&);
    6362    static CallType getCallData(JSCell*, CallData&);
    6463
  • trunk/Source/JavaScriptCore/API/JSCallbackObject.h

    r96992 r96996  
    196196
    197197    virtual ConstructType getConstructData(ConstructData&);
    198     virtual CallType getCallDataVirtual(CallData&);
    199198    static CallType getCallData(JSCell*, CallData&);
    200199
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r96992 r96996  
    380380
    381381template <class Parent>
    382 CallType JSCallbackObject<Parent>::getCallDataVirtual(CallData& callData)
    383 {
    384     return getCallData(this, callData);
    385 }
    386 
    387 template <class Parent>
    388382CallType JSCallbackObject<Parent>::getCallData(JSCell* cell, CallData& callData)
    389383{
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r96164 r96996  
    417417{
    418418    CallData callData;
    419     return toJS(object)->getCallDataVirtual(callData) != CallTypeNone;
     419    JSCell* cell = toJS(object);
     420    return cell->methodTable()->getCallData(cell, callData) != CallTypeNone;
    420421}
    421422
     
    436437
    437438    CallData callData;
    438     CallType callType = jsObject->getCallDataVirtual(callData);
     439    CallType callType = jsObject->methodTable()->getCallData(jsObject, callData);
    439440    if (callType == CallTypeNone)
    440441        return 0;
  • trunk/Source/JavaScriptCore/ChangeLog

    r96995 r96996  
     12011-10-07  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Remove getCallDataVirtual methods
     4        https://bugs.webkit.org/show_bug.cgi?id=69186
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Removed all getCallDataVirtual methods and replaced their call sites
     9        with an explicit lookup in the MethodTable.
     10
     11        * API/JSCallbackFunction.cpp:
     12        * API/JSCallbackFunction.h:
     13        * API/JSCallbackObject.h:
     14        * API/JSCallbackObjectFunctions.h:
     15        * API/JSObjectRef.cpp:
     16        (JSObjectIsFunction):
     17        (JSObjectCallAsFunction):
     18        * JavaScriptCore.exp:
     19        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
     20        * interpreter/Interpreter.cpp:
     21        (JSC::Interpreter::privateExecute):
     22        * jit/JITStubs.cpp:
     23        (JSC::DEFINE_STUB_FUNCTION):
     24        * runtime/ArrayConstructor.cpp:
     25        * runtime/ArrayConstructor.h:
     26        * runtime/BooleanConstructor.cpp:
     27        * runtime/BooleanConstructor.h:
     28        * runtime/DateConstructor.cpp:
     29        * runtime/DateConstructor.h:
     30        * runtime/Error.cpp:
     31        (JSC::createTypeErrorFunction):
     32
     33        Moved StrictModeTypeErrorFunction to Error.h in order to be able to include
     34        the class definition in JSGlobalObject.cpp.
     35        * runtime/Error.h:
     36        (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
     37        (JSC::StrictModeTypeErrorFunction::create):
     38        (JSC::StrictModeTypeErrorFunction::constructThrowTypeError):
     39        (JSC::StrictModeTypeErrorFunction::getConstructData):
     40        (JSC::StrictModeTypeErrorFunction::callThrowTypeError):
     41        (JSC::StrictModeTypeErrorFunction::getCallData):
     42        (JSC::StrictModeTypeErrorFunction::createStructure):
     43        * runtime/ErrorConstructor.cpp:
     44        * runtime/ErrorConstructor.h:
     45        * runtime/FunctionConstructor.cpp:
     46        * runtime/FunctionConstructor.h:
     47        * runtime/FunctionPrototype.cpp:
     48        * runtime/FunctionPrototype.h:
     49
     50        To allow subclasses of InternalFunction (e.g. QtRuntimeMethod) to not have
     51        to declare their own ClassInfo if they don't override getCallData, provided
     52        an implementation that calls ASSERT_NOT_REACHED if called, providing roughly the same
     53        functionality as of the pure virtual method InternalFunction used to have.
     54        Also made this new implementation protected rather than private for the same reason.
     55        Also added an ASSERT in InternalFunction::finishCreation to make sure that whatever
     56        object is being created provides their own implementation of getCallData.  This
     57        just makes execution fail earlier in a place where the source of the error is
     58        easy to trace.  These ASSERTs are better than putting a null in the MethodTable because
     59        they appear much more intentional to anybody who fails to provide their own
     60        implementation or who tries to explicitly call InternalFunction::getCallData.
     61        * runtime/InternalFunction.cpp:
     62        (JSC::InternalFunction::finishCreation):
     63        (JSC::InternalFunction::getCallData):
     64        * runtime/InternalFunction.h:
     65        * runtime/JSCell.cpp:
     66        * runtime/JSCell.h:
     67        * runtime/JSFunction.cpp:
     68        * runtime/JSFunction.h:
     69
     70        Added a global structure to JSGlobalObject for StrictModeTypeErrorFunction to enable
     71        it to be reused rather than creating a new Structure every time we instantiate it.
     72        * runtime/JSGlobalObject.cpp:
     73        (JSC::JSGlobalObject::reset):
     74        (JSC::JSGlobalObject::visitChildren):
     75        * runtime/JSGlobalObject.h:
     76        (JSC::JSGlobalObject::strictModeTypeErrorFunctionStructure):
     77        * runtime/JSONObject.cpp:
     78        (JSC::Stringifier::Stringifier):
     79        (JSC::Stringifier::toJSON):
     80        (JSC::Stringifier::appendStringifiedValue):
     81        * runtime/JSObject.cpp:
     82        (JSC::JSObject::put):
     83        * runtime/JSObject.h:
     84        (JSC::getCallData):
     85        * runtime/NativeErrorConstructor.cpp:
     86        * runtime/NativeErrorConstructor.h:
     87        * runtime/NumberConstructor.cpp:
     88        * runtime/NumberConstructor.h:
     89        * runtime/ObjectConstructor.cpp:
     90        * runtime/ObjectConstructor.h:
     91        * runtime/Operations.cpp:
     92        (JSC::jsTypeStringForValue):
     93        (JSC::jsIsObjectType):
     94        (JSC::jsIsFunctionType):
     95        * runtime/PropertySlot.cpp:
     96        (JSC::PropertySlot::functionGetter):
     97        * runtime/RegExpConstructor.cpp:
     98        * runtime/RegExpConstructor.h:
     99        * runtime/StringConstructor.cpp:
     100        * runtime/StringConstructor.h:
     101        * runtime/Structure.h:
     102
    11032011-10-07  Oliver Hunt  <oliver@apple.com>
    2104
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r96992 r96996  
    261261__ZN3JSC6JSCell14deletePropertyEPNS_9ExecStateEj
    262262__ZN3JSC6JSCell16getConstructDataERNS_13ConstructDataE
    263 __ZN3JSC6JSCell18getCallDataVirtualERNS_8CallDataE
    264263__ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    265264__ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r96992 r96996  
    191191    ?get@Structure@JSC@@QAEIAAVJSGlobalData@2@PAVStringImpl@WTF@@AAIAAPAVJSCell@2@@Z
    192192    ?getCallData@JSCell@JSC@@SA?AW4CallType@2@PAV12@AATCallData@2@@Z
    193     ?getCallDataVirtual@JSCell@JSC@@UAE?AW4CallType@2@AATCallData@2@@Z
    194193    ?getConstructData@JSCell@JSC@@UAE?AW4ConstructType@2@AATConstructData@2@@Z
    195194    ?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r96717 r96996  
    28302830                        JSObject* getter = getterSetter->getter();
    28312831                        CallData callData;
    2832                         CallType callType = getter->getCallDataVirtual(callData);
     2832                        CallType callType = getter->methodTable()->getCallData(getter, callData);
    28332833                        JSValue result = call(callFrame, getter, callType, callData, asObject(baseCell), ArgList());
    28342834                        CHECK_FOR_EXCEPTION();
     
    29652965                    JSObject* getter = getterSetter->getter();
    29662966                    CallData callData;
    2967                     CallType callType = getter->getCallDataVirtual(callData);
     2967                    CallType callType = getter->methodTable()->getCallData(getter, callData);
    29682968                    JSValue result = call(callFrame, getter, callType, callData, baseObject, ArgList());
    29692969                    CHECK_FOR_EXCEPTION();
     
    30733073                            JSObject* getter = getterSetter->getter();
    30743074                            CallData callData;
    3075                             CallType callType = getter->getCallDataVirtual(callData);
     3075                            CallType callType = getter->methodTable()->getCallData(getter, callData);
    30763076                            JSValue result = call(callFrame, getter, callType, callData, baseValue, ArgList());
    30773077                            CHECK_FOR_EXCEPTION();
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r96717 r96996  
    17531753    JSObject* getter = asObject(getterSetter->getter());
    17541754    CallData callData;
    1755     CallType callType = getter->getCallDataVirtual(callData);
     1755    CallType callType = getter->methodTable()->getCallData(getter, callData);
    17561756    JSValue result = call(callFrame, getter, callType, callData, stackFrame.args[1].jsObject(), ArgList());
    17571757    if (callFrame->hadException())
     
    21542154#if !ASSERT_DISABLED
    21552155    CallData callData;
    2156     ASSERT(stackFrame.callFrame->callee()->getCallDataVirtual(callData) == CallTypeJS);
     2156    ASSERT(stackFrame.callFrame->callee()->methodTable()->getCallData(stackFrame.callFrame->callee(), callData) == CallTypeJS);
    21572157#endif
    21582158   
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r96164 r96996  
    110110}
    111111
    112 CallType ArrayConstructor::getCallDataVirtual(CallData& callData)
    113 {
    114     return getCallData(this, callData);
    115 }
    116 
    117112CallType ArrayConstructor::getCallData(JSCell*, CallData& callData)
    118113{
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r96164 r96996  
    5656
    5757        virtual ConstructType getConstructData(ConstructData&);
    58         virtual CallType getCallDataVirtual(CallData&);
    5958        static CallType getCallData(JSCell*, CallData&);
    6059    };
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp

    r96674 r96996  
    7171}
    7272
    73 CallType BooleanConstructor::getCallDataVirtual(CallData& callData)
    74 {
    75     return getCallData(this, callData);
    76 }
    77 
    7873CallType BooleanConstructor::getCallData(JSCell*, CallData& callData)
    7974{
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h

    r96674 r96996  
    5252        BooleanConstructor(JSGlobalObject*, Structure*);
    5353        virtual ConstructType getConstructData(ConstructData&);
    54         virtual CallType getCallDataVirtual(CallData&);
    5554        static CallType getCallData(JSCell*, CallData&);
    5655    };
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r96164 r96996  
    177177}
    178178
    179 CallType DateConstructor::getCallDataVirtual(CallData& callData)
    180 {
    181     return getCallData(this, callData);
    182 }
    183 
    184179CallType DateConstructor::getCallData(JSCell*, CallData& callData)
    185180{
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r96164 r96996  
    5353        DateConstructor(JSGlobalObject*, Structure*);
    5454        virtual ConstructType getConstructData(ConstructData&);
    55         virtual CallType getCallDataVirtual(CallData&);
    5655        static CallType getCallData(JSCell*, CallData&);
    5756
  • trunk/Source/JavaScriptCore/runtime/Error.cpp

    r96674 r96996  
    2727#include "ConstructData.h"
    2828#include "ErrorConstructor.h"
     29#include "FunctionPrototype.h"
    2930#include "JSFunction.h"
    3031#include "JSGlobalObject.h"
     
    166167}
    167168
    168 class StrictModeTypeErrorFunction : public InternalFunction {
    169 private:
    170     StrictModeTypeErrorFunction(JSGlobalObject* globalObject, Structure* structure, const UString& message)
    171         : InternalFunction(globalObject, structure)
    172         , m_message(message)
    173     {
    174     }
    175 
    176 public:
    177     typedef InternalFunction Base;
    178 
    179     static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
    180     {
    181         StrictModeTypeErrorFunction* function = new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
    182         function->finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
    183         return function;
    184     }
    185    
    186     static EncodedJSValue JSC_HOST_CALL constructThrowTypeError(ExecState* exec)
    187     {
    188         throwTypeError(exec, static_cast<StrictModeTypeErrorFunction*>(exec->callee())->m_message);
    189         return JSValue::encode(jsNull());
    190     }
    191    
    192     ConstructType getConstructData(ConstructData& constructData)
    193     {
    194         constructData.native.function = constructThrowTypeError;
    195         return ConstructTypeHost;
    196     }
    197    
    198     static EncodedJSValue JSC_HOST_CALL callThrowTypeError(ExecState* exec)
    199     {
    200         throwTypeError(exec, static_cast<StrictModeTypeErrorFunction*>(exec->callee())->m_message);
    201         return JSValue::encode(jsNull());
    202     }
    203 
    204     virtual CallType getCallDataVirtual(CallData& callData)
    205     {
    206         return getCallData(this, callData);
    207     }
    208 
    209     static CallType getCallData(JSCell*, CallData& callData)
    210     {
    211         callData.native.function = callThrowTypeError;
    212         return CallTypeHost;
    213     }
    214 
    215     static const ClassInfo s_info;
    216 
    217     static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
    218     {
    219         return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
    220     }
    221 
    222 private:
    223     UString m_message;
    224 };
    225 
    226169ASSERT_CLASS_FITS_IN_CELL(StrictModeTypeErrorFunction);
    227170
     
    230173JSValue createTypeErrorFunction(ExecState* exec, const UString& message)
    231174{
    232     return StrictModeTypeErrorFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->internalFunctionStructure(), message);
     175    JSGlobalObject* globalObject = exec->lexicalGlobalObject();
     176    return StrictModeTypeErrorFunction::create(exec, globalObject, globalObject->strictModeTypeErrorFunctionStructure(), message);
    233177}
    234178
  • trunk/Source/JavaScriptCore/runtime/Error.h

    r96146 r96996  
    2424#define Error_h
    2525
     26#include "InternalFunction.h"
    2627#include "JSObject.h"
    2728#include <stdint.h>
     
    7475    JSValue createTypeErrorFunction(ExecState* exec, const UString& message);
    7576   
     77    class StrictModeTypeErrorFunction : public InternalFunction {
     78    private:
     79        StrictModeTypeErrorFunction(JSGlobalObject* globalObject, Structure* structure, const UString& message)
     80            : InternalFunction(globalObject, structure)
     81            , m_message(message)
     82        {
     83        }
     84
     85    public:
     86        typedef InternalFunction Base;
     87
     88        static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
     89        {
     90            StrictModeTypeErrorFunction* function = new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
     91            function->finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
     92            return function;
     93        }
     94   
     95        static EncodedJSValue JSC_HOST_CALL constructThrowTypeError(ExecState* exec)
     96        {
     97            throwTypeError(exec, static_cast<StrictModeTypeErrorFunction*>(exec->callee())->m_message);
     98            return JSValue::encode(jsNull());
     99        }
     100   
     101        ConstructType getConstructData(ConstructData& constructData)
     102        {
     103            constructData.native.function = constructThrowTypeError;
     104            return ConstructTypeHost;
     105        }
     106   
     107        static EncodedJSValue JSC_HOST_CALL callThrowTypeError(ExecState* exec)
     108        {
     109            throwTypeError(exec, static_cast<StrictModeTypeErrorFunction*>(exec->callee())->m_message);
     110            return JSValue::encode(jsNull());
     111        }
     112
     113        static CallType getCallData(JSCell*, CallData& callData)
     114        {
     115            callData.native.function = callThrowTypeError;
     116            return CallTypeHost;
     117        }
     118
     119        static const ClassInfo s_info;
     120
     121        static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
     122        {
     123            return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
     124        }
     125
     126    private:
     127        UString m_message;
     128    };
     129
    76130} // namespace JSC
    77131
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp

    r96674 r96996  
    6767}
    6868
    69 CallType ErrorConstructor::getCallDataVirtual(CallData& callData)
    70 {
    71     return getCallData(this, callData);
    72 }
    73 
    7469CallType ErrorConstructor::getCallData(JSCell*, CallData& callData)
    7570{
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h

    r96674 r96996  
    5353        ErrorConstructor(JSGlobalObject*, Structure*);
    5454        virtual ConstructType getConstructData(ConstructData&);
    55         virtual CallType getCallDataVirtual(CallData&);
    5655        static CallType getCallData(JSCell*, CallData&);
    5756    };
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp

    r96674 r96996  
    7272}
    7373
    74 CallType FunctionConstructor::getCallDataVirtual(CallData& callData)
    75 {
    76     return getCallData(this, callData);
    77 }
    78 
    7974// ECMA 15.3.1 The Function Constructor Called as a Function
    8075CallType FunctionConstructor::getCallData(JSCell*, CallData& callData)
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h

    r96674 r96996  
    5050        void finishCreation(ExecState*, FunctionPrototype*);
    5151        virtual ConstructType getConstructData(ConstructData&);
    52         virtual CallType getCallDataVirtual(CallData&);
    5352        static CallType getCallData(JSCell*, CallData&);
    5453    };
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp

    r96674 r96996  
    3535ASSERT_CLASS_FITS_IN_CELL(FunctionPrototype);
    3636
     37const ClassInfo FunctionPrototype::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionPrototype) };
     38
    3739static EncodedJSValue JSC_HOST_CALL functionProtoFuncToString(ExecState*);
    3840static EncodedJSValue JSC_HOST_CALL functionProtoFuncApply(ExecState*);
     
    4042static EncodedJSValue JSC_HOST_CALL functionProtoFuncBind(ExecState*);
    4143
    42 const ClassInfo FunctionPrototype::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionPrototype) };
    43 
    4444FunctionPrototype::FunctionPrototype(JSGlobalObject* globalObject, Structure* structure)
    4545    : InternalFunction(globalObject, structure)
     
    7171{
    7272    return JSValue::encode(jsUndefined());
    73 }
    74 
    75 CallType FunctionPrototype::getCallDataVirtual(CallData& callData)
    76 {
    77     return getCallData(this, callData);
    7873}
    7974
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h

    r96674 r96996  
    5151    private:
    5252        FunctionPrototype(JSGlobalObject*, Structure*);
    53         virtual CallType getCallDataVirtual(CallData&);
    5453        static CallType getCallData(JSCell*, CallData&);
    5554    };
  • trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp

    r95936 r96996  
    5151    Base::finishCreation(globalData);
    5252    ASSERT(inherits(&s_info));
     53    ASSERT(methodTable()->getCallData != InternalFunction::s_info.methodTable.getCallData);
    5354    putDirect(globalData, globalData.propertyNames->name, jsString(&globalData, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);
    5455}
     
    6970}
    7071
     72CallType InternalFunction::getCallData(JSCell*, CallData&)
     73{
     74    ASSERT_NOT_REACHED();
     75    return CallTypeNone;
     76}
     77
    7178const UString InternalFunction::calculatedDisplayName(ExecState* exec)
    7279{
  • trunk/Source/JavaScriptCore/runtime/InternalFunction.h

    r96164 r96996  
    5757        void finishCreation(JSGlobalData&, const Identifier& name);
    5858
     59        static CallType getCallData(JSCell*, CallData&);
     60
    5961    private:
    60         virtual CallType getCallDataVirtual(CallData&) = 0;
    61 
    6262        virtual void vtableAnchor();
    6363    };
  • trunk/Source/JavaScriptCore/runtime/JSCell.cpp

    r96992 r96996  
    5353{
    5454    return isObject() ? static_cast<const JSObject*>(this) : 0;
    55 }
    56 
    57 CallType JSCell::getCallDataVirtual(CallData& callData)
    58 {
    59     return getCallData(this, callData);
    6055}
    6156
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r96992 r96996  
    7474        const JSObject* getObject() const; // NULL if not an object
    7575       
    76         virtual CallType getCallDataVirtual(CallData&);
    7776        static CallType getCallData(JSCell*, CallData&);
    7877        virtual ConstructType getConstructData(ConstructData&);
     
    139138        WriteBarrier<Structure> m_structure;
    140139    };
    141 
     140   
    142141    inline JSCell::JSCell(JSGlobalData& globalData, Structure* structure)
    143142        : m_structure(globalData, this, structure)
     
    230229    {
    231230        return isCell() ? asCell()->getObject() : 0;
    232     }
    233 
    234     inline CallType getCallData(JSValue value, CallData& callData)
    235     {
    236         CallType result = value.isCell() ? value.asCell()->getCallDataVirtual(callData) : CallTypeNone;
    237         ASSERT(result == CallTypeNone || value.isValidCallee());
    238         return result;
    239231    }
    240232
  • trunk/Source/JavaScriptCore/runtime/JSFunction.cpp

    r96992 r96996  
    165165}
    166166
    167 CallType JSFunction::getCallDataVirtual(CallData& callData)
    168 {
    169     return getCallData(this, callData);
    170 }
    171 
    172167CallType JSFunction::getCallData(JSCell* cell, CallData& callData)
    173168{
  • trunk/Source/JavaScriptCore/runtime/JSFunction.h

    r96992 r96996  
    110110
    111111        virtual ConstructType getConstructData(ConstructData&);
    112         virtual CallType getCallDataVirtual(CallData&);
    113112        static CallType getCallData(JSCell*, CallData&);
    114113
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r96992 r96996  
    4343#include "DateConstructor.h"
    4444#include "DatePrototype.h"
     45#include "Error.h"
    4546#include "ErrorConstructor.h"
    4647#include "ErrorPrototype.h"
     
    198199    m_namedFunctionStructure.set(exec->globalData(), this, Structure::addPropertyTransition(exec->globalData(), m_functionStructure.get(), exec->globalData().propertyNames->name, DontDelete | ReadOnly | DontEnum, 0, m_functionNameOffset));
    199200    m_internalFunctionStructure.set(exec->globalData(), this, InternalFunction::createStructure(exec->globalData(), this, m_functionPrototype.get()));
     201    m_strictModeTypeErrorFunctionStructure.set(exec->globalData(), this, StrictModeTypeErrorFunction::createStructure(exec->globalData(), this, m_functionPrototype.get()));
    200202    JSFunction* callFunction = 0;
    201203    JSFunction* applyFunction = 0;
     
    366368    visitIfNeeded(visitor, &thisObject->m_stringObjectStructure);
    367369    visitIfNeeded(visitor, &thisObject->m_internalFunctionStructure);
     370    visitIfNeeded(visitor, &thisObject->m_strictModeTypeErrorFunctionStructure);
    368371
    369372    if (thisObject->m_registerArray) {
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r96992 r96996  
    120120        WriteBarrier<Structure> m_stringObjectStructure;
    121121        WriteBarrier<Structure> m_internalFunctionStructure;
     122        WriteBarrier<Structure> m_strictModeTypeErrorFunctionStructure;
    122123
    123124        Debugger* m_debugger;
     
    239240        Structure* numberObjectStructure() const { return m_numberObjectStructure.get(); }
    240241        Structure* internalFunctionStructure() const { return m_internalFunctionStructure.get(); }
     242        Structure* strictModeTypeErrorFunctionStructure() const { return m_strictModeTypeErrorFunctionStructure.get(); }
    241243        Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); }
    242244        Structure* regExpStructure() const { return m_regExpStructure.get(); }
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r96673 r96996  
    246246    }
    247247
    248     m_replacerCallType = m_replacer.asObject()->getCallDataVirtual(m_replacerCallData);
     248    m_replacerCallType = m_replacer.asObject()->methodTable()->getCallData(m_replacer.asObject().get(), m_replacerCallData);
    249249}
    250250
     
    337337    JSObject* object = asObject(toJSONFunction);
    338338    CallData callData;
    339     CallType callType = object->getCallDataVirtual(callData);
     339    CallType callType = object->methodTable()->getCallData(object, callData);
    340340    if (callType == CallTypeNone)
    341341        return value;
     
    401401
    402402    CallData callData;
    403     if (object->getCallDataVirtual(callData) != CallTypeNone) {
     403    if (object->methodTable()->getCallData(object, callData) != CallTypeNone) {
    404404        if (holder->inherits(&JSArray::s_info)) {
    405405            builder.append("null");
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r96992 r96996  
    162162               
    163163                CallData callData;
    164                 CallType callType = setterFunc->getCallDataVirtual(callData);
     164                CallType callType = setterFunc->methodTable()->getCallData(setterFunc, callData);
    165165                MarkedArgumentBuffer args;
    166166                args.append(value);
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r96992 r96996  
    410410}
    411411
     412inline CallType getCallData(JSValue value, CallData& callData)
     413{
     414    CallType result = value.isCell() ? value.asCell()->methodTable()->getCallData(value.asCell(), callData) : CallTypeNone;
     415    ASSERT(result == CallTypeNone || value.isValidCallee());
     416    return result;
     417}
     418
    412419inline Structure* createEmptyObjectStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
    413420{
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp

    r96346 r96996  
    7070}
    7171
    72 CallType NativeErrorConstructor::getCallDataVirtual(CallData& callData)
    73 {
    74     return getCallData(this, callData);
    75 }
    76 
    7772CallType NativeErrorConstructor::getCallData(JSCell*, CallData& callData)
    7873{
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h

    r96346 r96996  
    7070        static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
    7171        virtual ConstructType getConstructData(ConstructData&);
    72         virtual CallType getCallDataVirtual(CallData&);
    7372        static CallType getCallData(JSCell*, CallData&);
    7473        static void visitChildren(JSCell*, SlotVisitor&);
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r96164 r96996  
    128128}
    129129
    130 CallType NumberConstructor::getCallDataVirtual(CallData& callData)
    131 {
    132     return getCallData(this, callData);
    133 }
    134 
    135130CallType NumberConstructor::getCallData(JSCell*, CallData& callData)
    136131{
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r96164 r96996  
    5959        NumberConstructor(JSGlobalObject*, Structure*);
    6060        virtual ConstructType getConstructData(ConstructData&);
    61         virtual CallType getCallDataVirtual(CallData&);
    6261        static CallType getCallData(JSCell*, CallData&);
    6362    };
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r96164 r96996  
    127127}
    128128
    129 CallType ObjectConstructor::getCallDataVirtual(CallData& callData)
    130 {
    131     return getCallData(this, callData);
    132 }
    133 
    134129CallType ObjectConstructor::getCallData(JSCell*, CallData& callData)
    135130{
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h

    r96164 r96996  
    5656        ObjectConstructor(JSGlobalObject*, Structure*);
    5757        virtual ConstructType getConstructData(ConstructData&);
    58         virtual CallType getCallDataVirtual(CallData&);
    5958        static CallType getCallData(JSCell*, CallData&);
    6059    };
  • trunk/Source/JavaScriptCore/runtime/Operations.cpp

    r96164 r96996  
    7575            return jsNontrivialString(callFrame, "undefined");
    7676        CallData callData;
    77         if (asObject(v)->getCallDataVirtual(callData) != CallTypeNone)
     77        JSObject* object = asObject(v);
     78        if (object->methodTable()->getCallData(object, callData) != CallTypeNone)
    7879            return jsNontrivialString(callFrame, "function");
    7980    }
     
    9394            return false;
    9495        CallData callData;
    95         if (asObject(v)->getCallDataVirtual(callData) != CallTypeNone)
     96        JSObject* object = asObject(v);
     97        if (object->methodTable()->getCallData(object, callData) != CallTypeNone)
    9698            return false;
    9799    }
     
    103105    if (v.isObject()) {
    104106        CallData callData;
    105         if (asObject(v)->getCallDataVirtual(callData) != CallTypeNone)
     107        JSObject* object = asObject(v);
     108        if (object->methodTable()->getCallData(object, callData) != CallTypeNone)
    106109            return true;
    107110    }
  • trunk/Source/JavaScriptCore/runtime/PropertySlot.cpp

    r96164 r96996  
    3434
    3535    CallData callData;
    36     CallType callType = m_data.getterFunc->getCallDataVirtual(callData);
     36    CallType callType = m_data.getterFunc->methodTable()->getCallData(m_data.getterFunc, callData);
    3737   
    3838    // Only objects can have accessor properties.
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r96992 r96996  
    363363}
    364364
    365 CallType RegExpConstructor::getCallDataVirtual(CallData& callData)
    366 {
    367     return getCallData(this, callData);
    368 }
    369 
    370365CallType RegExpConstructor::getCallData(JSCell*, CallData& callData)
    371366{
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r96992 r96996  
    101101        RegExpConstructor(JSGlobalObject*, Structure*);
    102102        virtual ConstructType getConstructData(ConstructData&);
    103         virtual CallType getCallDataVirtual(CallData&);
    104103        static CallType getCallData(JSCell*, CallData&);
    105104
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r96164 r96996  
    110110}
    111111
    112 CallType StringConstructor::getCallDataVirtual(CallData& callData)
    113 {
    114     return getCallData(this, callData);
    115 }
    116 
    117112CallType StringConstructor::getCallData(JSCell*, CallData& callData)
    118113{
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r96164 r96996  
    5353        void finishCreation(ExecState*, StringPrototype*);
    5454        virtual ConstructType getConstructData(ConstructData&);
    55         virtual CallType getCallDataVirtual(CallData&);
    5655        static CallType getCallData(JSCell*, CallData&);
    5756
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r96883 r96996  
    5050    class SlotVisitor;
    5151
    52     struct ClassInfo;
    53 
    5452    enum EnumerationMode {
    5553        ExcludeDontEnumProperties,
     
    308306        return entry ? entry->offset : notFound;
    309307    }
    310 
     308   
    311309    inline bool JSCell::isObject() const
    312310    {
  • trunk/Source/JavaScriptGlue/ChangeLog

    r96992 r96996  
     12011-10-07  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Remove getCallDataVirtual methods
     4        https://bugs.webkit.org/show_bug.cgi?id=69186
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Removed all getCallDataVirtual methods and replaced their call sites
     9        with an explicit lookup in the MethodTable.
     10
     11        * JSValueWrapper.cpp:
     12        (JSValueWrapper::JSObjectCallFunction):
     13        * UserObjectImp.cpp:
     14        * UserObjectImp.h:
     15
    1162011-10-07  Mark Hahnenberg  <mhahnenberg@apple.com>
    217
  • trunk/Source/JavaScriptGlue/JSValueWrapper.cpp

    r96465 r96996  
    165165
    166166        CallData callData;
    167         CallType callType = objValue->getCallDataVirtual(callData);
     167        CallType callType = objValue->methodTable()->getCallData(objValue, callData);
    168168        if (callType == CallTypeNone)
    169169            return 0;
  • trunk/Source/JavaScriptGlue/UserObjectImp.cpp

    r96992 r96996  
    4747}
    4848
    49 CallType UserObjectImp::getCallDataVirtual(CallData& callData)
    50 {
    51     return getCallData(this, callData);
    52 }
    53 
    5449CallType UserObjectImp::getCallData(JSCell* cell, CallData& callData)
    5550{
  • trunk/Source/JavaScriptGlue/UserObjectImp.h

    r96992 r96996  
    5050    static const ClassInfo s_info;
    5151
    52     virtual CallType getCallDataVirtual(CallData&);
    5352    static CallType getCallData(JSCell*, CallData&);
    5453
  • trunk/Source/WebCore/ChangeLog

    r96992 r96996  
     12011-10-07  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Remove getCallDataVirtual methods
     4        https://bugs.webkit.org/show_bug.cgi?id=69186
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        No new tests.
     9
     10        Removed all getCallDataVirtual methods and replaced their call sites
     11        with an explicit lookup in the MethodTable.
     12
     13        * WebCore.exp.in:
     14        * bindings/js/JSCallbackData.cpp:
     15        (WebCore::JSCallbackData::invokeCallback):
     16        * bindings/js/JSCustomXPathNSResolver.cpp:
     17        (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
     18        * bindings/js/JSErrorHandler.cpp:
     19        (WebCore::JSErrorHandler::handleEvent):
     20        * bindings/js/JSEventListener.cpp:
     21        (WebCore::JSEventListener::handleEvent):
     22        * bindings/js/JSHTMLAllCollectionCustom.cpp:
     23        * bindings/js/JSHTMLAppletElementCustom.cpp:
     24        * bindings/js/JSHTMLEmbedElementCustom.cpp:
     25        * bindings/js/JSHTMLObjectElementCustom.cpp:
     26        * bindings/js/JSInjectedScriptHostCustom.cpp:
     27        (WebCore::JSInjectedScriptHost::evaluate):
     28        * bindings/js/JSPluginElementFunctions.cpp:
     29        (WebCore::runtimeObjectGetCallData):
     30        * bindings/scripts/CodeGeneratorJS.pm:
     31        (GenerateHeader):
     32        * bridge/objc/objc_runtime.h:
     33        * bridge/objc/objc_runtime.mm:
     34        * bridge/qt/qt_runtime.cpp:
     35        (JSC::Bindings::QtRuntimeConnectionMethod::call):
     36        (JSC::Bindings::isJavaScriptFunction):
     37        * bridge/qt/qt_runtime.h:
     38        (JSC::Bindings::QtRuntimeMetaMethod::createStructure):
     39        (JSC::Bindings::QtRuntimeConnectionMethod::createStructure):
     40        * bridge/runtime_method.cpp:
     41        * bridge/runtime_method.h:
     42        * bridge/runtime_object.cpp:
     43        * bridge/runtime_object.h:
     44
    1452011-10-07  Mark Hahnenberg  <mhahnenberg@apple.com>
    246
  • trunk/Source/WebCore/WebCore.exp.in

    r96859 r96996  
    16821682__ZN3JSC13RuntimeMethod11getCallDataEPNS_6JSCellERNS_8CallDataE
    16831683__ZN3JSC13RuntimeMethod14finishCreationERNS_12JSGlobalDataERKNS_10IdentifierE
    1684 __ZN3JSC13RuntimeMethod18getCallDataVirtualERNS_8CallDataE
    16851684__ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    16861685__ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
     
    16921691__ZN3JSC8Bindings13RuntimeObject14finishCreationEPNS_14JSGlobalObjectE
    16931692__ZN3JSC8Bindings13RuntimeObject16getConstructDataERNS_13ConstructDataE
    1694 __ZN3JSC8Bindings13RuntimeObject18getCallDataVirtualERNS_8CallDataE
    16951693__ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    16961694__ZN3JSC8Bindings13RuntimeObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
  • trunk/Source/WebCore/bindings/js/JSCallbackData.cpp

    r96164 r96996  
    5454    CallType callType = getCallData(function, callData);
    5555    if (callType == CallTypeNone) {
    56         callType = callback()->getCallDataVirtual(callData);
     56        callType = callback()->methodTable()->getCallData(callback(), callData);
    5757        if (callType == CallTypeNone)
    5858            return JSValue();
  • trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp

    r96164 r96996  
    7878    CallType callType = getCallData(function, callData);
    7979    if (callType == CallTypeNone) {
    80         callType = m_customResolver->getCallDataVirtual(callData);
     80        callType = m_customResolver->methodTable()->getCallData(m_customResolver, callData);
    8181        if (callType == CallTypeNone) {
    8282            // FIXME: Pass actual line number and source URL.
  • trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp

    r96673 r96996  
    7575
    7676    CallData callData;
    77     CallType callType = jsFunction->getCallDataVirtual(callData);
     77    CallType callType = jsFunction->methodTable()->getCallData(jsFunction, callData);
    7878
    7979    if (callType != CallTypeNone) {
  • trunk/Source/WebCore/bindings/js/JSEventListener.cpp

    r96673 r96996  
    102102    if (callType == CallTypeNone) {
    103103        handleEventFunction = JSValue();
    104         callType = jsFunction->getCallDataVirtual(callData);
     104        callType = jsFunction->methodTable()->getCallData(jsFunction, callData);
    105105    }
    106106
  • trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp

    r96164 r96996  
    100100}
    101101
    102 CallType JSHTMLAllCollection::getCallDataVirtual(CallData& callData)
    103 {
    104     return getCallData(this, callData);
    105 }
    106 
    107102CallType JSHTMLAllCollection::getCallData(JSCell*, CallData& callData)
    108103{
  • trunk/Source/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp

    r96164 r96996  
    4949}
    5050
    51 CallType JSHTMLAppletElement::getCallDataVirtual(CallData& callData)
    52 {
    53     return getCallData(this, callData);
    54 }
    55 
    5651CallType JSHTMLAppletElement::getCallData(JSCell* cell, CallData& callData)
    5752{
  • trunk/Source/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp

    r96164 r96996  
    4949}
    5050
    51 CallType JSHTMLEmbedElement::getCallDataVirtual(CallData& callData)
    52 {
    53     return getCallData(this, callData);
    54 }
    55 
    5651CallType JSHTMLEmbedElement::getCallData(JSCell* cell, CallData& callData)
    5752{
  • trunk/Source/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp

    r96164 r96996  
    4949}
    5050
    51 CallType JSHTMLObjectElement::getCallDataVirtual(CallData& callData)
    52 {
    53     return getCallData(this, callData);
    54 }
    55 
    5651CallType JSHTMLObjectElement::getCallData(JSCell* cell, CallData& callData)
    5752{
  • trunk/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp

    r96164 r96996  
    8686    JSFunction* evalFunction = globalObject->evalFunction();
    8787    CallData callData;
    88     CallType callType = evalFunction->getCallDataVirtual(callData);
     88    CallType callType = evalFunction->methodTable()->getCallData(evalFunction, callData);
    8989    if (callType == CallTypeNone)
    9090        return jsUndefined();
  • trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp

    r96164 r96996  
    178178        CallData scriptObjectCallData;
    179179       
    180         if (scriptObject->getCallDataVirtual(scriptObjectCallData) == CallTypeNone)
     180        if (scriptObject->methodTable()->getCallData(scriptObject, scriptObjectCallData) == CallTypeNone)
    181181            return CallTypeNone;
    182182
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r96992 r96996  
    818818
    819819    # Custom call functions
    820     push(@headerContent, "    virtual JSC::CallType getCallDataVirtual(JSC::CallData&);\n\n") if $dataNode->extendedAttributes->{"CustomCall"};
    821820    push(@headerContent, "    static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);\n\n") if $dataNode->extendedAttributes->{"CustomCall"};
    822821
  • trunk/Source/WebCore/bridge/objc/objc_runtime.h

    r96992 r96996  
    128128    virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
    129129    static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
    130     virtual CallType getCallDataVirtual(CallData&);
    131130    static CallType getCallData(JSCell*, CallData&);
    132131    virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
  • trunk/Source/WebCore/bridge/objc/objc_runtime.mm

    r96992 r96996  
    260260}
    261261
    262 CallType ObjcFallbackObjectImp::getCallDataVirtual(CallData& callData)
    263 {
    264     return getCallData(this, callData);
    265 }
    266 
    267262CallType ObjcFallbackObjectImp::getCallData(JSCell* cell, CallData& callData)
    268263{
  • trunk/Source/WebCore/bridge/qt/qt_runtime.cpp

    r96674 r96996  
    14891489}
    14901490
    1491 CallType QtRuntimeMetaMethod::getCallDataVirtual(CallData& callData)
    1492 {
    1493     return getCallData(this, callData);
    1494 }
    1495 
    14961491CallType QtRuntimeMetaMethod::getCallData(JSCell*, CallData& callData)
    14971492{
     
    16251620                funcObject = exec->argument(0).toObject(exec);
    16261621                CallData callData;
    1627                 if (funcObject->getCallDataVirtual(callData) == CallTypeNone) {
     1622                if (funcObject->methodTable()->getCallData(funcObject, callData) == CallTypeNone) {
    16281623                    if (d->m_isConnect)
    16291624                        return throwVMError(exec, createTypeError(exec, "QtMetaMethod.connect: target is not a function"));
     
    16381633                    JSObject *asObj = exec->argument(1).toObject(exec);
    16391634                    CallData callData;
    1640                     if (asObj->getCallDataVirtual(callData) != CallTypeNone) {
     1635                    if (asObj->methodTable()->getCallData(asObj, callData) != CallTypeNone) {
    16411636                        // Function version
    16421637                        funcObject = asObj;
     
    16511646                        JSObject* asFuncObj = val.toObject(exec);
    16521647
    1653                         if (asFuncObj->getCallDataVirtual(callData) != CallTypeNone) {
     1648                        if (asFuncObj->methodTable()->getCallData(asFuncObj, callData) != CallTypeNone) {
    16541649                            funcObject = asFuncObj;
    16551650                        } else {
     
    17351730}
    17361731
    1737 CallType QtRuntimeConnectionMethod::getCallDataVirtual(CallData& callData)
    1738 {
    1739     return getCallData(this, callData);
    1740 }
    1741 
    17421732CallType QtRuntimeConnectionMethod::getCallData(JSCell*, CallData& callData)
    17431733{
     
    18631853{
    18641854    CallData callData;
    1865     return toJS(object)->getCallDataVirtual(callData) == CallTypeJS;
     1855    JSObject* jsObject = toJS(object);
     1856    return jsObject->methodTable()->getCallData(jsObject, callData) == CallTypeJS;
    18661857}
    18671858
  • trunk/Source/WebCore/bridge/qt/qt_runtime.h

    r96674 r96996  
    170170
    171171    static void visitChildren(JSCell*, SlotVisitor&);
    172 
     172   
    173173    static const ClassInfo s_info;
     174
     175    static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
     176    {
     177        return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType,  StructureFlags), &s_info);
     178    }
    174179
    175180protected:
     
    180185    void finishCreation(ExecState*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray& signature, bool allowPrivate);
    181186
    182     virtual CallType getCallDataVirtual(CallData&);
    183187    static CallType getCallData(JSCell*, CallData&);
    184188    static EncodedJSValue JSC_HOST_CALL call(ExecState* exec);
     
    207211    static const ClassInfo s_info;
    208212
     213    static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
     214    {
     215        return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType,  StructureFlags), &s_info);
     216    }
     217
    209218protected:
    210219    QtRuntimeConnectionMethodData* d_func() const {return reinterpret_cast<QtRuntimeConnectionMethodData*>(d_ptr);}
     
    214223    void finishCreation(ExecState*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray& signature);
    215224
    216     virtual CallType getCallDataVirtual(CallData&);
    217225    static CallType getCallData(JSCell*, CallData&);
    218226    static EncodedJSValue JSC_HOST_CALL call(ExecState* exec);
  • trunk/Source/WebCore/bridge/runtime_method.cpp

    r96164 r96996  
    124124}
    125125
    126 CallType RuntimeMethod::getCallDataVirtual(CallData& callData)
    127 {
    128     return getCallData(this, callData);
    129 }
    130 
    131126CallType RuntimeMethod::getCallData(JSCell*, CallData& callData)
    132127{
  • trunk/Source/WebCore/bridge/runtime_method.h

    r96406 r96996  
    6363    void finishCreation(JSGlobalData&, const Identifier&);
    6464    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
    65     virtual CallType getCallDataVirtual(CallData&);
    6665    static CallType getCallData(JSCell*, CallData&);
    6766
  • trunk/Source/WebCore/bridge/runtime_object.cpp

    r96992 r96996  
    266266}
    267267
    268 CallType RuntimeObject::getCallDataVirtual(CallData& callData)
    269 {
    270     return getCallData(this, callData);
    271 }
    272 
    273268CallType RuntimeObject::getCallData(JSCell* cell, CallData& callData)
    274269{
  • trunk/Source/WebCore/bridge/runtime_object.h

    r96992 r96996  
    5252    virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
    5353    virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
    54     virtual CallType getCallDataVirtual(CallData&);
    5554    static CallType getCallData(JSCell*, CallData&);
    5655    virtual ConstructType getConstructData(ConstructData&);
  • trunk/Source/WebKit/mac/ChangeLog

    r96881 r96996  
     12011-10-07  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Remove getCallDataVirtual methods
     4        https://bugs.webkit.org/show_bug.cgi?id=69186
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Removed all getCallDataVirtual methods and replaced their call sites
     9        with an explicit lookup in the MethodTable.
     10
     11        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
     12        (WebKit::NetscapePluginInstanceProxy::invokeDefault):
     13
    1142011-10-06  Anders Carlsson  <andersca@apple.com>
    215
  • trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm

    r96880 r96996  
    943943    JSLock lock(SilenceAssertionsOnly);   
    944944    CallData callData;
    945     CallType callType = object->getCallDataVirtual(callData);
     945    CallType callType = object->methodTable()->getCallData(object, callData);
    946946    if (callType == CallTypeNone)
    947947        return false;
  • trunk/Source/WebKit2/ChangeLog

    r96979 r96996  
     12011-10-07  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Remove getCallDataVirtual methods
     4        https://bugs.webkit.org/show_bug.cgi?id=69186
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Removed all getCallDataVirtual methods and replaced their call sites
     9        with an explicit lookup in the MethodTable.
     10
     11        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
     12        * WebProcess/Plugins/Netscape/JSNPMethod.h:
     13        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
     14        * WebProcess/Plugins/Netscape/JSNPObject.h:
     15
    1162011-10-07  Alexey Proskuryakov  <ap@apple.com>
    217
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp

    r96164 r96996  
    7878}
    7979
    80 CallType JSNPMethod::getCallDataVirtual(CallData& callData)
    81 {
    82     return getCallData(this, callData);
    83 }
    84 
    8580CallType JSNPMethod::getCallData(JSCell*, CallData& callData)
    8681{
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h

    r96164 r96996  
    6363    }
    6464
    65     virtual JSC::CallType getCallDataVirtual(JSC::CallData&);
    6665    static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);
    6766   
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp

    r96164 r96996  
    218218}
    219219
    220 CallType JSNPObject::getCallDataVirtual(CallData& callData)
    221 {
    222     return getCallData(this, callData);
    223 }
    224 
    225220JSC::CallType JSNPObject::getCallData(JSC::JSCell* cell, JSC::CallData& callData)
    226221{
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h

    r96164 r96996  
    8080    }
    8181
    82     virtual JSC::CallType getCallDataVirtual(JSC::CallData&);
    8382    static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);
    8483    virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
Note: See TracChangeset for help on using the changeset viewer.