De-virtualize JSObject::getOwnPropertyDescriptor
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Nov 2011 21:09:37 +0000 (21:09 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Nov 2011 21:09:37 +0000 (21:09 +0000)
commit7f2f7e53c9c54d12d32b150fc42c5b7a02bd8e9e
tree4b17ab8dc9ee7b7def747a8ca8f7bbb38cecac18
parent2172b954372113e7025baddf8750b4be2ce6ced9
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):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
(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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@99754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
92 files changed:
Source/JavaScriptCore/API/JSCallbackObject.h
Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/debugger/DebuggerActivation.cpp
Source/JavaScriptCore/debugger/DebuggerActivation.h
Source/JavaScriptCore/runtime/Arguments.cpp
Source/JavaScriptCore/runtime/Arguments.h
Source/JavaScriptCore/runtime/ArrayConstructor.cpp
Source/JavaScriptCore/runtime/ArrayConstructor.h
Source/JavaScriptCore/runtime/ArrayPrototype.cpp
Source/JavaScriptCore/runtime/ArrayPrototype.h
Source/JavaScriptCore/runtime/BooleanPrototype.cpp
Source/JavaScriptCore/runtime/BooleanPrototype.h
Source/JavaScriptCore/runtime/ClassInfo.h
Source/JavaScriptCore/runtime/DateConstructor.cpp
Source/JavaScriptCore/runtime/DateConstructor.h
Source/JavaScriptCore/runtime/DatePrototype.cpp
Source/JavaScriptCore/runtime/DatePrototype.h
Source/JavaScriptCore/runtime/ErrorPrototype.cpp
Source/JavaScriptCore/runtime/ErrorPrototype.h
Source/JavaScriptCore/runtime/JSArray.cpp
Source/JavaScriptCore/runtime/JSArray.h
Source/JavaScriptCore/runtime/JSByteArray.cpp
Source/JavaScriptCore/runtime/JSByteArray.h
Source/JavaScriptCore/runtime/JSCell.cpp
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSFunction.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSNotAnObject.cpp
Source/JavaScriptCore/runtime/JSNotAnObject.h
Source/JavaScriptCore/runtime/JSONObject.cpp
Source/JavaScriptCore/runtime/JSONObject.h
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSString.cpp
Source/JavaScriptCore/runtime/JSString.h
Source/JavaScriptCore/runtime/Lookup.h
Source/JavaScriptCore/runtime/MathObject.cpp
Source/JavaScriptCore/runtime/MathObject.h
Source/JavaScriptCore/runtime/NumberConstructor.cpp
Source/JavaScriptCore/runtime/NumberConstructor.h
Source/JavaScriptCore/runtime/NumberPrototype.cpp
Source/JavaScriptCore/runtime/NumberPrototype.h
Source/JavaScriptCore/runtime/ObjectConstructor.cpp
Source/JavaScriptCore/runtime/ObjectConstructor.h
Source/JavaScriptCore/runtime/ObjectPrototype.cpp
Source/JavaScriptCore/runtime/ObjectPrototype.h
Source/JavaScriptCore/runtime/RegExpConstructor.cpp
Source/JavaScriptCore/runtime/RegExpConstructor.h
Source/JavaScriptCore/runtime/RegExpMatchesArray.h
Source/JavaScriptCore/runtime/RegExpObject.cpp
Source/JavaScriptCore/runtime/RegExpObject.h
Source/JavaScriptCore/runtime/RegExpPrototype.cpp
Source/JavaScriptCore/runtime/RegExpPrototype.h
Source/JavaScriptCore/runtime/StringConstructor.cpp
Source/JavaScriptCore/runtime/StringConstructor.h
Source/JavaScriptCore/runtime/StringObject.cpp
Source/JavaScriptCore/runtime/StringObject.h
Source/JavaScriptCore/runtime/StringPrototype.cpp
Source/JavaScriptCore/runtime/StringPrototype.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.h
Source/WebCore/bindings/js/JSWorkerContextCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
Source/WebCore/bridge/objc/objc_runtime.h
Source/WebCore/bridge/objc/objc_runtime.mm
Source/WebCore/bridge/qt/qt_runtime.cpp
Source/WebCore/bridge/qt/qt_runtime.h
Source/WebCore/bridge/runtime_array.cpp
Source/WebCore/bridge/runtime_array.h
Source/WebCore/bridge/runtime_method.cpp
Source/WebCore/bridge/runtime_method.h
Source/WebCore/bridge/runtime_object.cpp
Source/WebCore/bridge/runtime_object.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h