Ignore:
Timestamp:
Nov 3, 2011, 6:32:18 PM (14 years ago)
Author:
[email protected]
Message:

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

Reviewed by Darin Adler.

Source/JavaScriptCore:

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

  • API/JSObjectRef.cpp:

(JSObjectCopyPropertyNames):

(JSC::DebuggerActivation::getOwnPropertyNames):

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

(JSC::JSCell::getPropertyNames):

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

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

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

(JSC::JSPropertyNameIterator::create):

  • runtime/ScopeChain.cpp:

(JSC::ScopeChainNode::print):

  • runtime/Structure.cpp:

(JSC::Structure::getPropertyNamesFromStructure):

  • runtime/Structure.h:

Source/JavaScriptGlue:

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

  • JSUtils.cpp:

(KJSValueToCFTypeInternal):

  • JSValueWrapper.cpp:

(JSValueWrapper::JSObjectCopyPropertyNames):

Source/WebCore:

No new tests.

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

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getPropertyNames):

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::getPropertyNames):

  • bindings/js/JSDOMWindowShell.h:
  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):

  • bridge/NP_jsobject.cpp:

(_NPN_Enumerate):

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::convertValueToQVariantMap):

Source/WebKit/mac:

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

  • Plugins/Hosted/NetscapePluginInstanceProxy.mm:

(WebKit::NetscapePluginInstanceProxy::enumerate):

Source/WebKit2:

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

  • WebProcess/Plugins/Netscape/NPJSObject.cpp:

(WebKit::NPJSObject::enumerate):

File:
1 edited

Legend:

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

    r99238 r99256  
    496496}
    497497
    498 void JSObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
    499 {
    500     methodTable()->getOwnPropertyNames(this, exec, propertyNames, mode);
    501 
    502     if (prototype().isNull())
    503         return;
    504 
    505     JSObject* prototype = asObject(this->prototype());
     498void JSObject::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
     499{
     500    object->methodTable()->getOwnPropertyNames(object, exec, propertyNames, mode);
     501
     502    if (object->prototype().isNull())
     503        return;
     504
     505    JSObject* prototype = asObject(object->prototype());
    506506    while(1) {
    507507        if (prototype->structure()->typeInfo().overridesGetPropertyNames()) {
    508             prototype->getPropertyNames(exec, propertyNames, mode);
     508            prototype->methodTable()->getPropertyNames(prototype, exec, propertyNames, mode);
    509509            break;
    510510        }
     
    519519void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
    520520{
    521     object->structure()->getPropertyNames(exec->globalData(), propertyNames, mode);
     521    object->structure()->getPropertyNamesFromStructure(exec->globalData(), propertyNames, mode);
    522522    if (!object->staticFunctionsReified())
    523523        getClassPropertyNames(exec, object->classInfo(), propertyNames, mode);
Note: See TracChangeset for help on using the changeset viewer.