Ignore:
Timestamp:
Oct 8, 2011, 2:31:32 PM (14 years ago)
Author:
[email protected]
Message:

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

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Added static version of getOwnPropertySlot to every class that overrides
JSCell::getOwnPropertySlot. The virtual versions now call the static versions.
This is the first step in de-virtualizing JSCell::getOwnPropertySlot.

(JSC::DebuggerActivation::getOwnPropertySlot):

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

(JSC::Arguments::getOwnPropertySlot):

  • runtime/Arguments.h:
  • runtime/ArrayConstructor.h:
  • runtime/ArrayPrototype.cpp:

(JSC::ArrayPrototype::getOwnPropertySlot):

  • runtime/ArrayPrototype.h:
  • runtime/BooleanPrototype.cpp:

(JSC::BooleanPrototype::getOwnPropertySlot):

  • runtime/BooleanPrototype.h:
  • runtime/DateConstructor.cpp:

(JSC::DateConstructor::getOwnPropertySlot):

  • runtime/DateConstructor.h:
  • runtime/DatePrototype.cpp:

(JSC::DatePrototype::getOwnPropertySlot):

  • runtime/DatePrototype.h:
  • runtime/ErrorPrototype.cpp:

(JSC::ErrorPrototype::getOwnPropertySlot):

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

(JSC::JSActivation::getOwnPropertySlot):

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

(JSC::JSArray::getOwnPropertySlot):

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

(JSC::JSBoundFunction::getOwnPropertySlot):

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

(JSC::JSByteArray::getOwnPropertySlot):

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

(JSC::JSCell::getOwnPropertySlot):

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

(JSC::JSFunction::getOwnPropertySlot):

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

(JSC::JSGlobalObject::getOwnPropertySlot):

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

(JSC::JSNotAnObject::getOwnPropertySlot):

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

(JSC::JSONObject::getOwnPropertySlot):

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

(JSC::JSObject::getOwnPropertySlot):

  • runtime/JSObject.h:

(JSC::JSObject::getOwnPropertySlot):

  • runtime/JSStaticScopeObject.cpp:

(JSC::JSStaticScopeObject::getOwnPropertySlot):

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

(JSC::JSString::getOwnPropertySlot):

  • runtime/JSString.h:
  • runtime/MathObject.cpp:

(JSC::MathObject::getOwnPropertySlot):

  • runtime/MathObject.h:
  • runtime/NumberConstructor.cpp:

(JSC::NumberConstructor::getOwnPropertySlot):

  • runtime/NumberConstructor.h:
  • runtime/NumberPrototype.cpp:

(JSC::NumberPrototype::getOwnPropertySlot):

  • runtime/NumberPrototype.h:
  • runtime/ObjectConstructor.cpp:

(JSC::ObjectConstructor::getOwnPropertySlot):

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

(JSC::ObjectPrototype::getOwnPropertySlot):

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

(JSC::RegExpConstructor::getOwnPropertySlot):

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

(JSC::RegExpMatchesArray::getOwnPropertySlot):

  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::getOwnPropertySlot):

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

(JSC::RegExpPrototype::getOwnPropertySlot):

  • runtime/RegExpPrototype.h:
  • runtime/StringConstructor.cpp:

(JSC::StringConstructor::getOwnPropertySlot):

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

(JSC::StringObject::getOwnPropertySlot):

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

(JSC::StringPrototype::getOwnPropertySlot):

  • runtime/StringPrototype.h:

Source/JavaScriptGlue:

Added static version of getOwnPropertySlot to every class that overrides
JSCell::getOwnPropertySlot. The virtual versions now call the static versions.
This is the first step in de-virtualizing JSCell::getOwnPropertySlot.

  • UserObjectImp.cpp:

(UserObjectImp::getOwnPropertySlot):

  • UserObjectImp.h:

Source/WebCore:

No new tests.

Added static version of getOwnPropertySlot to every class that overrides
JSCell::getOwnPropertySlot. The virtual versions now call the static versions.
This is the first step in de-virtualizing JSCell::getOwnPropertySlot.

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::getOwnPropertySlot):

  • bindings/js/JSDOMWindowShell.h:
  • bridge/objc/objc_runtime.h:
  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertySlot):

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
(JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):

  • bridge/qt/qt_runtime.h:
  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::getOwnPropertySlot):

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

