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/JSActivation.cpp

    r98593 r99126  
    111111}
    112112
    113 void JSActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
    114 {
    115     SymbolTable::const_iterator end = symbolTable().end();
    116     for (SymbolTable::const_iterator it = symbolTable().begin(); it != end; ++it) {
     113void JSActivation::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
     114{
     115    JSActivation* thisObject = static_cast<JSActivation*>(object);
     116    SymbolTable::const_iterator end = thisObject->symbolTable().end();
     117    for (SymbolTable::const_iterator it = thisObject->symbolTable().begin(); it != end; ++it) {
    117118        if (it->second.getAttributes() & DontEnum && mode != IncludeDontEnumProperties)
    118119            continue;
    119         if (it->second.getIndex() >= m_numCapturedVars)
     120        if (it->second.getIndex() >= thisObject->m_numCapturedVars)
    120121            continue;
    121122        propertyNames.add(Identifier(exec, it->first.get()));
    122123    }
    123124    // Skip the JSVariableObject implementation of getOwnPropertyNames
    124     JSObject::getOwnPropertyNames(exec, propertyNames, mode);
     125    JSObject::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
    125126}
    126127
Note: See TracChangeset for help on using the changeset viewer.