Changeset 97015 in webkit
- Timestamp:
- Oct 8, 2011 2:31:32 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 83 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r97014 r97015 1 2011-10-08 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static version of JSCell::getOwnPropertySlot 4 https://bugs.webkit.org/show_bug.cgi?id=69593 5 6 Reviewed by Geoffrey Garen. 7 8 Added static version of getOwnPropertySlot to every class that overrides 9 JSCell::getOwnPropertySlot. The virtual versions now call the static versions. 10 This is the first step in de-virtualizing JSCell::getOwnPropertySlot. 11 12 * JavaScriptCore.exp: 13 * debugger/DebuggerActivation.cpp: 14 (JSC::DebuggerActivation::getOwnPropertySlot): 15 * debugger/DebuggerActivation.h: 16 * runtime/Arguments.cpp: 17 (JSC::Arguments::getOwnPropertySlot): 18 * runtime/Arguments.h: 19 * runtime/ArrayConstructor.h: 20 * runtime/ArrayPrototype.cpp: 21 (JSC::ArrayPrototype::getOwnPropertySlot): 22 * runtime/ArrayPrototype.h: 23 * runtime/BooleanPrototype.cpp: 24 (JSC::BooleanPrototype::getOwnPropertySlot): 25 * runtime/BooleanPrototype.h: 26 * runtime/DateConstructor.cpp: 27 (JSC::DateConstructor::getOwnPropertySlot): 28 * runtime/DateConstructor.h: 29 * runtime/DatePrototype.cpp: 30 (JSC::DatePrototype::getOwnPropertySlot): 31 * runtime/DatePrototype.h: 32 * runtime/ErrorPrototype.cpp: 33 (JSC::ErrorPrototype::getOwnPropertySlot): 34 * runtime/ErrorPrototype.h: 35 * runtime/JSActivation.cpp: 36 (JSC::JSActivation::getOwnPropertySlot): 37 * runtime/JSActivation.h: 38 * runtime/JSArray.cpp: 39 (JSC::JSArray::getOwnPropertySlot): 40 * runtime/JSArray.h: 41 * runtime/JSBoundFunction.cpp: 42 (JSC::JSBoundFunction::getOwnPropertySlot): 43 * runtime/JSBoundFunction.h: 44 * runtime/JSByteArray.cpp: 45 (JSC::JSByteArray::getOwnPropertySlot): 46 * runtime/JSByteArray.h: 47 * runtime/JSCell.cpp: 48 (JSC::JSCell::getOwnPropertySlot): 49 * runtime/JSCell.h: 50 * runtime/JSFunction.cpp: 51 (JSC::JSFunction::getOwnPropertySlot): 52 * runtime/JSFunction.h: 53 * runtime/JSGlobalObject.cpp: 54 (JSC::JSGlobalObject::getOwnPropertySlot): 55 * runtime/JSGlobalObject.h: 56 * runtime/JSNotAnObject.cpp: 57 (JSC::JSNotAnObject::getOwnPropertySlot): 58 * runtime/JSNotAnObject.h: 59 * runtime/JSONObject.cpp: 60 (JSC::JSONObject::getOwnPropertySlot): 61 * runtime/JSONObject.h: 62 * runtime/JSObject.cpp: 63 (JSC::JSObject::getOwnPropertySlot): 64 * runtime/JSObject.h: 65 (JSC::JSObject::getOwnPropertySlot): 66 * runtime/JSStaticScopeObject.cpp: 67 (JSC::JSStaticScopeObject::getOwnPropertySlot): 68 * runtime/JSStaticScopeObject.h: 69 * runtime/JSString.cpp: 70 (JSC::JSString::getOwnPropertySlot): 71 * runtime/JSString.h: 72 * runtime/MathObject.cpp: 73 (JSC::MathObject::getOwnPropertySlot): 74 * runtime/MathObject.h: 75 * runtime/NumberConstructor.cpp: 76 (JSC::NumberConstructor::getOwnPropertySlot): 77 * runtime/NumberConstructor.h: 78 * runtime/NumberPrototype.cpp: 79 (JSC::NumberPrototype::getOwnPropertySlot): 80 * runtime/NumberPrototype.h: 81 * runtime/ObjectConstructor.cpp: 82 (JSC::ObjectConstructor::getOwnPropertySlot): 83 * runtime/ObjectConstructor.h: 84 * runtime/ObjectPrototype.cpp: 85 (JSC::ObjectPrototype::getOwnPropertySlot): 86 * runtime/ObjectPrototype.h: 87 * runtime/RegExpConstructor.cpp: 88 (JSC::RegExpConstructor::getOwnPropertySlot): 89 * runtime/RegExpConstructor.h: 90 * runtime/RegExpMatchesArray.h: 91 (JSC::RegExpMatchesArray::getOwnPropertySlot): 92 * runtime/RegExpObject.cpp: 93 (JSC::RegExpObject::getOwnPropertySlot): 94 * runtime/RegExpObject.h: 95 * runtime/RegExpPrototype.cpp: 96 (JSC::RegExpPrototype::getOwnPropertySlot): 97 * runtime/RegExpPrototype.h: 98 * runtime/StringConstructor.cpp: 99 (JSC::StringConstructor::getOwnPropertySlot): 100 * runtime/StringConstructor.h: 101 * runtime/StringObject.cpp: 102 (JSC::StringObject::getOwnPropertySlot): 103 * runtime/StringObject.h: 104 * runtime/StringPrototype.cpp: 105 (JSC::StringPrototype::getOwnPropertySlot): 106 * runtime/StringPrototype.h: 107 1 108 2011-10-08 Yuqiang Xian <yuqiang.xian@intel.com> 2 109 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r97006 r97015 324 324 __ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEjbRNS_15PutPropertySlotE 325 325 __ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateEjNS_7JSValueEj 326 __ZN3JSC8JSObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE 326 327 __ZN3JSC8JSObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE 327 328 __ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
r97002 r97015 63 63 bool DebuggerActivation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 64 64 { 65 return m_activation->getOwnPropertySlot(exec, propertyName, slot); 65 return getOwnPropertySlot(this, exec, propertyName, slot); 66 } 67 68 bool DebuggerActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 69 { 70 return static_cast<DebuggerActivation*>(cell)->m_activation->getOwnPropertySlot(exec, propertyName, slot); 66 71 } 67 72 -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h
r97002 r97015 45 45 virtual UString className() const; 46 46 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 47 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 47 48 virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); 48 49 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r97002 r97015 148 148 bool Arguments::getOwnPropertySlot(ExecState* exec, unsigned i, PropertySlot& slot) 149 149 { 150 if (i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) { 151 if (i < d->numParameters) { 152 slot.setValue(d->registers[d->firstParameterIndex + i].get()); 150 return getOwnPropertySlot(this, exec, i, slot); 151 } 152 153 bool Arguments::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot) 154 { 155 Arguments* thisObject = static_cast<Arguments*>(cell); 156 if (i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) { 157 if (i < thisObject->d->numParameters) { 158 slot.setValue(thisObject->d->registers[thisObject->d->firstParameterIndex + i].get()); 153 159 } else 154 slot.setValue( d->extraArguments[i -d->numParameters].get());155 return true; 156 } 157 158 return JSObject::getOwnPropertySlot( exec, Identifier(exec, UString::number(i)), slot);160 slot.setValue(thisObject->d->extraArguments[i - thisObject->d->numParameters].get()); 161 return true; 162 } 163 164 return JSObject::getOwnPropertySlot(thisObject, exec, Identifier(exec, UString::number(i)), slot); 159 165 } 160 166 -
trunk/Source/JavaScriptCore/runtime/Arguments.h
r97002 r97015 126 126 void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc); 127 127 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 128 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 128 129 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 130 static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 129 131 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 130 132 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r97006 r97015 53 53 ArrayConstructor(JSGlobalObject*, Structure*); 54 54 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 55 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 56 55 57 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 56 58 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r96438 r97015 128 128 bool ArrayPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 129 129 { 130 return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), this, propertyName, slot); 130 return getOwnPropertySlot(this, exec, propertyName, slot); 131 } 132 133 bool ArrayPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 134 { 135 return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), static_cast<ArrayPrototype*>(cell), propertyName, slot); 131 136 } 132 137 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h
r94929 r97015 41 41 } 42 42 43 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 43 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 44 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 44 45 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 45 46 -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r95936 r97015 65 65 bool BooleanPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 66 66 { 67 return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, slot); 67 return getOwnPropertySlot(this, exec, propertyName, slot); 68 } 69 70 bool BooleanPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 71 { 72 return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), static_cast<BooleanPrototype*>(cell), propertyName, slot); 68 73 } 69 74 -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h
r95108 r97015 51 51 BooleanPrototype(ExecState*, Structure*); 52 52 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 53 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 54 53 55 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 54 56 }; -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r97006 r97015 88 88 bool DateConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 89 89 { 90 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), this, propertyName, slot); 90 return getOwnPropertySlot(this, exec, propertyName, slot); 91 } 92 93 bool DateConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 94 { 95 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), static_cast<DateConstructor*>(cell), propertyName, slot); 91 96 } 92 97 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r97006 r97015 57 57 58 58 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 59 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 60 59 61 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 60 62 }; -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r95936 r97015 446 446 bool DatePrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 447 447 { 448 return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), this, propertyName, slot); 449 } 450 448 return getOwnPropertySlot(this, exec, propertyName, slot); 449 } 450 451 bool DatePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 452 { 453 return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), static_cast<DatePrototype*>(cell), propertyName, slot); 454 } 451 455 452 456 bool DatePrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) -
trunk/Source/JavaScriptCore/runtime/DatePrototype.h
r95108 r97015 42 42 } 43 43 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 44 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 45 44 46 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 45 47 -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
r96438 r97015 65 65 bool ErrorPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 66 66 { 67 return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), this, propertyName, slot); 67 return getOwnPropertySlot(this, exec, propertyName, slot); 68 } 69 70 bool ErrorPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 71 { 72 return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), static_cast<ErrorPrototype*>(cell), propertyName, slot); 68 73 } 69 74 -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h
r94929 r97015 54 54 private: 55 55 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 56 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 56 57 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 57 58 }; -
trunk/Source/JavaScriptCore/runtime/JSActivation.cpp
r97002 r97015 144 144 bool JSActivation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 145 145 { 146 return getOwnPropertySlot(this, exec, propertyName, slot); 147 } 148 149 bool JSActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 150 { 151 JSActivation* thisObject = static_cast<JSActivation*>(cell); 146 152 if (propertyName == exec->propertyNames().arguments) { 147 slot.setCustom(this ,getArgumentsGetter());153 slot.setCustom(thisObject, thisObject->getArgumentsGetter()); 148 154 return true; 149 155 } 150 156 151 if ( symbolTableGet(propertyName, slot))152 return true; 153 154 if (WriteBarrierBase<Unknown>* location = getDirectLocation(exec->globalData(), propertyName)) {157 if (thisObject->symbolTableGet(propertyName, slot)) 158 return true; 159 160 if (WriteBarrierBase<Unknown>* location = thisObject->getDirectLocation(exec->globalData(), propertyName)) { 155 161 slot.setValue(location->get()); 156 162 return true; … … 159 165 // We don't call through to JSObject because there's no way to give an 160 166 // activation object getter properties or a prototype. 161 ASSERT(! hasGetterSetterProperties());162 ASSERT( prototype().isNull());167 ASSERT(!thisObject->hasGetterSetterProperties()); 168 ASSERT(thisObject->prototype().isNull()); 163 169 return false; 164 170 } -
trunk/Source/JavaScriptCore/runtime/JSActivation.h
r97002 r97015 63 63 64 64 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 65 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 65 66 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode); 66 67 -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r97002 r97015 248 248 bool JSArray::getOwnPropertySlot(ExecState* exec, unsigned i, PropertySlot& slot) 249 249 { 250 ArrayStorage* storage = m_storage; 250 return getOwnPropertySlot(this, exec, i, slot); 251 } 252 253 bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot) 254 { 255 JSArray* thisObject = static_cast<JSArray*>(cell); 256 ArrayStorage* storage = thisObject->m_storage; 251 257 252 258 if (i >= storage->m_length) { 253 259 if (i > MAX_ARRAY_INDEX) 254 return getOwnPropertySlot(exec, Identifier::from(exec, i), slot);260 return thisObject->getOwnPropertySlot(exec, Identifier::from(exec, i), slot); 255 261 return false; 256 262 } 257 263 258 if (i < m_vectorLength) {264 if (i < thisObject->m_vectorLength) { 259 265 JSValue value = storage->m_vector[i].get(); 260 266 if (value) { … … 272 278 } 273 279 274 return JSObject::getOwnPropertySlot( exec, Identifier::from(exec, i), slot);280 return JSObject::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, i), slot); 275 281 } 276 282 277 283 bool JSArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 278 284 { 285 return getOwnPropertySlot(this, exec, propertyName, slot); 286 } 287 288 bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 289 { 290 JSArray* thisObject = static_cast<JSArray*>(cell); 279 291 if (propertyName == exec->propertyNames().length) { 280 slot.setValue(jsNumber( length()));292 slot.setValue(jsNumber(thisObject->length())); 281 293 return true; 282 294 } … … 285 297 unsigned i = propertyName.toArrayIndex(isArrayIndex); 286 298 if (isArrayIndex) 287 return JSArray::getOwnPropertySlot( exec, i, slot);288 289 return JSObject::getOwnPropertySlot( exec, propertyName, slot);299 return JSArray::getOwnPropertySlot(thisObject, exec, i, slot); 300 301 return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot); 290 302 } 291 303 -
trunk/Source/JavaScriptCore/runtime/JSArray.h
r97002 r97015 96 96 97 97 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 98 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 98 99 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 100 static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 99 101 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 100 102 virtual void put(ExecState*, unsigned propertyName, JSValue); // FIXME: Make protected and add setItem. -
trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
r96346 r97015 99 99 bool JSBoundFunction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 100 100 { 101 return getOwnPropertySlot(this, exec, propertyName, slot); 102 } 103 104 bool JSBoundFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 105 { 101 106 if (propertyName == exec->propertyNames().arguments) { 102 107 throwTypeError(exec, StrictModeArgumentsAccessError); … … 111 116 } 112 117 113 return Base::getOwnPropertySlot( exec, propertyName, slot);118 return Base::getOwnPropertySlot(cell, exec, propertyName, slot); 114 119 } 115 120 -
trunk/Source/JavaScriptCore/runtime/JSBoundFunction.h
r96346 r97015 41 41 42 42 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 43 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 43 44 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 44 45 -
trunk/Source/JavaScriptCore/runtime/JSByteArray.cpp
r96992 r97015 57 57 bool JSByteArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 58 58 { 59 return getOwnPropertySlot(this, exec, propertyName, slot); 60 } 61 62 bool JSByteArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 63 { 64 JSByteArray* thisObject = static_cast<JSByteArray*>(cell); 59 65 bool ok; 60 66 unsigned index = propertyName.toUInt32(ok); 61 if (ok && canAccessIndex(index)) {62 slot.setValue( getIndex(exec, index));67 if (ok && thisObject->canAccessIndex(index)) { 68 slot.setValue(thisObject->getIndex(exec, index)); 63 69 return true; 64 70 } 65 return JSObject::getOwnPropertySlot( exec, propertyName, slot);71 return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot); 66 72 } 67 73 … … 79 85 bool JSByteArray::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 80 86 { 81 if (canAccessIndex(propertyName)) { 82 slot.setValue(getIndex(exec, propertyName)); 87 return getOwnPropertySlot(this, exec, propertyName, slot); 88 } 89 90 bool JSByteArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot) 91 { 92 JSByteArray* thisObject = static_cast<JSByteArray*>(cell); 93 if (thisObject->canAccessIndex(propertyName)) { 94 slot.setValue(thisObject->getIndex(exec, propertyName)); 83 95 return true; 84 96 } 85 return JSObject::getOwnPropertySlot( exec, Identifier::from(exec, propertyName), slot);97 return JSObject::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot); 86 98 } 87 99 -
trunk/Source/JavaScriptCore/runtime/JSByteArray.h
r96992 r97015 90 90 91 91 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 92 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 92 93 virtual bool getOwnPropertySlot(JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&); 94 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&); 93 95 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 94 96 virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/JSCell.cpp
r97006 r97015 72 72 bool JSCell::getOwnPropertySlot(ExecState* exec, const Identifier& identifier, PropertySlot& slot) 73 73 { 74 return getOwnPropertySlot(this, exec, identifier, slot); 75 } 76 77 bool JSCell::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& identifier, PropertySlot& slot) 78 { 74 79 // This is not a general purpose implementation of getOwnPropertySlot. 75 80 // It should only be called by JSValue::get. 76 81 // It calls getPropertySlot, not getOwnPropertySlot. 77 JSObject* object = toObject(exec, exec->lexicalGlobalObject());82 JSObject* object = cell->toObject(exec, exec->lexicalGlobalObject()); 78 83 slot.setBase(object); 79 84 if (!object->getPropertySlot(exec, identifier, slot)) … … 84 89 bool JSCell::getOwnPropertySlot(ExecState* exec, unsigned identifier, PropertySlot& slot) 85 90 { 91 return getOwnPropertySlot(this, exec, identifier, slot); 92 } 93 94 bool JSCell::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned identifier, PropertySlot& slot) 95 { 86 96 // This is not a general purpose implementation of getOwnPropertySlot. 87 97 // It should only be called by JSValue::get. 88 98 // It calls getPropertySlot, not getOwnPropertySlot. 89 JSObject* object = toObject(exec, exec->lexicalGlobalObject());99 JSObject* object = cell->toObject(exec, exec->lexicalGlobalObject()); 90 100 slot.setBase(object); 91 101 if (!object->getPropertySlot(exec, identifier, slot)) -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r97006 r97015 137 137 // Base implementation; for non-object classes implements getPropertySlot. 138 138 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 139 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 139 140 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 141 static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 140 142 141 143 WriteBarrier<Structure> m_structure; -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r97006 r97015 205 205 bool JSFunction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 206 206 { 207 if (isHostFunction()) 208 return Base::getOwnPropertySlot(exec, propertyName, slot); 207 return getOwnPropertySlot(this, exec, propertyName, slot); 208 } 209 210 bool 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); 209 215 210 216 if (propertyName == exec->propertyNames().prototype) { 211 WriteBarrierBase<Unknown>* location = getDirectLocation(exec->globalData(), propertyName);217 WriteBarrierBase<Unknown>* location = thisObject->getDirectLocation(exec->globalData(), propertyName); 212 218 213 219 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); 216 222 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)); 222 228 } 223 229 224 230 if (propertyName == exec->propertyNames().arguments) { 225 if ( jsExecutable()->isStrictMode()) {231 if (thisObject->jsExecutable()->isStrictMode()) { 226 232 throwTypeError(exec, StrictModeArgumentsAccessError); 227 233 slot.setValue(jsNull()); … … 229 235 } 230 236 231 slot.setCacheableCustom(this , argumentsGetter);237 slot.setCacheableCustom(thisObject, argumentsGetter); 232 238 return true; 233 239 } 234 240 235 241 if (propertyName == exec->propertyNames().length) { 236 slot.setCacheableCustom(this , lengthGetter);242 slot.setCacheableCustom(thisObject, lengthGetter); 237 243 return true; 238 244 } 239 245 240 246 if (propertyName == exec->propertyNames().caller) { 241 if ( jsExecutable()->isStrictMode()) {247 if (thisObject->jsExecutable()->isStrictMode()) { 242 248 throwTypeError(exec, StrictModeCallerAccessError); 243 249 slot.setValue(jsNull()); 244 250 return true; 245 251 } 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); 251 257 } 252 258 -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r97006 r97015 133 133 134 134 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 135 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 135 136 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 136 137 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r97006 r97015 423 423 bool JSGlobalObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 424 424 { 425 if (getStaticFunctionSlot<JSVariableObject>(exec, ExecState::globalObjectTable(exec), this, propertyName, slot)) 425 return getOwnPropertySlot(this, exec, propertyName, slot); 426 } 427 428 bool JSGlobalObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 429 { 430 JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(cell); 431 if (getStaticFunctionSlot<JSVariableObject>(exec, ExecState::globalObjectTable(exec), thisObject, propertyName, slot)) 426 432 return true; 427 return symbolTableGet(propertyName, slot);433 return thisObject->symbolTableGet(propertyName, slot); 428 434 } 429 435 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r97006 r97015 181 181 182 182 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 183 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 183 184 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 184 185 virtual bool hasOwnPropertyForWrite(ExecState*, const Identifier&); -
trunk/Source/JavaScriptCore/runtime/JSNotAnObject.cpp
r97002 r97015 58 58 } 59 59 60 bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, const Identifier& identifier, PropertySlot& slot) 61 { 62 return getOwnPropertySlot(this, exec, identifier, slot); 63 } 64 60 65 // JSObject methods 61 bool JSNotAnObject::getOwnPropertySlot( ExecState* exec, const Identifier&, PropertySlot&)66 bool JSNotAnObject::getOwnPropertySlot(JSCell*, ExecState* exec, const Identifier&, PropertySlot&) 62 67 { 63 68 ASSERT_UNUSED(exec, exec->hadException()); … … 65 70 } 66 71 67 bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, unsigned, PropertySlot&) 72 bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 73 { 74 return getOwnPropertySlot(this, exec, propertyName, slot); 75 } 76 77 bool JSNotAnObject::getOwnPropertySlot(JSCell*, ExecState* exec, unsigned, PropertySlot&) 68 78 { 69 79 ASSERT_UNUSED(exec, exec->hadException()); -
trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h
r97002 r97015 72 72 // JSObject methods 73 73 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 74 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 74 75 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 76 static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 75 77 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 76 78 -
trunk/Source/JavaScriptCore/runtime/JSONObject.cpp
r97006 r97015 601 601 bool JSONObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 602 602 { 603 return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), this, propertyName, slot); 603 return getOwnPropertySlot(this, exec, propertyName, slot); 604 } 605 606 bool JSONObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 607 { 608 return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), static_cast<JSONObject*>(cell), propertyName, slot); 604 609 } 605 610 -
trunk/Source/JavaScriptCore/runtime/JSONObject.h
r95901 r97015 58 58 JSONObject(JSGlobalObject*, Structure*); 59 59 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 60 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 60 61 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 61 62 -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r97006 r97015 96 96 bool JSObject::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 97 97 { 98 return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot); 98 return getOwnPropertySlot(this, exec, propertyName, slot); 99 } 100 101 bool JSObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot) 102 { 103 return static_cast<JSObject*>(cell)->getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot); 99 104 } 100 105 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r97006 r97015 103 103 104 104 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 105 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 105 106 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 107 static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 106 108 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 107 109 … … 513 515 } 514 516 517 ALWAYS_INLINE bool JSObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 518 { 519 return getOwnPropertySlot(this, exec, propertyName, slot); 520 } 521 515 522 // It may seem crazy to inline a function this large, especially a virtual function, 516 523 // but it makes a big difference to property lookup that derived classes can inline their 517 524 // base class call to this. 518 ALWAYS_INLINE bool JSObject::getOwnPropertySlot( ExecState* exec, const Identifier& propertyName, PropertySlot& slot)519 { 520 return inlineGetOwnPropertySlot(exec, propertyName, slot);525 ALWAYS_INLINE bool JSObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 526 { 527 return static_cast<JSObject*>(cell)->inlineGetOwnPropertySlot(exec, propertyName, slot); 521 528 } 522 529 -
trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp
r96992 r97015 92 92 } 93 93 94 bool JSStaticScopeObject::getOwnPropertySlot(ExecState* , const Identifier& propertyName, PropertySlot& slot)94 bool JSStaticScopeObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 95 95 { 96 return symbolTableGet(propertyName, slot); 96 return getOwnPropertySlot(this, exec, propertyName, slot); 97 } 98 99 bool JSStaticScopeObject::getOwnPropertySlot(JSCell* cell, ExecState*, const Identifier& propertyName, PropertySlot& slot) 100 { 101 return static_cast<JSStaticScopeObject*>(cell)->symbolTableGet(propertyName, slot); 97 102 } 98 103 -
trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.h
r96992 r97015 46 46 virtual JSObject* toThisObject(ExecState*) const; 47 47 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 48 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 48 49 virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&); 49 50 static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r96143 r97015 316 316 bool JSString::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 317 317 { 318 return getOwnPropertySlot(this, exec, propertyName, slot); 319 } 320 321 bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 322 { 323 JSString* thisObject = static_cast<JSString*>(cell); 318 324 // The semantics here are really getPropertySlot, not getOwnPropertySlot. 319 325 // This function should only be called by JSValue::get. 320 if ( getStringPropertySlot(exec, propertyName, slot))326 if (thisObject->getStringPropertySlot(exec, propertyName, slot)) 321 327 return true; 322 328 if (propertyName == exec->propertyNames().underscoreProto) { … … 324 330 return true; 325 331 } 326 slot.setBase(this );332 slot.setBase(thisObject); 327 333 JSObject* object; 328 334 for (JSValue prototype = exec->lexicalGlobalObject()->stringPrototype(); !prototype.isNull(); prototype = object->prototype()) { … … 364 370 bool JSString::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 365 371 { 372 return getOwnPropertySlot(this, exec, propertyName, slot); 373 } 374 375 bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot) 376 { 377 JSString* thisObject = static_cast<JSString*>(cell); 366 378 // The semantics here are really getPropertySlot, not getOwnPropertySlot. 367 379 // This function should only be called by JSValue::get. 368 if ( getStringPropertySlot(exec, propertyName, slot))369 return true; 370 return JSString::getOwnPropertySlot( exec, Identifier::from(exec, propertyName), slot);380 if (thisObject->getStringPropertySlot(exec, propertyName, slot)) 381 return true; 382 return JSString::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot); 371 383 } 372 384 -
trunk/Source/JavaScriptCore/runtime/JSString.h
r96983 r97015 509 509 // Actually getPropertySlot, not getOwnPropertySlot (see JSCell). 510 510 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 511 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 511 512 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 513 static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 512 514 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 513 515 -
trunk/Source/JavaScriptCore/runtime/MathObject.cpp
r95936 r97015 107 107 bool MathObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 108 108 { 109 return getStaticFunctionSlot<JSObject>(exec, ExecState::mathTable(exec), this, propertyName, slot); 109 return getOwnPropertySlot(this, exec, propertyName, slot); 110 } 111 112 bool MathObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 113 { 114 return getStaticFunctionSlot<JSObject>(exec, ExecState::mathTable(exec), static_cast<MathObject*>(cell), propertyName, slot); 110 115 } 111 116 -
trunk/Source/JavaScriptCore/runtime/MathObject.h
r94929 r97015 40 40 } 41 41 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 42 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 42 43 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 43 44 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r97006 r97015 74 74 bool NumberConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 75 75 { 76 return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), this, propertyName, slot); 76 return getOwnPropertySlot(this, exec, propertyName, slot); 77 } 78 79 bool NumberConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 80 { 81 return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), static_cast<NumberConstructor*>(cell), propertyName, slot); 77 82 } 78 83 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.h
r97006 r97015 40 40 41 41 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 42 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 42 43 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 43 44 JSValue getValueProperty(ExecState*, int token) const; -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r96673 r97015 86 86 bool NumberPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 87 87 { 88 return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), this, propertyName, slot); 88 return getOwnPropertySlot(this, exec, propertyName, slot); 89 } 90 91 bool NumberPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 92 { 93 return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), static_cast<NumberPrototype*>(cell), propertyName, slot); 89 94 } 90 95 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.h
r95893 r97015 51 51 NumberPrototype(ExecState*, Structure*); 52 52 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 53 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 53 54 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 54 55 }; -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r97006 r97015 92 92 bool ObjectConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 93 93 { 94 return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), this, propertyName, slot); 94 return getOwnPropertySlot(this, exec, propertyName, slot); 95 } 96 97 bool ObjectConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 98 { 99 return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), static_cast<ObjectConstructor*>(cell), propertyName, slot); 95 100 } 96 101 -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h
r97006 r97015 40 40 41 41 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 42 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 42 43 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 43 44 -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
r96992 r97015 95 95 bool ObjectPrototype::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 96 96 { 97 if (m_hasNoPropertiesWithUInt32Names) 97 return getOwnPropertySlot(this, exec, propertyName, slot); 98 } 99 100 bool ObjectPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot) 101 { 102 ObjectPrototype* thisObject = static_cast<ObjectPrototype*>(cell); 103 if (thisObject->m_hasNoPropertiesWithUInt32Names) 98 104 return false; 99 return JSNonFinalObject::getOwnPropertySlot(exec, propertyName, slot); 100 } 101 102 bool ObjectPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 103 { 104 return getStaticFunctionSlot<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), this, propertyName, slot); 105 return JSNonFinalObject::getOwnPropertySlot(thisObject, exec, propertyName, slot); 106 } 107 108 bool ObjectPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 109 { 110 return getOwnPropertySlot(this, exec, propertyName, slot); 111 } 112 113 bool ObjectPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 114 { 115 return getStaticFunctionSlot<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), static_cast<ObjectPrototype*>(cell), propertyName, slot); 105 116 } 106 117 -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h
r96992 r97015 55 55 56 56 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 57 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 57 58 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 59 static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 58 60 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 59 61 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r97006 r97015 205 205 bool RegExpConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 206 206 { 207 return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), this, propertyName, slot); 207 return getOwnPropertySlot(this, exec, propertyName, slot); 208 } 209 210 bool RegExpConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 211 { 212 return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), static_cast<RegExpConstructor*>(cell), propertyName, slot); 208 213 } 209 214 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h
r97006 r97015 76 76 77 77 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 78 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 78 79 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 79 80 -
trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
r97002 r97015 46 46 virtual bool getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 47 47 { 48 if (subclassData()) 49 fillArrayInstance(exec); 50 return JSArray::getOwnPropertySlot(exec, propertyName, slot); 48 return getOwnPropertySlot(this, exec, propertyName, slot); 49 } 50 51 static bool getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 52 { 53 RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell); 54 if (thisObject->subclassData()) 55 thisObject->fillArrayInstance(exec); 56 return JSArray::getOwnPropertySlot(thisObject, exec, propertyName, slot); 51 57 } 52 58 53 59 virtual bool getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 54 60 { 55 if (subclassData()) 56 fillArrayInstance(exec); 57 return JSArray::getOwnPropertySlot(exec, propertyName, slot); 61 return getOwnPropertySlot(this, exec, propertyName, slot); 62 } 63 64 static bool getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot) 65 { 66 RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell); 67 if (thisObject->subclassData()) 68 thisObject->fillArrayInstance(exec); 69 return JSArray::getOwnPropertySlot(thisObject, exec, propertyName, slot); 58 70 } 59 71 -
trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp
r96992 r97015 94 94 bool RegExpObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 95 95 { 96 return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), this, propertyName, slot); 96 return getOwnPropertySlot(this, exec, propertyName, slot); 97 } 98 99 bool RegExpObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 100 { 101 return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), static_cast<RegExpObject*>(cell), propertyName, slot); 97 102 } 98 103 -
trunk/Source/JavaScriptCore/runtime/RegExpObject.h
r96992 r97015 67 67 68 68 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 69 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 69 70 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 70 71 virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r96438 r97015 70 70 bool RegExpPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 71 71 { 72 return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), this, propertyName, slot); 72 return getOwnPropertySlot(this, exec, propertyName, slot); 73 } 74 75 bool RegExpPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 76 { 77 return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), static_cast<RegExpPrototype*>(cell), propertyName, slot); 73 78 } 74 79 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h
r95108 r97015 51 51 private: 52 52 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 53 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 53 54 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 54 55 }; -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r97006 r97015 62 62 bool StringConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 63 63 { 64 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), this, propertyName, slot); 64 return getOwnPropertySlot(this, exec, propertyName, slot); 65 } 66 67 bool StringConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 68 { 69 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), static_cast<StringConstructor*>(cell), propertyName, slot); 65 70 } 66 71 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r97006 r97015 57 57 58 58 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 59 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 59 60 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 60 61 }; -
trunk/Source/JavaScriptCore/runtime/StringObject.cpp
r97002 r97015 44 44 bool StringObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 45 45 { 46 if (internalValue()->getStringPropertySlot(exec, propertyName, slot)) 46 return getOwnPropertySlot(this, exec, propertyName, slot); 47 } 48 49 bool StringObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 50 { 51 StringObject* thisObject = static_cast<StringObject*>(cell); 52 if (thisObject->internalValue()->getStringPropertySlot(exec, propertyName, slot)) 47 53 return true; 48 return JSObject::getOwnPropertySlot( exec, propertyName, slot);54 return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot); 49 55 } 50 56 51 57 bool StringObject::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 52 58 { 53 if (internalValue()->getStringPropertySlot(exec, propertyName, slot)) 59 return getOwnPropertySlot(this, exec, propertyName, slot); 60 } 61 62 bool StringObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot) 63 { 64 StringObject* thisObject = static_cast<StringObject*>(cell); 65 if (thisObject->internalValue()->getStringPropertySlot(exec, propertyName, slot)) 54 66 return true; 55 return JSObject::getOwnPropertySlot( exec, Identifier::from(exec, propertyName), slot);67 return JSObject::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot); 56 68 } 57 69 -
trunk/Source/JavaScriptCore/runtime/StringObject.h
r97002 r97015 48 48 49 49 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 50 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 50 51 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 52 static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 51 53 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 52 54 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r95936 r97015 148 148 bool StringPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 149 149 { 150 return getStaticFunctionSlot<StringObject>(exec, ExecState::stringTable(exec), this, propertyName, slot); 150 return getOwnPropertySlot(this, exec, propertyName, slot); 151 } 152 153 bool StringPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 154 { 155 return getStaticFunctionSlot<StringObject>(exec, ExecState::stringTable(exec), static_cast<StringPrototype*>(cell), propertyName, slot); 151 156 } 152 157 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.h
r95108 r97015 44 44 45 45 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 46 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 46 47 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 47 48 -
trunk/Source/JavaScriptGlue/ChangeLog
r97006 r97015 1 2011-10-08 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static version of JSCell::getOwnPropertySlot 4 https://bugs.webkit.org/show_bug.cgi?id=69593 5 6 Reviewed by Geoffrey Garen. 7 8 Added static version of getOwnPropertySlot to every class that overrides 9 JSCell::getOwnPropertySlot. The virtual versions now call the static versions. 10 This is the first step in de-virtualizing JSCell::getOwnPropertySlot. 11 12 * UserObjectImp.cpp: 13 (UserObjectImp::getOwnPropertySlot): 14 * UserObjectImp.h: 15 1 16 2011-10-08 Sheriff Bot <webkit.review.bot@gmail.com> 2 17 -
trunk/Source/JavaScriptGlue/UserObjectImp.cpp
r97006 r97015 131 131 bool UserObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) 132 132 { 133 if (!fJSUserObject) 133 return getOwnPropertySlot(this, exec, propertyName, slot); 134 } 135 136 bool UserObjectImp::getOwnPropertySlot(JSCell* cell, ExecState *exec, const Identifier& propertyName, PropertySlot& slot) 137 { 138 UserObjectImp* thisObject = static_cast<UserObjectImp*>(cell); 139 if (!thisObject->fJSUserObject) 134 140 return false; 135 141 136 142 CFStringRef cfPropName = IdentifierToCFString(propertyName); 137 JSUserObject *jsResult =fJSUserObject->CopyProperty(cfPropName);143 JSUserObject* jsResult = thisObject->fJSUserObject->CopyProperty(cfPropName); 138 144 ReleaseCFType(cfPropName); 139 145 if (jsResult) { 140 slot.setCustom(this , userObjectGetter);146 slot.setCustom(thisObject, userObjectGetter); 141 147 jsResult->Release(); 142 148 return true; 143 149 } else { 144 JSValue kjsValue = t oPrimitive(exec);150 JSValue kjsValue = thisObject->toPrimitive(exec); 145 151 if (!kjsValue.isUndefinedOrNull()) { 146 152 JSObject* kjsObject = kjsValue.toObject(exec); … … 149 155 } 150 156 } 151 return JSObject::getOwnPropertySlot( exec, propertyName, slot);157 return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot); 152 158 } 153 159 -
trunk/Source/JavaScriptGlue/UserObjectImp.h
r97006 r97015 57 57 virtual JSValue callAsFunction(ExecState *exec); 58 58 virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&); 59 static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&); 59 60 virtual void put(ExecState *exec, const Identifier &propertyName, JSValue value, PutPropertySlot&); 60 61 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/WebCore/ChangeLog
r97012 r97015 1 2011-10-08 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static version of JSCell::getOwnPropertySlot 4 https://bugs.webkit.org/show_bug.cgi?id=69593 5 6 Reviewed by Geoffrey Garen. 7 8 No new tests. 9 10 Added static version of getOwnPropertySlot to every class that overrides 11 JSCell::getOwnPropertySlot. The virtual versions now call the static versions. 12 This is the first step in de-virtualizing JSCell::getOwnPropertySlot. 13 14 * bindings/js/JSDOMWindowShell.cpp: 15 (WebCore::JSDOMWindowShell::getOwnPropertySlot): 16 * bindings/js/JSDOMWindowShell.h: 17 * bridge/objc/objc_runtime.h: 18 * bridge/objc/objc_runtime.mm: 19 (JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertySlot): 20 * bridge/qt/qt_runtime.cpp: 21 (JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot): 22 (JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot): 23 * bridge/qt/qt_runtime.h: 24 * bridge/runtime_array.cpp: 25 (JSC::RuntimeArray::getOwnPropertySlot): 26 * bridge/runtime_array.h: 27 * bridge/runtime_method.cpp: 28 (JSC::RuntimeMethod::getOwnPropertySlot): 29 * bridge/runtime_method.h: 30 * bridge/runtime_object.cpp: 31 (JSC::Bindings::RuntimeObject::getOwnPropertySlot): 32 * bridge/runtime_object.h: 33 1 34 2011-10-03 Carlos Garcia Campos <cgarcia@igalia.com> and Martin Robinson <mrobinson@igalia.com> 2 35 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
r96465 r97015 103 103 bool JSDOMWindowShell::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 104 104 { 105 return m_window->getOwnPropertySlot(exec, propertyName, slot); 105 return getOwnPropertySlot(this, exec, propertyName, slot); 106 } 107 108 bool JSDOMWindowShell::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 109 { 110 return static_cast<JSDOMWindowShell*>(cell)->m_window->getOwnPropertySlot(exec, propertyName, slot); 106 111 } 107 112 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h
r96836 r97015 82 82 virtual JSC::UString className() const; 83 83 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 84 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 84 85 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); 85 86 virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&); -
trunk/Source/WebCore/bridge/objc/objc_runtime.h
r97006 r97015 125 125 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags; 126 126 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 127 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 127 128 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 128 129 virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/WebCore/bridge/objc/objc_runtime.mm
r97006 r97015 206 206 } 207 207 208 bool ObjcFallbackObjectImp::getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot& slot) 208 bool ObjcFallbackObjectImp::getOwnPropertySlot(ExecState* exec, const Identifier& identifier, PropertySlot& slot) 209 { 210 return getOwnPropertySlot(this, exec, identifier, slot); 211 } 212 213 bool ObjcFallbackObjectImp::getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot& slot) 209 214 { 210 215 // keep the prototype from getting called instead of just returning false -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r97006 r97015 1502 1502 bool QtRuntimeMetaMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 1503 1503 { 1504 return getOwnPropertySlot(this, exec, propertyName, slot); 1505 } 1506 1507 bool QtRuntimeMetaMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 1508 { 1509 QtRuntimeMetaMethod* thisObject = static_cast<QtRuntimeMetaMethod*>(cell); 1504 1510 if (propertyName == "connect") { 1505 slot.setCustom(this ,connectGetter);1511 slot.setCustom(thisObject, thisObject->connectGetter); 1506 1512 return true; 1507 1513 } else if (propertyName == "disconnect") { 1508 slot.setCustom(this ,disconnectGetter);1514 slot.setCustom(thisObject, thisObject->disconnectGetter); 1509 1515 return true; 1510 1516 } else if (propertyName == exec->propertyNames().length) { 1511 slot.setCustom(this ,lengthGetter);1517 slot.setCustom(thisObject, thisObject->lengthGetter); 1512 1518 return true; 1513 1519 } 1514 1520 1515 return QtRuntimeMethod::getOwnPropertySlot( exec, propertyName, slot);1521 return QtRuntimeMethod::getOwnPropertySlot(thisObject, exec, propertyName, slot); 1516 1522 } 1517 1523 … … 1748 1754 bool QtRuntimeConnectionMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 1749 1755 { 1756 return getOwnPropertySlot(this, exec, propertyName, slot); 1757 } 1758 1759 bool QtRuntimeConnectionMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 1760 { 1761 QtRuntimeConnectionMethod* thisObject = static_cast<QtRuntimeConnectionMethod*>(cell); 1750 1762 if (propertyName == exec->propertyNames().length) { 1751 slot.setCustom(this ,lengthGetter);1763 slot.setCustom(thisObject, thisObject->lengthGetter); 1752 1764 return true; 1753 1765 } 1754 1766 1755 return QtRuntimeMethod::getOwnPropertySlot( exec, propertyName, slot);1767 return QtRuntimeMethod::getOwnPropertySlot(thisObject, exec, propertyName, slot); 1756 1768 } 1757 1769 -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r97006 r97015 166 166 167 167 virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&); 168 static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&); 168 169 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 169 170 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); … … 202 203 203 204 virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&); 205 static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&); 204 206 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 205 207 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); -
trunk/Source/WebCore/bridge/runtime_array.cpp
r97002 r97015 81 81 bool RuntimeArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 82 82 { 83 return getOwnPropertySlot(this, exec, propertyName, slot); 84 } 85 86 bool RuntimeArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 87 { 88 RuntimeArray* thisObject = static_cast<RuntimeArray*>(cell); 83 89 if (propertyName == exec->propertyNames().length) { 84 slot.setCacheableCustom(this ,lengthGetter);90 slot.setCacheableCustom(thisObject, thisObject->lengthGetter); 85 91 return true; 86 92 } … … 89 95 unsigned index = propertyName.toArrayIndex(ok); 90 96 if (ok) { 91 if (index < getLength()) {92 slot.setCustomIndex(this , index,indexGetter);97 if (index < thisObject->getLength()) { 98 slot.setCustomIndex(thisObject, index, thisObject->indexGetter); 93 99 return true; 94 100 } 95 101 } 96 102 97 return JSObject::getOwnPropertySlot( exec, propertyName, slot);103 return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot); 98 104 } 99 105 … … 123 129 bool RuntimeArray::getOwnPropertySlot(ExecState *exec, unsigned index, PropertySlot& slot) 124 130 { 125 if (index < getLength()) { 126 slot.setCustomIndex(this, index, indexGetter); 131 return getOwnPropertySlot(this, exec, index, slot); 132 } 133 134 bool RuntimeArray::getOwnPropertySlot(JSCell* cell, ExecState *exec, unsigned index, PropertySlot& slot) 135 { 136 RuntimeArray* thisObject = static_cast<RuntimeArray*>(cell); 137 if (index < thisObject->getLength()) { 138 slot.setCustomIndex(thisObject, index, thisObject->indexGetter); 127 139 return true; 128 140 } 129 141 130 return JSObject::getOwnPropertySlot( exec, index, slot);142 return JSObject::getOwnPropertySlot(thisObject, exec, index, slot); 131 143 } 132 144 -
trunk/Source/WebCore/bridge/runtime_array.h
r97002 r97015 52 52 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 53 53 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 54 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 54 55 virtual bool getOwnPropertySlot(ExecState*, unsigned, PropertySlot&); 56 static bool getOwnPropertySlot(JSCell*, ExecState*, unsigned, PropertySlot&); 55 57 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 56 58 virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/WebCore/bridge/runtime_method.cpp
r97006 r97015 72 72 bool RuntimeMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 73 73 { 74 return getOwnPropertySlot(this, exec, propertyName, slot); 75 } 76 77 bool RuntimeMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 78 { 79 RuntimeMethod* thisObject = static_cast<RuntimeMethod*>(cell); 74 80 if (propertyName == exec->propertyNames().length) { 75 slot.setCacheableCustom(this ,lengthGetter);81 slot.setCacheableCustom(thisObject, thisObject->lengthGetter); 76 82 return true; 77 83 } 78 84 79 return InternalFunction::getOwnPropertySlot( exec, propertyName, slot);85 return InternalFunction::getOwnPropertySlot(thisObject, exec, propertyName, slot); 80 86 } 81 87 -
trunk/Source/WebCore/bridge/runtime_method.h
r97006 r97015 69 69 static JSValue lengthGetter(ExecState*, JSValue, const Identifier&); 70 70 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 71 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 71 72 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 72 73 -
trunk/Source/WebCore/bridge/runtime_object.cpp
r97006 r97015 119 119 bool RuntimeObject::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) 120 120 { 121 if (!m_instance) { 121 return getOwnPropertySlot(this, exec, propertyName, slot); 122 } 123 124 bool RuntimeObject::getOwnPropertySlot(JSCell* cell, ExecState *exec, const Identifier& propertyName, PropertySlot& slot) 125 { 126 RuntimeObject* thisObject = static_cast<RuntimeObject*>(cell); 127 if (!thisObject->m_instance) { 122 128 throwInvalidAccessError(exec); 123 129 return false; 124 130 } 125 131 126 RefPtr<Instance> instance = m_instance;132 RefPtr<Instance> instance = thisObject->m_instance; 127 133 128 134 instance->begin(); … … 134 140 Field *aField = aClass->fieldNamed(propertyName, instance.get()); 135 141 if (aField) { 136 slot.setCustom(this ,fieldGetter);142 slot.setCustom(thisObject, thisObject->fieldGetter); 137 143 instance->end(); 138 144 return true; … … 142 148 MethodList methodList = aClass->methodsNamed(propertyName, instance.get()); 143 149 if (methodList.size() > 0) { 144 slot.setCustom(this ,methodGetter);150 slot.setCustom(thisObject, thisObject->methodGetter); 145 151 146 152 instance->end(); … … 151 157 // Try a fallback object. 152 158 if (!aClass->fallbackObject(exec, instance.get(), propertyName).isUndefined()) { 153 slot.setCustom(this ,fallbackObjectGetter);159 slot.setCustom(thisObject, thisObject->fallbackObjectGetter); 154 160 instance->end(); 155 161 return true; … … 159 165 instance->end(); 160 166 161 return instance->getOwnPropertySlot(this , exec, propertyName, slot);167 return instance->getOwnPropertySlot(thisObject, exec, propertyName, slot); 162 168 } 163 169 -
trunk/Source/WebCore/bridge/runtime_object.h
r97006 r97015 47 47 48 48 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 49 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 49 50 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier& propertyName, PropertyDescriptor&); 50 51 virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/WebKit2/ChangeLog
r97012 r97015 1 2011-10-08 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static version of JSCell::getOwnPropertySlot 4 https://bugs.webkit.org/show_bug.cgi?id=69593 5 6 Reviewed by Geoffrey Garen. 7 8 Added static version of getOwnPropertySlot to every class that overrides 9 JSCell::getOwnPropertySlot. The virtual versions now call the static versions. 10 This is the first step in de-virtualizing JSCell::getOwnPropertySlot. 11 12 * WebProcess/Plugins/Netscape/JSNPObject.cpp: 13 (WebKit::JSNPObject::getOwnPropertySlot): 14 * WebProcess/Plugins/Netscape/JSNPObject.h: 15 1 16 2011-10-03 Carlos Garcia Campos <cgarcia@igalia.com> and Martin Robinson <mrobinson@igalia.com> 2 17 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
r97006 r97015 254 254 bool JSNPObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 255 255 { 256 ASSERT_GC_OBJECT_INHERITS(this, &s_info); 257 if (!m_npObject) { 256 return getOwnPropertySlot(this, exec, propertyName, slot); 257 } 258 259 bool JSNPObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 260 { 261 JSNPObject* thisObject = static_cast<JSNPObject*>(cell); 262 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); 263 if (!thisObject->m_npObject) { 258 264 throwInvalidAccessError(exec); 259 265 return false; … … 263 269 264 270 // First, check if the NPObject has a property with this name. 265 if ( m_npObject->_class->hasProperty && m_npObject->_class->hasProperty(m_npObject, npIdentifier)) {266 slot.setCustom(this ,propertyGetter);271 if (thisObject->m_npObject->_class->hasProperty && thisObject->m_npObject->_class->hasProperty(thisObject->m_npObject, npIdentifier)) { 272 slot.setCustom(thisObject, thisObject->propertyGetter); 267 273 return true; 268 274 } 269 275 270 276 // Second, check if the NPObject has a method with this name. 271 if ( m_npObject->_class->hasMethod && m_npObject->_class->hasMethod(m_npObject, npIdentifier)) {272 slot.setCustom(this ,methodGetter);277 if (thisObject->m_npObject->_class->hasMethod && thisObject->m_npObject->_class->hasMethod(thisObject->m_npObject, npIdentifier)) { 278 slot.setCustom(thisObject, thisObject->methodGetter); 273 279 return true; 274 280 } -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
r97006 r97015 85 85 86 86 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 87 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 87 88 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); 88 89 virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
Note: See TracChangeset
for help on using the changeset viewer.