Changeset 153532 in webkit


Ignore:
Timestamp:
Jul 31, 2013 12:03:05 PM (11 years ago)
Author:
barraclough@apple.com
Message:

Some cleanup in JSValue::get
https://bugs.webkit.org/show_bug.cgi?id=119343

Reviewed by Geoff Garen.

Source/JavaScriptCore:

JSValue::get is implemented to:

1) Check if the value is a cell – if not, synthesize a prototype to search,
2) call getOwnPropertySlot on the cell,
3) if this returns false, cast to JSObject to get the prototype, and walk the prototype chain.

By all rights this should crash when passed a string and accessing a property that does not exist, because
the string is a cell, getOwnPropertySlot should return false, and the cast to JSObject should be unsafe.
To work around this, JSString::getOwnPropertySlot actually implements 'get' functionality - searching the
prototype chain, and faking out a return value of undefined if no property is found.

This is a huge hazard, since fixing JSString::getOwnPropertySlot or calling getOwnPropertySlot on cells
from elsewhere would introduce bugs. Fortunately it is only ever called in this one place.

The fix here is to move getOwnPropertySlot onto JSObjecte and end this madness - cells don't have property
slots anyway.

Interesting changes are in JSCJSValueInlines.h, JSString.cpp - the rest is pretty much all JSCell -> JSObject.

Source/WebCore:

  • WebCore.exp.in:
  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):
(GenerateImplementation):
(GenerateConstructorDeclaration):
(GenerateConstructorHelperMethods):

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

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

  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::getOwnPropertySlotByIndex):

  • 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:
    • getOwnPropertySlot, JSCell -> JSObject

Source/WebKit2:

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::JSNPObject::getOwnPropertySlot):

  • WebProcess/Plugins/Netscape/JSNPObject.h:
    • getOwnPropertySlot, JSCell -> JSObject
Location:
trunk/Source
Files:
80 edited

