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/runtime/JSObject.cpp

    r96996 r97002  
    243243}
    244244
     245bool JSObject::deleteProperty(ExecState* exec, const Identifier& propertyName)
     246{
     247    return deleteProperty(this, exec, propertyName);
     248}
     249
    245250// ECMA 8.6.2.5
    246 bool JSObject::deleteProperty(ExecState* exec, const Identifier& propertyName)
    247 {
     251bool JSObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
     252{
     253    JSObject* thisObject = static_cast<JSObject*>(cell);
    248254    unsigned attributes;
    249255    JSCell* specificValue;
    250     if (structure()->get(exec->globalData(), propertyName, attributes, specificValue) != WTF::notFound) {
     256    if (thisObject->structure()->get(exec->globalData(), propertyName, attributes, specificValue) != WTF::notFound) {
    251257        if ((attributes & DontDelete))
    252258            return false;
    253         removeDirect(exec->globalData(), propertyName);
     259        thisObject->removeDirect(exec->globalData(), propertyName);
    254260        return true;
    255261    }
    256262
    257263    // Look in the static hashtable of properties
    258     const HashEntry* entry = findPropertyHashEntry(exec, propertyName);
     264    const HashEntry* entry = thisObject->findPropertyHashEntry(exec, propertyName);
    259265    if (entry && entry->attributes() & DontDelete)
    260266        return false; // this builtin property can't be deleted
     
    272278bool JSObject::deleteProperty(ExecState* exec, unsigned propertyName)
    273279{
    274     return deleteProperty(exec, Identifier::from(exec, propertyName));
     280    return deleteProperty(this, exec, propertyName);
     281}
     282
     283bool JSObject::deleteProperty(JSCell* cell, ExecState* exec, unsigned propertyName)
     284{
     285    return static_cast<JSObject*>(cell)->deleteProperty(exec, Identifier::from(exec, propertyName));
    275286}
    276287
Note: See TracChangeset for help on using the changeset viewer.