(JSC::RuntimeMethod::getOwnPropertySlot):

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

(JSC::Bindings::RuntimeObject::getOwnPropertySlot):

  • bridge/runtime_object.h:

Source/WebKit2:

Added static version of getOwnPropertySlot to every class that overrides
JSCell::getOwnPropertySlot. The virtual versions now call the static versions.
This is the first step in de-virtualizing JSCell::getOwnPropertySlot.

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::JSNPObject::getOwnPropertySlot):

  • WebProcess/Plugins/Netscape/JSNPObject.h:
File:
1 edited

Legend:

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

    r97006 r97015  
    205205bool JSFunction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    206206{
    207     if (isHostFunction())
    208         return Base::getOwnPropertySlot(exec, propertyName, slot);
     207    return getOwnPropertySlot(this, exec, propertyName, slot);
     208}
     209
     210bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     211{
     212    JSFunction* thisObject = static_cast<JSFunction*>(cell);
     213    if (thisObject->isHostFunction())
     214        return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    209215
    210216    if (propertyName == exec->propertyNames().prototype) {
    211         WriteBarrierBase<Unknown>* location = getDirectLocation(exec->globalData(), propertyName);
     217        WriteBarrierBase<Unknown>* location = thisObject->getDirectLocation(exec->globalData(), propertyName);
    212218
    213219        if (!location) {
    214             JSObject* prototype = constructEmptyObject(exec, globalObject()->emptyObjectStructure());
    215             prototype->putDirect(exec->globalData(), exec->propertyNames().constructor, this, DontEnum);
     220            JSObject* prototype = constructEmptyObject(exec, thisObject->globalObject()->emptyObjectStructure());
     221            prototype->putDirect(exec->globalData(), exec->propertyNames().constructor, thisObject, DontEnum);
    216222            PutPropertySlot slot;
    217             putDirect(exec->globalData(), exec->propertyNames().prototype, prototype, DontDelete | DontEnum, false, slot);
    218             location = getDirectLocation(exec->globalData(), exec->propertyNames().prototype);
    219         }
    220 
    221         slot.setValue(this, location->get(), offsetForLocation(location));
     223            thisObject->putDirect(exec->globalData(), exec->propertyNames().prototype, prototype, DontDelete | DontEnum, false, slot);
     224            location = thisObject->getDirectLocation(exec->globalData(), exec->propertyNames().prototype);
     225        }
     226
     227        slot.setValue(thisObject, location->get(), thisObject->offsetForLocation(location));
    222228    }
    223229
    224230    if (propertyName == exec->propertyNames().arguments) {
    225         if (jsExecutable()->isStrictMode()) {
     231        if (thisObject->jsExecutable()->isStrictMode()) {
    226232            throwTypeError(exec, StrictModeArgumentsAccessError);
    227233            slot.setValue(jsNull());
     
    229235        }
    230236   
    231         slot.setCacheableCustom(this, argumentsGetter);
     237        slot.setCacheableCustom(thisObject, argumentsGetter);
    232238        return true;
    233239    }
    234240
    235241    if (propertyName == exec->propertyNames().length) {
    236         slot.setCacheableCustom(this, lengthGetter);
     242        slot.setCacheableCustom(thisObject, lengthGetter);
    237243        return true;
    238244    }
    239245
    240246    if (propertyName == exec->propertyNames().caller) {
    241         if (jsExecutable()->isStrictMode()) {
     247        if (thisObject->jsExecutable()->isStrictMode()) {
    242248            throwTypeError(exec, StrictModeCallerAccessError);
    243249            slot.setValue(jsNull());
    244250            return true;
    245251        }
    246         slot.setCacheableCustom(this, callerGetter);
    247         return true;
    248     }
    249 
    250     return Base::getOwnPropertySlot(exec, propertyName, slot);
     252        slot.setCacheableCustom(thisObject, callerGetter);
     253        return true;
     254    }
     255
     256    return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    251257}
    252258
Note: See TracChangeset for help on using the changeset viewer.