Changeset 96992 in webkit for trunk/Source/JavaScriptCore/API


Ignore:
Timestamp:
Oct 7, 2011, 5:06:07 PM (14 years ago)
Author:
[email protected]
Message:

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

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.

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

(JSC::::put):

(JSC::DebuggerActivation::put):

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

(JSC::Arguments::put):

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

(JSC::JSActivation::put):

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

(JSC::JSArray::put):

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

(JSC::JSByteArray::put):

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

(JSC::JSCell::put):

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

(JSC::JSFunction::put):

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

(JSC::JSGlobalObject::put):

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

(JSC::JSNotAnObject::put):

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

(JSC::JSObject::put):

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

(JSC::JSStaticScopeObject::put):

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

(JSC::ObjectPrototype::put):

  • runtime/ObjectPrototype.h:
  • runtime/RegExpConstructor.cpp:

(JSC::RegExpConstructor::put):

  • runtime/RegExpConstructor.h:
  • runtime/RegExpMatchesArray.h:

(JSC::RegExpMatchesArray::put):

  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::put):

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

(JSC::StringObject::put):

  • runtime/StringObject.h:

Source/JavaScriptGlue:

Added static version of both versions of put to all classes that
override them and changed the virtual versions to call the static
versions.

  • UserObjectImp.cpp:

(UserObjectImp::put):

  • UserObjectImp.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.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):
(GenerateImplementation):

  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::JSTestObj::put):

  • bindings/scripts/test/JS/JSTestObj.h:
  • bridge/objc/objc_runtime.h:
  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::ObjcFallbackObjectImp::put):

  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::put):

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

(JSC::Bindings::RuntimeObject::put):

  • bridge/runtime_object.h:
Location:
trunk/Source/JavaScriptCore/API
Files:
2 edited

Legend:

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

    r96346 r96992  
    183183   
    184184    virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&);
     185    static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
    185186
    186187    virtual bool deleteProperty(ExecState*, const Identifier&);
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r96836 r96992  
    204204void JSCallbackObject<Parent>::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
    205205{
     206    put(this, exec, propertyName, value, slot);
     207}
     208
     209template <class Parent>
     210void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
     211{
     212    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
    206213    JSContextRef ctx = toRef(exec);
    207     JSObjectRef thisRef = toRef(this);
     214    JSObjectRef thisRef = toRef(thisObject);
    208215    RefPtr<OpaqueJSString> propertyNameRef;
    209216    JSValueRef valueRef = toRef(exec, value);
    210217   
    211     for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
     218    for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) {
    212219        if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) {
    213220            if (!propertyNameRef)
     
    250257                if (entry->attributes & kJSPropertyAttributeReadOnly)
    251258                    return;
    252                 JSCallbackObject<Parent>::putDirect(exec->globalData(), propertyName, value); // put as override property
     259                thisObject->JSCallbackObject<Parent>::putDirect(exec->globalData(), propertyName, value); // put as override property
    253260                return;
    254261            }
     
    256263    }
    257264   
    258     return Parent::put(exec, propertyName, value, slot);
     265    return Parent::put(thisObject, exec, propertyName, value, slot);
    259266}
    260267
Note: See TracChangeset for help on using the changeset viewer.