Ignore:
Timestamp:
Nov 2, 2011, 5:25:45 PM (14 years ago)
Author:
[email protected]
Message:

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

Reviewed by Darin Adler.

Source/JavaScriptCore:

Added getOwnPropertyNames to the MethodTable, changed all the virtual
implementations of getOwnPropertyNames to static ones, and replaced
all call sites with corresponding lookups in the MethodTable.

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

(JSC::::getOwnPropertyNames):

(JSC::DebuggerActivation::getOwnPropertyNames):

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

(JSC::Arguments::getOwnPropertyNames):

  • runtime/Arguments.h:
  • runtime/ClassInfo.h:
  • runtime/JSActivation.cpp:

(JSC::JSActivation::getOwnPropertyNames):

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

(JSC::JSArray::getOwnPropertyNames):

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

(JSC::JSByteArray::getOwnPropertyNames):

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

(JSC::JSCell::getOwnPropertyNames):

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

(JSC::JSFunction::getOwnPropertyNames):

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

(JSC::JSNotAnObject::getOwnPropertyNames):

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

(JSC::Stringifier::Holder::appendNextProperty):
(JSC::Walker::walk):

  • runtime/JSObject.cpp:

(JSC::JSObject::getPropertyNames):
(JSC::JSObject::getOwnPropertyNames):

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

(JSC::JSVariableObject::~JSVariableObject):
(JSC::JSVariableObject::getOwnPropertyNames):

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

(JSC::objectConstructorGetOwnPropertyNames):
(JSC::objectConstructorKeys):
(JSC::defineProperties):

  • runtime/RegExpMatchesArray.h:

(JSC::RegExpMatchesArray::getOwnPropertyNames):

  • runtime/StringObject.cpp:

(JSC::StringObject::getOwnPropertyNames):

  • runtime/StringObject.h:
  • runtime/Structure.h:

Source/JavaScriptGlue:

Added getOwnPropertyNames to the MethodTable, changed all the virtual
implementations of getOwnPropertyNames to static ones, and replaced
all call sites with corresponding lookups in the MethodTable.

  • UserObjectImp.cpp:

(UserObjectImp::getOwnPropertyNames):

  • UserObjectImp.h:

Source/WebCore:

No new tests.

Added getOwnPropertyNames to the MethodTable, changed all the virtual
implementations of getOwnPropertyNames to static ones, and replaced
all call sites with corresponding lookups in the MethodTable.

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

(WebCore::JSDOMStringMap::getOwnPropertyNames):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getOwnPropertyNames):

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::getOwnPropertyNames):

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

(WebCore::JSHistory::getOwnPropertyNames):

  • bindings/js/JSLocationCustom.cpp:

(WebCore::JSLocation::getOwnPropertyNames):

  • bindings/js/JSStorageCustom.cpp:

(WebCore::JSStorage::getOwnPropertyNames):

  • bindings/js/ScriptValue.cpp:

(WebCore::jsToInspectorValue):

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneSerializer::serialize):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):
(GenerateImplementation):

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertyNames):
(JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertyNames):

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

(JSC::RuntimeArray::getOwnPropertyNames):

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

(JSC::Bindings::RuntimeObject::getOwnPropertyNames):

  • bridge/runtime_object.h:

Source/WebKit2:

Added getOwnPropertyNames to the MethodTable, changed all the virtual
implementations of getOwnPropertyNames to static ones, and replaced
all call sites with corresponding lookups in the MethodTable.

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::JSNPObject::getOwnPropertyNames):

  • WebProcess/Plugins/Netscape/JSNPObject.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r99034 r99126  
    498498void JSObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
    499499{
    500     getOwnPropertyNames(exec, propertyNames, mode);
     500    methodTable()->getOwnPropertyNames(this, exec, propertyNames, mode);
    501501
    502502    if (prototype().isNull())
     
    509509            break;
    510510        }
    511         prototype->getOwnPropertyNames(exec, propertyNames, mode);
     511        prototype->methodTable()->getOwnPropertyNames(prototype, exec, propertyNames, mode);
    512512        JSValue nextProto = prototype->prototype();
    513513        if (nextProto.isNull())
     
    517517}
    518518
    519 void JSObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
    520 {
    521     structure()->getPropertyNames(exec->globalData(), propertyNames, mode);
    522     if (!staticFunctionsReified())
    523         getClassPropertyNames(exec, classInfo(), propertyNames, mode);
     519void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
     520{
     521    object->structure()->getPropertyNames(exec->globalData(), propertyNames, mode);
     522    if (!object->staticFunctionsReified())
     523        getClassPropertyNames(exec, object->classInfo(), propertyNames, mode);
    524524}
    525525
Note: See TracChangeset for help on using the changeset viewer.