Ignore:
Timestamp:
Oct 7, 2011, 11:37:45 PM (14 years ago)
Author:
[email protected]
Message:

Add static version of JSCell::deleteProperty
https://bugs.webkit.org/show_bug.cgi?id=69659

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Added static version of both versions of put to all classes that
override them and changed the virtual versions to call the static
versions. This is the first step in de-virtualizing JSCell::deleteProperty.

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

(JSC::::deleteProperty):

  • debugger/DebuggerActivation.cpp:

(JSC::DebuggerActivation::deleteProperty):

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

(JSC::Arguments::deleteProperty):

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

(JSC::JSActivation::deleteProperty):

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

(JSC::JSArray::deleteProperty):

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

(JSC::JSCell::deleteProperty):

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

(JSC::JSFunction::deleteProperty):

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

(JSC::JSNotAnObject::deleteProperty):

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

(JSC::JSObject::deleteProperty):

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

(JSC::JSVariableObject::deleteProperty):

  • runtime/JSVariableObject.h:
  • runtime/RegExpMatchesArray.h:

(JSC::RegExpMatchesArray::deleteProperty):

  • runtime/StrictEvalActivation.cpp:

(JSC::StrictEvalActivation::deleteProperty):

  • runtime/StrictEvalActivation.h:
  • runtime/StringObject.cpp:

(JSC::StringObject::deleteProperty):

  • runtime/StringObject.h:

Source/WebCore:

No new tests.

Added static version of both versions of put to all classes that
override them and changed the virtual versions to call the static
versions. This is the first step in de-virtualizing JSCell::deleteProperty.

  • bridge/objc/objc_runtime.h:
  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::ObjcFallbackObjectImp::deleteProperty):

  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::deleteProperty):

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

(JSC::Bindings::RuntimeObject::deleteProperty):

  • bridge/runtime_object.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r96996 r97002  
    269269bool JSCallbackObject<Parent>::deleteProperty(ExecState* exec, const Identifier& propertyName)
    270270{
     271    return deleteProperty(this, exec, propertyName);
     272}
     273
     274template <class Parent>
     275bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
     276{
     277    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
    271278    JSContextRef ctx = toRef(exec);
    272     JSObjectRef thisRef = toRef(this);
     279    JSObjectRef thisRef = toRef(thisObject);
    273280    RefPtr<OpaqueJSString> propertyNameRef;
    274281   
    275     for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
     282    for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) {
    276283        if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) {
    277284            if (!propertyNameRef)
     
    306313    }
    307314   
    308     return Parent::deleteProperty(exec, propertyName);
     315    return Parent::deleteProperty(thisObject, exec, propertyName);
    309316}
    310317
     
    312319bool JSCallbackObject<Parent>::deleteProperty(ExecState* exec, unsigned propertyName)
    313320{
    314     return deleteProperty(exec, Identifier::from(exec, propertyName));
     321    return deleteProperty(this, exec, propertyName);
     322}
     323
     324template <class Parent>
     325bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, unsigned propertyName)
     326{
     327    return static_cast<JSCallbackObject*>(cell)->deleteProperty(exec, Identifier::from(exec, propertyName));
    315328}
    316329
Note: See TracChangeset for help on using the changeset viewer.