Ignore:
Timestamp:
Nov 9, 2011, 1:09:37 PM (14 years ago)
Author:
[email protected]
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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.