Ignore:
Timestamp:
Oct 7, 2011, 6:44:10 PM (14 years ago)
Author:
[email protected]
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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r96995 r96996  
     12011-10-07  Mark Hahnenberg  <[email protected]>
     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  <[email protected]>
    2104
Note: See TracChangeset for help on using the changeset viewer.