Legend:

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

    r148696 r153532  
    177177    static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
    178178
    179     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
    180     static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
     179    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
     180    static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
    181181    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    182182   
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r153145 r153532  
    123123
    124124template <class Parent>
    125 bool JSCallbackObject<Parent>::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    126 {
    127     JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
     125bool JSCallbackObject<Parent>::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     126{
     127    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(object);
    128128    JSContextRef ctx = toRef(exec);
    129129    JSObjectRef thisRef = toRef(thisObject);
     
    184184
    185185template <class Parent>
    186 bool JSCallbackObject<Parent>::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
    187 {
    188     return cell->methodTable()->getOwnPropertySlot(cell, exec, Identifier::from(exec, propertyName), slot);
     186bool JSCallbackObject<Parent>::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     187{
     188    return object->methodTable()->getOwnPropertySlot(object, exec, Identifier::from(exec, propertyName), slot);
    189189}
    190190
  • trunk/Source/JavaScriptCore/ChangeLog

    r153527 r153532  
     12013-07-30  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Some cleanup in JSValue::get
     4        https://bugs.webkit.org/show_bug.cgi?id=119343
     5
     6        Reviewed by Geoff Garen.
     7
     8        JSValue::get is implemented to:
     9            1) Check if the value is a cell – if not, synthesize a prototype to search,
     10            2) call getOwnPropertySlot on the cell,
     11            3) if this returns false, cast to JSObject to get the prototype, and walk the prototype chain.
     12        By all rights this should crash when passed a string and accessing a property that does not exist, because
     13        the string is a cell, getOwnPropertySlot should return false, and the cast to JSObject should be unsafe.
     14        To work around this, JSString::getOwnPropertySlot actually implements 'get' functionality - searching the
     15        prototype chain, and faking out a return value of undefined if no property is found.
     16
     17        This is a huge hazard, since fixing JSString::getOwnPropertySlot or calling getOwnPropertySlot on cells
     18        from elsewhere would introduce bugs. Fortunately it is only ever called in this one place.
     19
     20        The fix here is to move getOwnPropertySlot onto JSObjecte and end this madness - cells don't have property
     21        slots anyway.
     22
     23        Interesting changes are in JSCJSValueInlines.h, JSString.cpp - the rest is pretty much all JSCell -> JSObject.
     24
    1252013-07-31  Michael Saboff  <msaboff@apple.com>
    226
  • trunk/Source/JavaScriptCore/JSCTypedArrayStubs.h

    r148696 r153532  
    5454    }\
    5555\
    56     static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName propertyName, JSC::PropertySlot&);\
     56    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName propertyName, JSC::PropertySlot&);\
    5757    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName propertyName, JSC::PropertyDescriptor&);\
    58     static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\
     58    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\
    5959    static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName propertyName, JSC::JSValue, JSC::PutPropertySlot&);\
    6060    static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool);\
     
    100100}\
    101101\
    102 bool JS##name##Array::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\
    103 {\
    104     JS##name##Array* thisObject = jsCast<JS##name##Array*>(cell);\
     102bool JS##name##Array::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\
     103{\
     104    JS##name##Array* thisObject = jsCast<JS##name##Array*>(object);\
    105105    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\
    106106    unsigned index = propertyName.asIndex();\
     
    110110        return true;\
    111111    }\
    112     return Base::getOwnPropertySlot(cell, exec, propertyName, slot);\
     112    return Base::getOwnPropertySlot(object, exec, propertyName, slot);\
    113113}\
    114114\
     
    126126}\
    127127\
    128 bool JS##name##Array::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)\
    129 {\
    130     JS##name##Array* thisObject = jsCast<JS##name##Array*>(cell);\
     128bool JS##name##Array::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot)\
     129{\
     130    JS##name##Array* thisObject = jsCast<JS##name##Array*>(object);\
    131131    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\
    132132    if (propertyName < thisObject->m_storageLength) {\
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp

    r148696 r153532  
    6666}
    6767
    68 bool DebuggerActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     68bool DebuggerActivation::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    6969{
    70     DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(cell);
     70    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(object);
    7171    return thisObject->m_activation->methodTable()->getOwnPropertySlot(thisObject->m_activation.get(), exec, propertyName, slot);
    7272}
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h

    r148696 r153532  
    4444        static void visitChildren(JSCell*, SlotVisitor&);
    4545        static String className(const JSObject*);
    46         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     46        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    4747        static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
    4848        static void putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned attributes);
  • trunk/Source/JavaScriptCore/runtime/Arguments.cpp

    r153211 r153532  
    9191}
    9292
    93 bool Arguments::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot)
    94 {
    95     Arguments* thisObject = jsCast<Arguments*>(cell);
     93bool Arguments::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned i, PropertySlot& slot)
     94{
     95    Arguments* thisObject = jsCast<Arguments*>(object);
    9696    if (JSValue value = thisObject->tryGetArgument(i)) {
    9797        slot.setValue(value);
     
    124124}
    125125
    126 bool Arguments::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    127 {
    128     Arguments* thisObject = jsCast<Arguments*>(cell);
     126bool Arguments::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     127{
     128    Arguments* thisObject = jsCast<Arguments*>(object);
    129129    unsigned i = propertyName.asIndex();
    130130    if (JSValue value = thisObject->tryGetArgument(i)) {
  • trunk/Source/JavaScriptCore/runtime/Arguments.h

    r148696 r153532  
    9898private:
    9999    static void destroy(JSCell*);
    100     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
    101     static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
     100    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
     101    static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
    102102    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    103103    static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r148696 r153532  
    6767}
    6868
    69 bool ArrayConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     69bool ArrayConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    7070{
    71     return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), jsCast<ArrayConstructor*>(cell), propertyName, slot);
     71    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), jsCast<ArrayConstructor*>(object), propertyName, slot);
    7272}
    7373
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r148696 r153532  
    5454private:
    5555    ArrayConstructor(JSGlobalObject*, Structure*);
    56     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     56    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5757
    5858    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r153221 r153532  
    137137}
    138138
    139 bool ArrayPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    140 {
    141     return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), jsCast<ArrayPrototype*>(cell), propertyName, slot);
     139bool ArrayPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     140{
     141    return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), jsCast<ArrayPrototype*>(object), propertyName, slot);
    142142}
    143143
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h

    r148696 r153532  
    3636    static ArrayPrototype* create(ExecState*, JSGlobalObject*, Structure*);
    3737       
    38     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     38    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    3939    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    4040
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp

    r148696 r153532  
    6464}
    6565
    66 bool BooleanPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     66bool BooleanPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    6767{
    68     return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), jsCast<BooleanPrototype*>(cell), propertyName, slot);
     68    return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), jsCast<BooleanPrototype*>(object), propertyName, slot);
    6969}
    7070
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h

    r148696 r153532  
    5050private:
    5151    BooleanPrototype(ExecState*, Structure*);
    52     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     52    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5353
    5454    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/ClassInfo.h

    r153145 r153532  
    6161    DeletePropertyByIndexFunctionPtr deletePropertyByIndex;
    6262
    63     typedef bool (*GetOwnPropertySlotFunctionPtr)(JSCell*, ExecState*, PropertyName, PropertySlot&);
     63    typedef bool (*GetOwnPropertySlotFunctionPtr)(JSObject*, ExecState*, PropertyName, PropertySlot&);
    6464    GetOwnPropertySlotFunctionPtr getOwnPropertySlot;
    6565
    66     typedef bool (*GetOwnPropertySlotByIndexFunctionPtr)(JSCell*, ExecState*, unsigned, PropertySlot&);
     66    typedef bool (*GetOwnPropertySlotByIndexFunctionPtr)(JSObject*, ExecState*, unsigned, PropertySlot&);
    6767    GetOwnPropertySlotByIndexFunctionPtr getOwnPropertySlotByIndex;
    6868
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r148696 r153532  
    8787}
    8888
    89 bool DateConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    90 {
    91     return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), jsCast<DateConstructor*>(cell), propertyName, slot);
     89bool DateConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     90{
     91    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), jsCast<DateConstructor*>(object), propertyName, slot);
    9292}
    9393
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r148696 r153532  
    5555        static CallType getCallData(JSCell*, CallData&);
    5656
    57         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     57        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5858
    5959        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp

    r153145 r153532  
    515515}
    516516
    517 bool DatePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    518 {
    519     return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), jsCast<DatePrototype*>(cell), propertyName, slot);
     517bool DatePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     518{
     519    return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), jsCast<DatePrototype*>(object), propertyName, slot);
    520520}
    521521
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.h

    r148696 r153532  
    4141            return prototype;
    4242        }
    43         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     43        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    4444
    4545        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp

    r148696 r153532  
    6262}
    6363
    64 bool ErrorPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     64bool ErrorPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    6565{
    66     return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), jsCast<ErrorPrototype*>(cell), propertyName, slot);
     66    return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), jsCast<ErrorPrototype*>(object), propertyName, slot);
    6767}
    6868
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h

    r148696 r153532  
    5353
    5454    private:
    55         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     55        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5656        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    5757    };
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r153170 r153532  
    151151}
    152152
    153 bool JSActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    154 {
    155     JSActivation* thisObject = jsCast<JSActivation*>(cell);
     153bool JSActivation::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     154{
     155    JSActivation* thisObject = jsCast<JSActivation*>(object);
    156156
    157157    if (propertyName == exec->propertyNames().arguments) {
  • trunk/Source/JavaScriptCore/runtime/JSActivation.h

    r153221 r153532  
    6363        static void visitChildren(JSCell*, SlotVisitor&);
    6464
    65         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     65        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    6666        static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
    6767        JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/JSArray.cpp

    r153189 r153532  
    178178}
    179179
    180 bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    181 {
    182     JSArray* thisObject = jsCast<JSArray*>(cell);
     180bool JSArray::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     181{
     182    JSArray* thisObject = jsCast<JSArray*>(object);
    183183    if (propertyName == exec->propertyNames().length) {
    184184        slot.setValue(jsNumber(thisObject->length()));
  • trunk/Source/JavaScriptCore/runtime/JSArray.h

    r153189 r153532  
    5656    JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool throwException);
    5757
    58     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     58    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5959    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    6060
  • trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h

    r153229 r153532  
    628628inline JSValue JSValue::get(ExecState* exec, PropertyName propertyName, PropertySlot& slot) const
    629629{
    630     if (UNLIKELY(!isCell())) {
    631         JSObject* prototype = synthesizePrototype(exec);
    632         if (!prototype->getPropertySlot(exec, propertyName, slot))
    633             return jsUndefined();
     630    // If this is a primitive, we'll need to synthesize the prototype -
     631    // and if it's a string there are special properties to check first.
     632    JSObject* object;
     633    if (UNLIKELY(!isObject())) {
     634        if (isCell() && asString(*this)->getStringPropertySlot(exec, propertyName, slot))
     635            return slot.getValue(exec, propertyName);
     636        object = synthesizePrototype(exec);
     637    } else
     638        object = asObject(asCell());
     639   
     640    if (object->getPropertySlot(exec, propertyName, slot))
    634641        return slot.getValue(exec, propertyName);
    635     }
    636     JSCell* cell = asCell();
    637     while (true) {
    638         if (cell->fastGetOwnPropertySlot(exec, propertyName, slot))
    639             return slot.getValue(exec, propertyName);
    640         JSValue prototype = asObject(cell)->prototype();
    641         if (!prototype.isObject())
    642             return jsUndefined();
    643         cell = asObject(prototype);
    644     }
     642    return jsUndefined();
    645643}
    646644
     
    653651inline JSValue JSValue::get(ExecState* exec, unsigned propertyName, PropertySlot& slot) const
    654652{
    655     if (UNLIKELY(!isCell())) {
    656         JSObject* prototype = synthesizePrototype(exec);
    657         if (!prototype->getPropertySlot(exec, propertyName, slot))
    658             return jsUndefined();
     653    // If this is a primitive, we'll need to synthesize the prototype -
     654    // and if it's a string there are special properties to check first.
     655    JSObject* object;
     656    if (UNLIKELY(!isObject())) {
     657        if (isCell() && asString(*this)->getStringPropertySlot(exec, propertyName, slot))
     658            return slot.getValue(exec, propertyName);
     659        object = synthesizePrototype(exec);
     660    } else
     661        object = asObject(asCell());
     662   
     663    if (object->getPropertySlot(exec, propertyName, slot))
    659664        return slot.getValue(exec, propertyName);
    660     }
    661     JSCell* cell = const_cast<JSCell*>(asCell());
    662     while (true) {
    663         if (cell->methodTable()->getOwnPropertySlotByIndex(cell, exec, propertyName, slot))
    664             return slot.getValue(exec, propertyName);
    665         JSValue prototype = asObject(cell)->prototype();
    666         if (!prototype.isObject())
    667             return jsUndefined();
    668         cell = prototype.asCell();
    669     }
     665    return jsUndefined();
    670666}
    671667
  • trunk/Source/JavaScriptCore/runtime/JSCell.cpp

    r153145 r153532  
    8383}
    8484
    85 bool JSCell::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName identifier, PropertySlot& slot)
    86 {
    87     // This is not a general purpose implementation of getOwnPropertySlot.
    88     // It should only be called by JSValue::get.
    89     // It calls getPropertySlot, not getOwnPropertySlot.
    90     JSObject* object = cell->toObject(exec, exec->lexicalGlobalObject());
    91     slot.setBase(object);
    92     if (!object->getPropertySlot(exec, identifier, slot))
    93         slot.setUndefined();
    94     return true;
    95 }
    96 
    97 bool JSCell::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned identifier, PropertySlot& slot)
    98 {
    99     // This is not a general purpose implementation of getOwnPropertySlot.
    100     // It should only be called by JSValue::get.
    101     // It calls getPropertySlot, not getOwnPropertySlot.
    102     JSObject* object = cell->toObject(exec, exec->lexicalGlobalObject());
    103     slot.setBase(object);
    104     if (!object->getPropertySlot(exec, identifier, slot))
    105         slot.setUndefined();
    106     return true;
    107 }
    108 
    10985void JSCell::put(JSCell* cell, ExecState* exec, PropertyName identifier, JSValue value, PutPropertySlot& slot)
    11086{
     
    187163}
    188164
     165bool JSCell::getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&)
     166{
     167    RELEASE_ASSERT_NOT_REACHED();
     168    return false;
     169}
     170
     171bool JSCell::getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned, PropertySlot&)
     172{
     173    RELEASE_ASSERT_NOT_REACHED();
     174    return false;
     175}
     176
    189177void JSCell::getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode)
    190178{
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r153145 r153532  
    119119    bool isZapped() const { return !*reinterpret_cast<uintptr_t* const*>(this); }
    120120
    121     // FIXME: Rename getOwnPropertySlot to virtualGetOwnPropertySlot, and
    122     // fastGetOwnPropertySlot to getOwnPropertySlot. Callers should always
    123     // call this function, not its slower virtual counterpart. (For integer
    124     // property names, we want a similar interface with appropriate optimizations.)
    125     bool fastGetOwnPropertySlot(ExecState*, PropertyName, PropertySlot&);
    126121    JSValue fastGetOwnProperty(ExecState*, const String&);
    127122
     
    146141    void finishCreation(VM&, Structure*, CreatingEarlyCellTag);
    147142
    148     // Base implementation; for non-object classes implements getPropertySlot.
    149     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
    150     static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    151 
    152143    // Dummy implementations of override-able static functions for classes to put in their MethodTable
    153144    static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
     
    160151    static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
    161152    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
     153    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
     154    static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
    162155
    163156private:
  • trunk/Source/JavaScriptCore/runtime/JSCellInlines.h

    r153148 r153532  
    166166}
    167167
    168 ALWAYS_INLINE bool JSCell::fastGetOwnPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    169 {
    170     if (!structure()->typeInfo().overridesGetOwnPropertySlot())
    171         return asObject(this)->inlineGetOwnPropertySlot(exec, propertyName, slot);
    172     return methodTable()->getOwnPropertySlot(this, exec, propertyName, slot);
    173 }
    174 
    175168// Fast call to get a property where we may not yet have converted the string to an
    176169// identifier. The first time we perform a property access with a given string, try
  • trunk/Source/JavaScriptCore/runtime/JSFunction.cpp

    r153218 r153532  
    241241}
    242242
    243 bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    244 {
    245     JSFunction* thisObject = jsCast<JSFunction*>(cell);
     243bool JSFunction::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     244{
     245    JSFunction* thisObject = jsCast<JSFunction*>(object);
    246246    if (thisObject->isHostFunction())
    247247        return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
  • trunk/Source/JavaScriptCore/runtime/JSFunction.h

    r153124 r153532  
    171171        ObjectAllocationProfile* createAllocationProfile(ExecState*, size_t inlineCapacity);
    172172
    173         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     173        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    174174        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    175175        static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r153357 r153532  
    570570}
    571571
    572 bool JSGlobalObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    573 {
    574     JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(cell);
     572bool JSGlobalObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     573{
     574    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object);
    575575    if (getStaticFunctionSlot<Base>(exec, ExecState::globalObjectTable(exec), thisObject, propertyName, slot))
    576576        return true;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r153244 r153532  
    237237    JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&);
    238238
    239     JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     239    JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    240240    JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    241241    bool hasOwnPropertyForWrite(ExecState*, PropertyName);
  • trunk/Source/JavaScriptCore/runtime/JSNameScope.cpp

    r153145 r153532  
    7676}
    7777
    78 bool JSNameScope::getOwnPropertySlot(JSCell* cell, ExecState*, PropertyName propertyName, PropertySlot& slot)
     78bool JSNameScope::getOwnPropertySlot(JSObject* object, ExecState*, PropertyName propertyName, PropertySlot& slot)
    7979{
    80     return symbolTableGet(jsCast<JSNameScope*>(cell), propertyName, slot);
     80    return symbolTableGet(jsCast<JSNameScope*>(object), propertyName, slot);
    8181}
    8282
  • trunk/Source/JavaScriptCore/runtime/JSNameScope.h

    r153221 r153532  
    5353    static void visitChildren(JSCell*, SlotVisitor&);
    5454    static JSValue toThis(JSCell*, ExecState*, ECMAMode);
    55     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     55    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5656    static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
    5757
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.cpp

    r149980 r153532  
    4747
    4848// JSObject methods
    49 bool JSNotAnObject::getOwnPropertySlot(JSCell*, ExecState* exec, PropertyName, PropertySlot&)
     49bool JSNotAnObject::getOwnPropertySlot(JSObject*, ExecState* exec, PropertyName, PropertySlot&)
    5050{
    5151    ASSERT_UNUSED(exec, exec->hadException());
     
    5353}
    5454
    55 bool JSNotAnObject::getOwnPropertySlotByIndex(JSCell*, ExecState* exec, unsigned, PropertySlot&)
     55bool JSNotAnObject::getOwnPropertySlotByIndex(JSObject*, ExecState* exec, unsigned, PropertySlot&)
    5656{
    5757    ASSERT_UNUSED(exec, exec->hadException());
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h

    r148696 r153532  
    6969
    7070        // JSObject methods
    71         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
    72         static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
     71        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
     72        static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
    7373        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    7474
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r148696 r153532  
    591591// ECMA 15.8
    592592
    593 bool JSONObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    594 {
    595     return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), jsCast<JSONObject*>(cell), propertyName, slot);
     593bool JSONObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     594{
     595    return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), jsCast<JSONObject*>(object), propertyName, slot);
    596596}
    597597
  • trunk/Source/JavaScriptCore/runtime/JSONObject.h

    r148696 r153532  
    5757    private:
    5858        JSONObject(JSGlobalObject*, Structure*);
    59         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     59        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    6060        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    6161
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r153374 r153532  
    263263}
    264264
    265 bool JSObject::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot)
     265bool JSObject::getOwnPropertySlotByIndex(JSObject* thisObject, ExecState* exec, unsigned i, PropertySlot& slot)
    266266{
    267267    // NB. The fact that we're directly consulting our indexed storage implies that it is not
    268268    // legal for anyone to override getOwnPropertySlot() without also overriding
    269269    // getOwnPropertySlotByIndex().
    270    
    271     JSObject* thisObject = jsCast<JSObject*>(cell);
    272270   
    273271    if (i > MAX_ARRAY_INDEX)
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r153223 r153532  
    132132    JSValue get(ExecState*, unsigned propertyName) const;
    133133
     134    bool fastGetOwnPropertySlot(ExecState*, PropertyName, PropertySlot&);
    134135    bool getPropertySlot(ExecState*, PropertyName, PropertySlot&);
    135136    bool getPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
    136137    JS_EXPORT_PRIVATE bool getPropertyDescriptor(ExecState*, PropertyName, PropertyDescriptor&);
    137138
    138     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
    139     JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
     139    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
     140    JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
    140141    JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    141142
     
    11721173// but it makes a big difference to property lookup that derived classes can inline their
    11731174// base class call to this.
    1174 ALWAYS_INLINE bool JSObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    1175 {
    1176     return jsCast<JSObject*>(cell)->inlineGetOwnPropertySlot(exec, propertyName, slot);
     1175ALWAYS_INLINE bool JSObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     1176{
     1177    return object->inlineGetOwnPropertySlot(exec, propertyName, slot);
     1178}
     1179
     1180ALWAYS_INLINE bool JSObject::fastGetOwnPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     1181{
     1182    if (!structure()->typeInfo().overridesGetOwnPropertySlot())
     1183        return asObject(this)->inlineGetOwnPropertySlot(exec, propertyName, slot);
     1184    return methodTable()->getOwnPropertySlot(this, exec, propertyName, slot);
    11771185}
    11781186
  • trunk/Source/JavaScriptCore/runtime/JSProxy.cpp

    r148696 r153532  
    7171}
    7272
    73 bool JSProxy::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     73bool JSProxy::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    7474{
    75     JSProxy* thisObject = jsCast<JSProxy*>(cell);
     75    JSProxy* thisObject = jsCast<JSProxy*>(object);
    7676    return thisObject->target()->methodTable()->getOwnPropertySlot(thisObject->target(), exec, propertyName, slot);
    7777}
    7878
    79 bool JSProxy::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     79bool JSProxy::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot)
    8080{
    81     JSProxy* thisObject = jsCast<JSProxy*>(cell);
     81    JSProxy* thisObject = jsCast<JSProxy*>(object);
    8282    return thisObject->target()->methodTable()->getOwnPropertySlotByIndex(thisObject->target(), exec, propertyName, slot);
    8383}
  • trunk/Source/JavaScriptCore/runtime/JSProxy.h

    r148696 r153532  
    7575
    7676    JS_EXPORT_PRIVATE static String className(const JSObject*);
    77     JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
    78     JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned, PropertySlot&);
     77    JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
     78    JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned, PropertySlot&);
    7979    JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    8080    JS_EXPORT_PRIVATE static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r153247 r153532  
    231231}
    232232
    233 JSString* JSRopeString::getIndexSlowCase(ExecState* exec, unsigned i)
     233JS_EXPORT JSString* JSRopeString::getIndexSlowCase(ExecState* exec, unsigned i)
    234234{
    235235    ASSERT(isRope());
     
    284284}
    285285
    286 bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    287 {
    288     JSString* thisObject = jsCast<JSString*>(cell);
    289     // The semantics here are really getPropertySlot, not getOwnPropertySlot.
    290     // This function should only be called by JSValue::get.
    291     if (thisObject->getStringPropertySlot(exec, propertyName, slot))
    292         return true;
    293     slot.setBase(thisObject);
    294     JSObject* object;
    295     for (JSValue prototype = exec->lexicalGlobalObject()->stringPrototype(); !prototype.isNull(); prototype = object->prototype()) {
    296         object = asObject(prototype);
    297         if (object->methodTable()->getOwnPropertySlot(object, exec, propertyName, slot))
    298             return true;
    299     }
    300     slot.setUndefined();
    301     return true;
    302 }
    303 
    304286bool JSString::getStringPropertyDescriptor(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
    305287{
     
    319301}
    320302
    321 bool JSString::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
    322 {
    323     JSString* thisObject = jsCast<JSString*>(cell);
    324     // The semantics here are really getPropertySlot, not getOwnPropertySlot.
    325     // This function should only be called by JSValue::get.
    326     if (thisObject->getStringPropertySlot(exec, propertyName, slot))
    327         return true;
    328     return JSString::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
    329 }
    330 
    331303} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r153240 r153532  
    204204        static JSValue toThis(JSCell*, ExecState*, ECMAMode);
    205205
    206         // Actually getPropertySlot, not getOwnPropertySlot (see JSCell).
    207         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
    208         static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
    209 
    210206        String& string() { ASSERT(!isRope()); return m_value; }
    211207
  • trunk/Source/JavaScriptCore/runtime/NamePrototype.cpp

    r148696 r153532  
    5959}
    6060
    61 bool NamePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     61bool NamePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    6262{
    63     return getStaticFunctionSlot<Base>(exec, ExecState::privateNamePrototypeTable(exec), jsCast<NamePrototype*>(cell), propertyName, slot);
     63    return getStaticFunctionSlot<Base>(exec, ExecState::privateNamePrototypeTable(exec), jsCast<NamePrototype*>(object), propertyName, slot);
    6464}
    6565
  • trunk/Source/JavaScriptCore/runtime/NamePrototype.h

    r148696 r153532  
    5656
    5757private:
    58     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     58    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5959    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    6060};
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r148696 r153532  
    7373}
    7474
    75 bool NumberConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     75bool NumberConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    7676{
    77     return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), jsCast<NumberConstructor*>(cell), propertyName, slot);
     77    return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), jsCast<NumberConstructor*>(object), propertyName, slot);
    7878}
    7979
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r148696 r153532  
    4141        static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
    4242
    43         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     43        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    4444        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    4545        JSValue getValueProperty(ExecState*, int token) const;
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp

    r153240 r153532  
    8484}
    8585
    86 bool NumberPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    87 {
    88     return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), jsCast<NumberPrototype*>(cell), propertyName, slot);
     86bool NumberPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     87{
     88    return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), jsCast<NumberPrototype*>(object), propertyName, slot);
    8989}
    9090
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.h

    r148696 r153532  
    5050    private:
    5151        NumberPrototype(ExecState*, Structure*);
    52         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     52        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5353        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    5454    };
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r153218 r153532  
    9595}
    9696
    97 bool ObjectConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    98 {
    99     return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), jsCast<ObjectConstructor*>(cell), propertyName, slot);
     97bool ObjectConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     98{
     99    return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), jsCast<ObjectConstructor*>(object), propertyName, slot);
    100100}
    101101
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h

    r148696 r153532  
    4141        }
    4242
    43         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     43        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    4444        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    4545
  • trunk/Source/JavaScriptCore/runtime/PropertySlot.h

    r153454 r153532  
    195195    {
    196196        return m_slotBase;
    197     }
    198 
    199     void setBase(JSValue base)
    200     {
    201         ASSERT(m_slotBase);
    202         ASSERT(base);
    203         m_slotBase = base;
    204197    }
    205198
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r148696 r153532  
    154154}
    155155   
    156 bool RegExpConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    157 {
    158     return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), jsCast<RegExpConstructor*>(cell), propertyName, slot);
     156bool RegExpConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     157{
     158    return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), jsCast<RegExpConstructor*>(object), propertyName, slot);
    159159}
    160160
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r148696 r153532  
    5151        static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
    5252
    53         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     53        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5454        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    5555
  • trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h

    r148696 r153532  
    6868        }
    6969
    70         static bool getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     70        static bool getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    7171        {
    72             RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
     72            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(object);
    7373            thisObject->reifyAllPropertiesIfNecessary(exec);
    7474            return JSArray::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    7575        }
    7676
    77         static bool getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     77        static bool getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot)
    7878        {
    79             RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
     79            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(object);
    8080            if (propertyName)
    8181                thisObject->reifyAllPropertiesIfNecessary(exec);
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp

    r148696 r153532  
    9090}
    9191
    92 bool RegExpObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     92bool RegExpObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    9393{
    9494    if (propertyName == exec->propertyNames().lastIndex) {
    95         RegExpObject* regExp = asRegExpObject(cell);
     95        RegExpObject* regExp = asRegExpObject(object);
    9696        slot.setValue(regExp, regExp->getLastIndex());
    9797        return true;
    9898    }
    99     return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), jsCast<RegExpObject*>(cell), propertyName, slot);
     99    return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), jsCast<RegExpObject*>(object), propertyName, slot);
    100100}
    101101
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.h

    r148696 r153532  
    7171        JSValue exec(ExecState*, JSString*);
    7272
    73         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     73        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    7474        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    7575        static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r148696 r153532  
    6666}
    6767
    68 bool RegExpPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     68bool RegExpPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    6969{
    70     return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), jsCast<RegExpPrototype*>(cell), propertyName, slot);
     70    return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), jsCast<RegExpPrototype*>(object), propertyName, slot);
    7171}
    7272
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h

    r148696 r153532  
    5050
    5151    private:
    52         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     52        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5353        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    5454    };
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r148696 r153532  
    6161}
    6262
    63 bool StringConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     63bool StringConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    6464{
    65     return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), jsCast<StringConstructor*>(cell), propertyName, slot);
     65    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), jsCast<StringConstructor*>(object), propertyName, slot);
    6666}
    6767
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r148696 r153532  
    5555        static CallType getCallData(JSCell*, CallData&);
    5656
    57         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     57        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5858        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    5959    };
  • trunk/Source/JavaScriptCore/runtime/StringObject.cpp

    r148696 r153532  
    4545}
    4646
    47 bool StringObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     47bool StringObject::getOwnPropertySlot(JSObject* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    4848{
    4949    StringObject* thisObject = jsCast<StringObject*>(cell);
     
    5353}
    5454   
    55 bool StringObject::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
     55bool StringObject::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot)
    5656{
    57     StringObject* thisObject = jsCast<StringObject*>(cell);
     57    StringObject* thisObject = jsCast<StringObject*>(object);
    5858    if (thisObject->internalValue()->getStringPropertySlot(exec, propertyName, slot))
    5959        return true;   
  • trunk/Source/JavaScriptCore/runtime/StringObject.h

    r148696 r153532  
    4646        static StringObject* create(ExecState*, JSGlobalObject*, JSString*);
    4747
    48         static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
    49         static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
     48        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
     49        static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
    5050        static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    5151
  • trunk/Source/WebCore/ChangeLog

    r153531 r153532  
     12013-07-30  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Some cleanup in JSValue::get
     4        https://bugs.webkit.org/show_bug.cgi?id=119343
     5
     6        Reviewed by Geoff Garen.
     7
     8        * WebCore.exp.in:
     9        * bindings/js/JSDOMWindowCustom.cpp:
     10        (WebCore::JSDOMWindow::getOwnPropertySlot):
     11        (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
     12        * bindings/scripts/CodeGeneratorJS.pm:
     13        (GenerateHeader):
     14        (GenerateImplementation):
     15        (GenerateConstructorDeclaration):
     16        (GenerateConstructorHelperMethods):
     17        * bridge/objc/objc_runtime.h:
     18        * bridge/objc/objc_runtime.mm:
     19        (JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertySlot):
     20        * bridge/runtime_array.cpp:
     21        (JSC::RuntimeArray::getOwnPropertySlot):
     22        (JSC::RuntimeArray::getOwnPropertySlotByIndex):
     23        * bridge/runtime_array.h:
     24        * bridge/runtime_method.cpp:
     25        (JSC::RuntimeMethod::getOwnPropertySlot):
     26        * bridge/runtime_method.h:
     27        * bridge/runtime_object.cpp:
     28        (JSC::Bindings::RuntimeObject::getOwnPropertySlot):
     29        * bridge/runtime_object.h:
     30            - getOwnPropertySlot, JSCell -> JSObject
     31
    1322013-07-31  Alexey Proskuryakov  <ap@apple.com>
    233
  • trunk/Source/WebCore/WebCore.exp.in

    r153515 r153532  
    26382638__ZN3JSC13RuntimeMethod11getCallDataEPNS_6JSCellERNS_8CallDataE
    26392639__ZN3JSC13RuntimeMethod14finishCreationERNS_2VMERKN3WTF6StringE
    2640 __ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateENS_12PropertyNameERNS_12PropertySlotE
     2640__ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_12PropertySlotE
    26412641__ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_18PropertyDescriptorE
    26422642__ZN3JSC13RuntimeMethod6s_infoE
     
    26482648__ZN3JSC8Bindings13RuntimeObject14finishCreationEPNS_14JSGlobalObjectE
    26492649__ZN3JSC8Bindings13RuntimeObject16getConstructDataEPNS_6JSCellERNS_13ConstructDataE
    2650 __ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateENS_12PropertyNameERNS_12PropertySlotE
     2650__ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_12PropertySlotE
    26512651__ZN3JSC8Bindings13RuntimeObject19getOwnPropertyNamesEPNS_8JSObjectEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
    26522652__ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_18PropertyDescriptorE
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r150311 r153532  
    111111}
    112112
    113 bool JSDOMWindow::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    114 {
    115     JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell);
     113bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     114{
     115    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
    116116    // When accessing a Window cross-domain, functions are always the native built-in ones, and they
    117117    // are not affected by properties changed on the Window or anything in its prototype chain.
     
    257257}
    258258
    259 bool JSDOMWindow::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned index, PropertySlot& slot)
    260 {
    261     JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell);
     259bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot)
     260{
     261    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
    262262   
    263263    if (!thisObject->impl()->frame()) {
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r153145 r153532  
    791791    # Getters
    792792    if ($hasGetter) {
    793         push(@headerContent, "    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
     793        push(@headerContent, "    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
    794794        push(@headerContent, "    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n");
    795         push(@headerContent, "    static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n") if ($hasComplexGetter);
     795        push(@headerContent, "    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n") if ($hasComplexGetter);
    796796        push(@headerContent, "    bool getOwnPropertySlotDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n") if $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"};
    797797        push(@headerContent, "    bool getOwnPropertyDescriptorDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n") if $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"};
     
    10201020
    10211021    if ($interface->extendedAttributes->{"JSInlineGetOwnPropertySlot"} && !$interface->extendedAttributes->{"CustomGetOwnPropertySlot"}) {
    1022         push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertySlot(JSC::JSCell* cell, JSC::ExecState* exec, JSC::PropertyName propertyName, JSC::PropertySlot& slot)\n");
     1022        push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertySlot(JSC::JSObject* object, JSC::ExecState* exec, JSC::PropertyName propertyName, JSC::PropertySlot& slot)\n");
    10231023        push(@headerContent, "{\n");
    1024         push(@headerContent, "    ${className}* thisObject = JSC::jsCast<${className}*>(cell);\n");
     1024        push(@headerContent, "    ${className}* thisObject = JSC::jsCast<${className}*>(object);\n");
    10251025        push(@headerContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
    10261026        push(@headerContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numAttributes > 0, 1));
     
    10981098    push(@headerContent, "    static const JSC::ClassInfo s_info;\n");
    10991099    if ($numFunctions > 0 || $numConstants > 0) {
    1100         push(@headerContent, "    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
     1100        push(@headerContent, "    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
    11011101        push(@headerContent, "    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n");
    11021102        $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1;
     
    17691769
    17701770    if ($numConstants > 0 || $numFunctions > 0) {
    1771         push(@implContent, "bool ${className}Prototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n");
     1771        push(@implContent, "bool ${className}Prototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n");
    17721772        push(@implContent, "{\n");
    1773         push(@implContent, "    ${className}Prototype* thisObject = jsCast<${className}Prototype*>(cell);\n");
     1773        push(@implContent, "    ${className}Prototype* thisObject = jsCast<${className}Prototype*>(object);\n");
    17741774
    17751775        if ($numConstants eq 0 && $numFunctions eq 0) {
     
    19211921    if ($hasGetter) {
    19221922        if (!$interface->extendedAttributes->{"JSInlineGetOwnPropertySlot"} && !$interface->extendedAttributes->{"CustomGetOwnPropertySlot"}) {
    1923             push(@implContent, "bool ${className}::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n");
     1923            push(@implContent, "bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n");
    19241924            push(@implContent, "{\n");
    1925             push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
     1925            push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(object);\n");
    19261926            push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
    19271927            push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numAttributes > 0, 0));
     
    19381938                || $interface->extendedAttributes->{"CustomNamedGetter"}
    19391939                || $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}) {
    1940             push(@implContent, "bool ${className}::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned index, PropertySlot& slot)\n");
     1940            push(@implContent, "bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot)\n");
    19411941            push(@implContent, "{\n");
    1942             push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
     1942            push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(object);\n");
    19431943            push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
    19441944
     
    38833883    push(@$outputArray, "    }\n\n");
    38843884
    3885     push(@$outputArray, "    static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
     3885    push(@$outputArray, "    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
    38863886    push(@$outputArray, "    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n");
    38873887    push(@$outputArray, "    static const JSC::ClassInfo s_info;\n");
     
    42654265        my $kind = $hasStaticFunctions ? "Property" : "Value";
    42664266
    4267         push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n");
     4267        push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n");
    42684268        push(@$outputArray, "{\n");
    4269         push(@$outputArray, "    return getStatic${kind}Slot<${constructorClassName}, JSDOMWrapper>(exec, " . constructorHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $constructorClassName) . ", jsCast<${constructorClassName}*>(cell), propertyName, slot);\n");
     4269        push(@$outputArray, "    return getStatic${kind}Slot<${constructorClassName}, JSDOMWrapper>(exec, " . constructorHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $constructorClassName) . ", jsCast<${constructorClassName}*>(object), propertyName, slot);\n");
    42704270        push(@$outputArray, "}\n\n");
    42714271
  • trunk/Source/WebCore/bridge/objc/objc_runtime.h

    r148696 r153532  
    125125    static void destroy(JSCell*);
    126126    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;
    127     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     127    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    128128    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    129129    static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
  • trunk/Source/WebCore/bridge/objc/objc_runtime.mm

    r149255 r153532  
    209209}
    210210
    211 bool ObjcFallbackObjectImp::getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot& slot)
     211bool ObjcFallbackObjectImp::getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot& slot)
    212212{
    213213    // keep the prototype from getting called instead of just returning false
  • trunk/Source/WebCore/bridge/runtime_array.cpp

    r151747 r153532  
    8686}
    8787
    88 bool RuntimeArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     88bool RuntimeArray::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    8989{
    90     RuntimeArray* thisObject = jsCast<RuntimeArray*>(cell);
     90    RuntimeArray* thisObject = jsCast<RuntimeArray*>(object);
    9191    if (propertyName == exec->propertyNames().length) {
    9292        slot.setCacheableCustom(thisObject, thisObject->lengthGetter);
     
    126126}
    127127
    128 bool RuntimeArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState *exec, unsigned index, PropertySlot& slot)
     128bool RuntimeArray::getOwnPropertySlotByIndex(JSObject* object, ExecState *exec, unsigned index, PropertySlot& slot)
    129129{
    130     RuntimeArray* thisObject = jsCast<RuntimeArray*>(cell);
     130    RuntimeArray* thisObject = jsCast<RuntimeArray*>(object);
    131131    if (index < thisObject->getLength()) {
    132132        slot.setCustomIndex(thisObject, index, thisObject->indexGetter);
  • trunk/Source/WebCore/bridge/runtime_array.h

    r148696 r153532  
    5454
    5555    static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
    56     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
    57     static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned, PropertySlot&);
     56    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
     57    static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned, PropertySlot&);
    5858    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    5959    static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
  • trunk/Source/WebCore/bridge/runtime_method.cpp

    r148696 r153532  
    6262}
    6363
    64 bool RuntimeMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
     64bool RuntimeMethod::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot)
    6565{
    66     RuntimeMethod* thisObject = jsCast<RuntimeMethod*>(cell);
     66    RuntimeMethod* thisObject = jsCast<RuntimeMethod*>(object);
    6767    if (propertyName == exec->propertyNames().length) {
    6868        slot.setCacheableCustom(thisObject, thisObject->lengthGetter);
  • trunk/Source/WebCore/bridge/runtime_method.h

    r148696 r153532  
    6565    static CallType getCallData(JSCell*, CallData&);
    6666
    67     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     67    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    6868    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    6969
  • trunk/Source/WebCore/bridge/runtime_object.cpp

    r148696 r153532  
    117117}
    118118
    119 bool RuntimeObject::getOwnPropertySlot(JSCell* cell, ExecState *exec, PropertyName propertyName, PropertySlot& slot)
    120 {
    121     RuntimeObject* thisObject = jsCast<RuntimeObject*>(cell);
     119bool RuntimeObject::getOwnPropertySlot(JSObject* object, ExecState *exec, PropertyName propertyName, PropertySlot& slot)
     120{
     121    RuntimeObject* thisObject = jsCast<RuntimeObject*>(object);
    122122    if (!thisObject->m_instance) {
    123123        throwInvalidAccessError(exec);
  • trunk/Source/WebCore/bridge/runtime_object.h

    r148696 r153532  
    4646    static void destroy(JSCell*);
    4747
    48     static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
     48    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    4949    static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
    5050    static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
  • trunk/Source/WebKit2/ChangeLog

    r153520 r153532  
     12013-07-30  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Some cleanup in JSValue::get
     4        https://bugs.webkit.org/show_bug.cgi?id=119343
     5
     6        Reviewed by Geoff Garen.
     7
     8        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
     9        (WebKit::JSNPObject::getOwnPropertySlot):
     10        * WebProcess/Plugins/Netscape/JSNPObject.h:
     11            - getOwnPropertySlot, JSCell -> JSObject
     12
    1132013-07-31  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    214
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp

    r148696 r153532  
    259259}
    260260
    261 bool JSNPObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    262 {
    263     JSNPObject* thisObject = JSC::jsCast<JSNPObject*>(cell);
     261bool JSNPObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
     262{
     263    JSNPObject* thisObject = JSC::jsCast<JSNPObject*>(object);
    264264    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
    265265    if (!thisObject->m_npObject) {
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h

    r148696 r153532  
    8686    static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
    8787
    88     static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     88    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
    8989    static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
    9090    static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
Note: See TracChangeset for help on using the changeset viewer.