Ignore:
Timestamp:
Nov 7, 2011, 3:57:37 PM (14 years ago)
Author:
[email protected]
Message:

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

Reviewed by Darin Adler.

Source/JavaScriptCore:

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

  • API/JSObjectRef.cpp:

(JSObjectSetProperty):

(JSC::DebuggerActivation::putWithAttributes):

  • debugger/DebuggerActivation.h:
  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):

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

(JSC::JSActivation::putWithAttributes):

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

(JSC::JSCell::putWithAttributes):

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

(JSC::JSGlobalObject::putWithAttributes):

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

(JSC::JSObject::putWithAttributes):
(JSC::putDescriptor):

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

(JSC::JSStaticScopeObject::putWithAttributes):

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

(JSC::JSVariableObject::putWithAttributes):

  • runtime/JSVariableObject.h:

Source/WebCore:

No new tests.

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

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::putWithAttributes):

  • bindings/js/JSDOMWindowShell.h:
File:
1 edited

Legend:

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

    r99357 r99497  
    182182
    183183// FIXME: Make this function honor ReadOnly (const) and DontEnum
    184 void JSActivation::putWithAttributes(ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
    185 {
    186     ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
    187 
    188     if (symbolTablePutWithAttributes(exec->globalData(), propertyName, value, attributes))
     184void JSActivation::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
     185{
     186    JSActivation* thisObject = static_cast<JSActivation*>(object);
     187    ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject));
     188
     189    if (thisObject->symbolTablePutWithAttributes(exec->globalData(), propertyName, value, attributes))
    189190        return;
    190191
     
    192193    // properties are non-standard extensions that other implementations do not
    193194    // expose in the activation object.
    194     ASSERT(!hasGetterSetterProperties());
    195     JSObject::putWithAttributes(exec, propertyName, value, attributes);
     195    ASSERT(!thisObject->hasGetterSetterProperties());
     196    JSObject::putWithAttributes(thisObject, exec, propertyName, value, attributes);
    196197}
    197198
Note: See TracChangeset for help on using the changeset viewer.