Changeset 99754 in webkit
- Timestamp:
- Nov 9, 2011 1:09:37 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 92 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r99312 r99754 179 179 180 180 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 181 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);181 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 182 182 183 183 static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r99312 r99754 185 185 186 186 template <class Parent> 187 bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 188 { 187 bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 188 { 189 JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(object); 189 190 PropertySlot slot; 190 if ( methodTable()->getOwnPropertySlot(this, exec, propertyName, slot)) {191 if (thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot)) { 191 192 // Ideally we should return an access descriptor, but returning a value descriptor is better than nothing. 192 193 JSValue value = slot.getValue(exec, propertyName); … … 200 201 } 201 202 202 return Parent::getOwnPropertyDescriptor( exec, propertyName, descriptor);203 return Parent::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 203 204 } 204 205 -
trunk/Source/JavaScriptCore/ChangeLog
r99745 r99754 1 2011-11-09 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 De-virtualize JSObject::getOwnPropertyDescriptor 4 https://bugs.webkit.org/show_bug.cgi?id=71523 5 6 Reviewed by Sam Weinig. 7 8 Added getOwnPropertyDescriptor to the MethodTable, changed all of the 9 virtual versions of getOwnPropertyDescriptor to static ones, and 10 changed all of the call sites to the corresponding lookup in the MethodTable. 11 12 * API/JSCallbackObject.h: 13 * API/JSCallbackObjectFunctions.h: 14 (JSC::::getOwnPropertyDescriptor): 15 * JavaScriptCore.exp: 16 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 17 * debugger/DebuggerActivation.cpp: 18 (JSC::DebuggerActivation::getOwnPropertyDescriptor): 19 * debugger/DebuggerActivation.h: 20 * runtime/Arguments.cpp: 21 (JSC::Arguments::getOwnPropertyDescriptor): 22 * runtime/Arguments.h: 23 * runtime/ArrayConstructor.cpp: 24 (JSC::ArrayConstructor::getOwnPropertyDescriptor): 25 * runtime/ArrayConstructor.h: 26 * runtime/ArrayPrototype.cpp: 27 (JSC::ArrayPrototype::getOwnPropertyDescriptor): 28 * runtime/ArrayPrototype.h: 29 * runtime/BooleanPrototype.cpp: 30 (JSC::BooleanPrototype::getOwnPropertyDescriptor): 31 * runtime/BooleanPrototype.h: 32 * runtime/ClassInfo.h: 33 * runtime/DateConstructor.cpp: 34 (JSC::DateConstructor::getOwnPropertyDescriptor): 35 * runtime/DateConstructor.h: 36 * runtime/DatePrototype.cpp: 37 (JSC::DatePrototype::getOwnPropertyDescriptor): 38 * runtime/DatePrototype.h: 39 * runtime/ErrorPrototype.cpp: 40 (JSC::ErrorPrototype::getOwnPropertyDescriptor): 41 * runtime/ErrorPrototype.h: 42 * runtime/JSArray.cpp: 43 (JSC::JSArray::getOwnPropertyDescriptor): 44 * runtime/JSArray.h: 45 * runtime/JSByteArray.cpp: 46 (JSC::JSByteArray::getOwnPropertyDescriptor): 47 * runtime/JSByteArray.h: 48 * runtime/JSCell.cpp: 49 (JSC::JSCell::getOwnPropertyDescriptor): 50 * runtime/JSCell.h: 51 * runtime/JSFunction.cpp: 52 (JSC::JSFunction::getOwnPropertyDescriptor): 53 * runtime/JSFunction.h: 54 * runtime/JSGlobalObject.cpp: 55 (JSC::JSGlobalObject::getOwnPropertyDescriptor): 56 * runtime/JSGlobalObject.h: 57 * runtime/JSNotAnObject.cpp: 58 (JSC::JSNotAnObject::getOwnPropertyDescriptor): 59 * runtime/JSNotAnObject.h: 60 * runtime/JSONObject.cpp: 61 (JSC::JSONObject::getOwnPropertyDescriptor): 62 * runtime/JSONObject.h: 63 * runtime/JSObject.cpp: 64 (JSC::JSObject::vtableAnchor): 65 (JSC::JSObject::propertyIsEnumerable): 66 (JSC::JSObject::getOwnPropertyDescriptor): 67 (JSC::JSObject::getPropertyDescriptor): 68 (JSC::JSObject::defineOwnProperty): 69 * runtime/JSObject.h: 70 * runtime/JSString.cpp: Removed getOwnPropertyDescriptor, since this seems to be a relic from a 71 bygone era when getOwnPropertyDescriptor was rooted in JSCell rather than JSObject. There were 72 no call sites for this version of getOwnPropertyDescriptor in the entire project. 73 * runtime/JSString.h: 74 * runtime/Lookup.h: 75 (JSC::getStaticPropertyDescriptor): 76 (JSC::getStaticFunctionDescriptor): 77 (JSC::getStaticValueDescriptor): 78 * runtime/MathObject.cpp: 79 (JSC::MathObject::getOwnPropertyDescriptor): 80 * runtime/MathObject.h: 81 * runtime/NumberConstructor.cpp: 82 (JSC::NumberConstructor::getOwnPropertyDescriptor): 83 * runtime/NumberConstructor.h: 84 * runtime/NumberPrototype.cpp: 85 (JSC::NumberPrototype::getOwnPropertyDescriptor): 86 * runtime/NumberPrototype.h: 87 * runtime/ObjectConstructor.cpp: 88 (JSC::ObjectConstructor::getOwnPropertyDescriptor): 89 (JSC::objectConstructorGetOwnPropertyDescriptor): 90 * runtime/ObjectConstructor.h: 91 * runtime/ObjectPrototype.cpp: 92 (JSC::ObjectPrototype::getOwnPropertyDescriptor): 93 * runtime/ObjectPrototype.h: 94 * runtime/RegExpConstructor.cpp: 95 (JSC::RegExpConstructor::getOwnPropertyDescriptor): 96 * runtime/RegExpConstructor.h: 97 * runtime/RegExpMatchesArray.h: 98 (JSC::RegExpMatchesArray::getOwnPropertyDescriptor): 99 * runtime/RegExpObject.cpp: 100 (JSC::RegExpObject::getOwnPropertyDescriptor): 101 * runtime/RegExpObject.h: 102 * runtime/RegExpPrototype.cpp: 103 (JSC::RegExpPrototype::getOwnPropertyDescriptor): 104 * runtime/RegExpPrototype.h: 105 * runtime/StringConstructor.cpp: 106 (JSC::StringConstructor::getOwnPropertyDescriptor): 107 * runtime/StringConstructor.h: 108 * runtime/StringObject.cpp: 109 (JSC::StringObject::vtableAnchor): Added to prevent a weak vtable. 110 (JSC::StringObject::getOwnPropertyDescriptor): 111 * runtime/StringObject.h: 112 * runtime/StringPrototype.cpp: 113 (JSC::StringPrototype::getOwnPropertyDescriptor): 114 * runtime/StringPrototype.h: 115 1 116 2011-11-09 Gavin Barraclough <barraclough@apple.com> 2 117 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r99675 r99754 122 122 __ZN3JSC11JSByteArray18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 123 123 __ZN3JSC11JSByteArray19getOwnPropertyNamesEPNS_8JSObjectEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE 124 __ZN3JSC11JSByteArray24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 124 125 __ZN3JSC11JSByteArray25getOwnPropertySlotByIndexEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE 125 126 __ZN3JSC11JSByteArray3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE … … 157 158 __ZN3JSC12SmallStrings27createSingleCharacterStringEPNS_12JSGlobalDataEh 158 159 __ZN3JSC12StringObject14finishCreationERNS_12JSGlobalDataEPNS_8JSStringE 159 __ZN3JSC12StringObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE160 160 __ZN3JSC12StringObject6s_infoE 161 161 __ZN3JSC12StringObjectC2ERNS_12JSGlobalDataEPNS_9StructureE … … 173 173 __ZN3JSC14JSGlobalObject17putWithAttributesEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj 174 174 __ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 175 __ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_ 9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE175 __ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 176 176 __ZN3JSC14JSGlobalObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE 177 177 __ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE … … 312 312 __ZN3JSC8JSObject12lookupSetterEPNS_9ExecStateERKNS_10IdentifierE 313 313 __ZN3JSC8JSObject12toThisObjectEPNS_6JSCellEPNS_9ExecStateE 314 __ZN3JSC8JSObject12vtableAnchorEv 314 315 __ZN3JSC8JSObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE 315 316 __ZN3JSC8JSObject14deletePropertyEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierE … … 324 325 __ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE 325 326 __ZN3JSC8JSObject23allocatePropertyStorageERNS_12JSGlobalDataEmm 326 __ZN3JSC8JSObject24getOwnPropertyDescriptorEP NS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE327 __ZN3JSC8JSObject24getOwnPropertyDescriptorEPS0_PNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 327 328 __ZN3JSC8JSObject25getOwnPropertySlotByIndexEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE 328 329 __ZN3JSC8JSObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r99675 r99754 191 191 ?getConstructData@JSCell@JSC@@SA?AW4ConstructType@2@PAV12@AATConstructData@2@@Z 192 192 ?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ 193 ?getOwnPropertyDescriptor@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 194 ?getOwnPropertyDescriptor@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 195 ?getOwnPropertyDescriptor@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 196 ?getOwnPropertyDescriptor@StringObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 193 ?getOwnPropertyDescriptor@JSByteArray@JSC@@SA_NPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 194 ?getOwnPropertyDescriptor@JSGlobalObject@JSC@@SA_NPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 195 ?getOwnPropertyDescriptor@JSObject@JSC@@SA_NPAV12@PAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 197 196 ?getOwnPropertyNames@JSByteArray@JSC@@SAXPAVJSObject@2@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z 198 197 ?getOwnPropertyNames@JSObject@JSC@@SAXPAV12@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z … … 353 352 ?visitChildren@JSObject@JSC@@SAXPAVJSCell@2@AAVSlotVisitor@2@@Z 354 353 ?vtableAnchor@InternalFunction@JSC@@EAEXXZ 354 ?vtableAnchor@JSObject@JSC@@UAEXXZ 355 355 ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z 356 356 ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
r99497 r99754 92 92 } 93 93 94 bool DebuggerActivation::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)94 bool DebuggerActivation::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 95 95 { 96 return m_activation->getOwnPropertyDescriptor(exec, propertyName, descriptor); 96 DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(object); 97 return thisObject->m_activation->methodTable()->getOwnPropertyDescriptor(thisObject->m_activation.get(), exec, propertyName, descriptor); 97 98 } 98 99 -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h
r99497 r99754 49 49 static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName); 50 50 static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 51 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);51 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 52 52 static void defineGetter(JSObject*, ExecState*, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes); 53 53 static void defineSetter(JSObject*, ExecState*, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes); -
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r99675 r99754 216 216 } 217 217 218 bool Arguments::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 219 { 218 bool Arguments::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 219 { 220 Arguments* thisObject = static_cast<Arguments*>(object); 220 221 bool isArrayIndex; 221 222 unsigned i = propertyName.toArrayIndex(isArrayIndex); 222 if (isArrayIndex && i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) {223 if (i < d->numParameters) {224 descriptor.setDescriptor( d->registers[d->firstParameterIndex + i].get(), None);223 if (isArrayIndex && i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) { 224 if (i < thisObject->d->numParameters) { 225 descriptor.setDescriptor(thisObject->d->registers[thisObject->d->firstParameterIndex + i].get(), None); 225 226 } else 226 descriptor.setDescriptor( d->extraArguments[i -d->numParameters].get(), None);227 return true; 228 } 229 230 if (propertyName == exec->propertyNames().length && LIKELY(! d->overrodeLength)) {231 descriptor.setDescriptor(jsNumber( d->numArguments), DontEnum);232 return true; 233 } 234 235 if (propertyName == exec->propertyNames().callee && LIKELY(! d->overrodeCallee)) {236 if (! d->isStrictMode) {237 descriptor.setDescriptor( d->callee.get(), DontEnum);238 return true; 239 } 240 createStrictModeCalleeIfNecessary(exec);241 } 242 243 if (propertyName == exec->propertyNames().caller && d->isStrictMode)244 createStrictModeCallerIfNecessary(exec);245 246 return JSObject::getOwnPropertyDescriptor( exec, propertyName, descriptor);227 descriptor.setDescriptor(thisObject->d->extraArguments[i - thisObject->d->numParameters].get(), None); 228 return true; 229 } 230 231 if (propertyName == exec->propertyNames().length && LIKELY(!thisObject->d->overrodeLength)) { 232 descriptor.setDescriptor(jsNumber(thisObject->d->numArguments), DontEnum); 233 return true; 234 } 235 236 if (propertyName == exec->propertyNames().callee && LIKELY(!thisObject->d->overrodeCallee)) { 237 if (!thisObject->d->isStrictMode) { 238 descriptor.setDescriptor(thisObject->d->callee.get(), DontEnum); 239 return true; 240 } 241 thisObject->createStrictModeCalleeIfNecessary(exec); 242 } 243 244 if (propertyName == exec->propertyNames().caller && thisObject->d->isStrictMode) 245 thisObject->createStrictModeCallerIfNecessary(exec); 246 247 return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 247 248 } 248 249 -
trunk/Source/JavaScriptCore/runtime/Arguments.h
r99148 r99754 138 138 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 139 139 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 140 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);140 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 141 141 static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 142 142 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r98501 r99754 69 69 } 70 70 71 bool ArrayConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)71 bool ArrayConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 72 72 { 73 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), this, propertyName, descriptor);73 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), static_cast<ArrayConstructor*>(object), propertyName, descriptor); 74 74 } 75 75 -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r98501 r99754 54 54 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 55 55 56 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);56 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 57 57 58 58 static ConstructType getConstructData(JSCell*, ConstructData&); -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r98501 r99754 131 131 } 132 132 133 bool ArrayPrototype::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)134 { 135 return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), this, propertyName, descriptor);133 bool ArrayPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 134 { 135 return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), static_cast<ArrayPrototype*>(object), propertyName, descriptor); 136 136 } 137 137 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h
r98501 r99754 42 42 43 43 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 44 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);44 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 45 45 46 46 static const ClassInfo s_info; -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r98501 r99754 68 68 } 69 69 70 bool BooleanPrototype::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)70 bool BooleanPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 71 71 { 72 return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, descriptor);72 return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), static_cast<BooleanPrototype*>(object), propertyName, descriptor); 73 73 } 74 74 -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h
r98501 r99754 52 52 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 53 53 54 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);54 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 55 55 }; 56 56 -
trunk/Source/JavaScriptCore/runtime/ClassInfo.h
r99675 r99754 90 90 typedef bool (*DefineOwnPropertyFunctionPtr)(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&, bool); 91 91 DefineOwnPropertyFunctionPtr defineOwnProperty; 92 93 typedef bool (*GetOwnPropertyDescriptorFunctionPtr)(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 94 GetOwnPropertyDescriptorFunctionPtr getOwnPropertyDescriptor; 92 95 }; 93 96 … … 131 134 &ClassName::putWithAttributes, \ 132 135 &ClassName::defineOwnProperty, \ 136 &ClassName::getOwnPropertyDescriptor, \ 133 137 }, \ 134 138 sizeof(ClassName) -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r98501 r99754 91 91 } 92 92 93 bool DateConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)94 { 95 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::dateConstructorTable(exec), this, propertyName, descriptor);93 bool DateConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 94 { 95 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::dateConstructorTable(exec), static_cast<DateConstructor*>(object), propertyName, descriptor); 96 96 } 97 97 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r98501 r99754 57 57 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 58 58 59 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);59 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 60 60 }; 61 61 -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r98501 r99754 449 449 } 450 450 451 bool DatePrototype::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)452 { 453 return getStaticFunctionDescriptor<JSObject>(exec, ExecState::dateTable(exec), this, propertyName, descriptor);451 bool DatePrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 452 { 453 return getStaticFunctionDescriptor<JSObject>(exec, ExecState::dateTable(exec), static_cast<DatePrototype*>(object), propertyName, descriptor); 454 454 } 455 455 -
trunk/Source/JavaScriptCore/runtime/DatePrototype.h
r98501 r99754 43 43 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 44 44 45 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);45 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 46 46 47 47 static const ClassInfo s_info; -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
r98501 r99754 68 68 } 69 69 70 bool ErrorPrototype::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)70 bool ErrorPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 71 71 { 72 return getStaticFunctionDescriptor<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), this, propertyName, descriptor);72 return getStaticFunctionDescriptor<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), static_cast<ErrorPrototype*>(object), propertyName, descriptor); 73 73 } 74 74 -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h
r98747 r99754 54 54 private: 55 55 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 56 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);56 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 57 57 }; 58 58 -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r99126 r99754 292 292 } 293 293 294 bool JSArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 295 { 294 bool JSArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 295 { 296 JSArray* thisObject = static_cast<JSArray*>(object); 296 297 if (propertyName == exec->propertyNames().length) { 297 descriptor.setDescriptor(jsNumber( length()), DontDelete | DontEnum);298 descriptor.setDescriptor(jsNumber(thisObject->length()), DontDelete | DontEnum); 298 299 return true; 299 300 } 300 301 301 ArrayStorage* storage = m_storage;302 ArrayStorage* storage = thisObject->m_storage; 302 303 303 304 bool isArrayIndex; … … 306 307 if (i >= storage->m_length) 307 308 return false; 308 if (i < m_vectorLength) {309 if (i < thisObject->m_vectorLength) { 309 310 WriteBarrier<Unknown>& value = storage->m_vector[i]; 310 311 if (value) { … … 322 323 } 323 324 } 324 return JSObject::getOwnPropertyDescriptor( exec, propertyName, descriptor);325 return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 325 326 } 326 327 -
trunk/Source/JavaScriptCore/runtime/JSArray.h
r99126 r99754 97 97 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 98 98 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 99 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);99 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 100 100 static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue); 101 101 -
trunk/Source/JavaScriptCore/runtime/JSByteArray.cpp
r99126 r99754 67 67 } 68 68 69 bool JSByteArray::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)69 bool JSByteArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 70 70 { 71 JSByteArray* thisObject = static_cast<JSByteArray*>(object); 71 72 bool ok; 72 73 unsigned index = propertyName.toUInt32(ok); 73 if (ok && canAccessIndex(index)) {74 descriptor.setDescriptor( getIndex(exec, index), DontDelete);74 if (ok && thisObject->canAccessIndex(index)) { 75 descriptor.setDescriptor(thisObject->getIndex(exec, index), DontDelete); 75 76 return true; 76 77 } 77 return JSObject::getOwnPropertyDescriptor( exec, propertyName, descriptor);78 return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 78 79 } 79 80 -
trunk/Source/JavaScriptCore/runtime/JSByteArray.h
r99126 r99754 91 91 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 92 92 static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&); 93 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);93 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 94 94 static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&); 95 95 static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue); -
trunk/Source/JavaScriptCore/runtime/JSCell.cpp
r99675 r99754 208 208 } 209 209 210 bool JSCell::getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&) 211 { 212 ASSERT_NOT_REACHED(); 213 return false; 214 } 215 210 216 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r99675 r99754 151 151 static NO_RETURN_DUE_TO_ASSERT void putWithAttributes(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes); 152 152 static bool defineOwnProperty(JSObject*, ExecState*, const Identifier& propertyName, PropertyDescriptor&, bool shouldThrow); 153 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 153 154 154 155 private: -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r99126 r99754 252 252 } 253 253 254 bool JSFunction::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 255 { 256 if (isHostFunction()) 257 return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor); 254 bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 255 { 256 JSFunction* thisObject = static_cast<JSFunction*>(object); 257 if (thisObject->isHostFunction()) 258 return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 258 259 259 260 if (propertyName == exec->propertyNames().prototype) { 260 261 PropertySlot slot; 261 methodTable()->getOwnPropertySlot(this, exec, propertyName, slot);262 return Base::getOwnPropertyDescriptor( exec, propertyName, descriptor);262 thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot); 263 return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 263 264 } 264 265 265 266 if (propertyName == exec->propertyNames().arguments) { 266 if ( jsExecutable()->isStrictMode()) {267 bool result = Base::getOwnPropertyDescriptor( exec, propertyName, descriptor);267 if (thisObject->jsExecutable()->isStrictMode()) { 268 bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 268 269 if (!result) { 269 initializeGetterSetterProperty(exec, propertyName,globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);270 result = Base::getOwnPropertyDescriptor( exec, propertyName, descriptor);270 thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter); 271 result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 271 272 ASSERT(result); 272 273 } 273 274 return result; 274 275 } 275 descriptor.setDescriptor(exec->interpreter()->retrieveArguments(exec, this ), ReadOnly | DontEnum | DontDelete);276 descriptor.setDescriptor(exec->interpreter()->retrieveArguments(exec, thisObject), ReadOnly | DontEnum | DontDelete); 276 277 return true; 277 278 } 278 279 279 280 if (propertyName == exec->propertyNames().length) { 280 descriptor.setDescriptor(jsNumber( jsExecutable()->parameterCount()), ReadOnly | DontEnum | DontDelete);281 descriptor.setDescriptor(jsNumber(thisObject->jsExecutable()->parameterCount()), ReadOnly | DontEnum | DontDelete); 281 282 return true; 282 283 } 283 284 284 285 if (propertyName == exec->propertyNames().caller) { 285 if ( jsExecutable()->isStrictMode()) {286 bool result = Base::getOwnPropertyDescriptor( exec, propertyName, descriptor);286 if (thisObject->jsExecutable()->isStrictMode()) { 287 bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 287 288 if (!result) { 288 initializeGetterSetterProperty(exec, propertyName,globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);289 result = Base::getOwnPropertyDescriptor( exec, propertyName, descriptor);289 thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter); 290 result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 290 291 ASSERT(result); 291 292 } 292 293 return result; 293 294 } 294 descriptor.setDescriptor(exec->interpreter()->retrieveCaller(exec, this ), ReadOnly | DontEnum | DontDelete);295 return true; 296 } 297 298 return Base::getOwnPropertyDescriptor( exec, propertyName, descriptor);295 descriptor.setDescriptor(exec->interpreter()->retrieveCaller(exec, thisObject), ReadOnly | DontEnum | DontDelete); 296 return true; 297 } 298 299 return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 299 300 } 300 301 -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r99126 r99754 131 131 132 132 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 133 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);133 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 134 134 static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties); 135 135 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r99497 r99754 441 441 } 442 442 443 bool JSGlobalObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 444 { 445 if (getStaticFunctionDescriptor<JSVariableObject>(exec, ExecState::globalObjectTable(exec), this, propertyName, descriptor)) 443 bool JSGlobalObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 444 { 445 JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(object); 446 if (getStaticFunctionDescriptor<JSVariableObject>(exec, ExecState::globalObjectTable(exec), thisObject, propertyName, descriptor)) 446 447 return true; 447 return symbolTableGet(propertyName, descriptor);448 return thisObject->symbolTableGet(propertyName, descriptor); 448 449 } 449 450 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r99497 r99754 184 184 185 185 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 186 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);186 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 187 187 virtual bool hasOwnPropertyForWrite(ExecState*, const Identifier&); 188 188 static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/JSNotAnObject.cpp
r99126 r99754 59 59 } 60 60 61 bool JSNotAnObject::getOwnPropertyDescriptor( ExecState* exec, const Identifier&, PropertyDescriptor&)61 bool JSNotAnObject::getOwnPropertyDescriptor(JSObject*, ExecState* exec, const Identifier&, PropertyDescriptor&) 62 62 { 63 63 ASSERT_UNUSED(exec, exec->hadException()); -
trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h
r99126 r99754 71 71 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 72 72 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 73 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);73 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 74 74 75 75 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/JSONObject.cpp
r99126 r99754 604 604 } 605 605 606 bool JSONObject::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)607 { 608 return getStaticFunctionDescriptor<JSObject>(exec, ExecState::jsonTable(exec), this, propertyName, descriptor);606 bool JSONObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 607 { 608 return getStaticFunctionDescriptor<JSObject>(exec, ExecState::jsonTable(exec), static_cast<JSONObject*>(object), propertyName, descriptor); 609 609 } 610 610 -
trunk/Source/JavaScriptCore/runtime/JSONObject.h
r98501 r99754 58 58 JSONObject(JSGlobalObject*, Structure*); 59 59 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 60 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);60 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 61 61 62 62 }; -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r99675 r99754 77 77 } 78 78 79 void JSObject::vtableAnchor() 80 { 81 } 82 79 83 void JSObject::visitChildren(JSCell* cell, SlotVisitor& visitor) 80 84 { … … 456 460 { 457 461 PropertyDescriptor descriptor; 458 if (!const_cast<JSObject*>(this)-> getOwnPropertyDescriptor(exec, propertyName, descriptor))462 if (!const_cast<JSObject*>(this)->methodTable()->getOwnPropertyDescriptor(const_cast<JSObject*>(this), exec, propertyName, descriptor)) 459 463 return false; 460 464 return descriptor.enumerable(); … … 647 651 } 648 652 649 bool JSObject::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)653 bool JSObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 650 654 { 651 655 unsigned attributes = 0; 652 656 JSCell* cell = 0; 653 size_t offset = structure()->get(exec->globalData(), propertyName, attributes, cell);657 size_t offset = object->structure()->get(exec->globalData(), propertyName, attributes, cell); 654 658 if (offset == WTF::notFound) 655 659 return false; 656 descriptor.setDescriptor( getDirectOffset(offset), attributes);660 descriptor.setDescriptor(object->getDirectOffset(offset), attributes); 657 661 return true; 658 662 } … … 662 666 JSObject* object = this; 663 667 while (true) { 664 if (object-> getOwnPropertyDescriptor(exec, propertyName, descriptor))668 if (object->methodTable()->getOwnPropertyDescriptor(object, exec, propertyName, descriptor)) 665 669 return true; 666 670 JSValue prototype = object->prototype(); … … 709 713 // If we have a new property we can just put it on normally 710 714 PropertyDescriptor current; 711 if (!object-> getOwnPropertyDescriptor(exec, propertyName, current)) {715 if (!object->methodTable()->getOwnPropertyDescriptor(object, exec, propertyName, current)) { 712 716 // unless extensions are prevented! 713 717 if (!object->isExtensible()) { -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r99675 r99754 81 81 typedef JSCell Base; 82 82 83 virtual void vtableAnchor(); 84 83 85 static void visitChildren(JSCell*, SlotVisitor&); 84 86 … … 102 104 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 103 105 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 104 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);106 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 105 107 106 108 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r98624 r99754 241 241 } 242 242 243 bool JSString::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)244 {245 if (getStringPropertyDescriptor(exec, propertyName, descriptor))246 return true;247 if (propertyName != exec->propertyNames().underscoreProto)248 return false;249 descriptor.setDescriptor(exec->lexicalGlobalObject()->stringPrototype(), DontEnum);250 return true;251 }252 253 243 bool JSString::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot) 254 244 { -
trunk/Source/JavaScriptCore/runtime/JSString.h
r98593 r99754 253 253 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 254 254 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 255 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);256 255 257 256 static const unsigned s_maxInternalRopeLength = 3; -
trunk/Source/JavaScriptCore/runtime/Lookup.h
r97537 r99754 286 286 287 287 if (!entry) // not found, forward to parent 288 return thisObj->ParentImp::getOwnPropertyDescriptor(exec, propertyName, descriptor);288 return ParentImp::getOwnPropertyDescriptor(thisObj, exec, propertyName, descriptor); 289 289 290 290 PropertySlot slot; … … 327 327 inline bool getStaticFunctionDescriptor(ExecState* exec, const HashTable* table, JSObject* thisObj, const Identifier& propertyName, PropertyDescriptor& descriptor) 328 328 { 329 if ( static_cast<ParentImp*>(thisObj)->ParentImp::getOwnPropertyDescriptor(exec, propertyName, descriptor))329 if (ParentImp::getOwnPropertyDescriptor(static_cast<ParentImp*>(thisObj), exec, propertyName, descriptor)) 330 330 return true; 331 331 … … 369 369 370 370 if (!entry) // not found, forward to parent 371 return thisObj->ParentImp::getOwnPropertyDescriptor(exec, propertyName, descriptor);371 return ParentImp::getOwnPropertyDescriptor(thisObj, exec, propertyName, descriptor); 372 372 373 373 ASSERT(!(entry->attributes() & Function)); -
trunk/Source/JavaScriptCore/runtime/MathObject.cpp
r98501 r99754 110 110 } 111 111 112 bool MathObject::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)113 { 114 return getStaticFunctionDescriptor<JSObject>(exec, ExecState::mathTable(exec), this, propertyName, descriptor);112 bool MathObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 113 { 114 return getStaticFunctionDescriptor<JSObject>(exec, ExecState::mathTable(exec), static_cast<MathObject*>(object), propertyName, descriptor); 115 115 } 116 116 -
trunk/Source/JavaScriptCore/runtime/MathObject.h
r98501 r99754 40 40 } 41 41 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 42 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);42 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 43 43 44 44 static const ClassInfo s_info; -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r98501 r99754 77 77 } 78 78 79 bool NumberConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)79 bool NumberConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 80 80 { 81 return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), this, propertyName, descriptor);81 return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), static_cast<NumberConstructor*>(object), propertyName, descriptor); 82 82 } 83 83 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.h
r98501 r99754 40 40 41 41 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 42 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);42 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 43 43 JSValue getValueProperty(ExecState*, int token) const; 44 44 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r98501 r99754 89 89 } 90 90 91 bool NumberPrototype::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)92 { 93 return getStaticFunctionDescriptor<NumberObject>(exec, ExecState::numberPrototypeTable(exec), this, propertyName, descriptor);91 bool NumberPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 92 { 93 return getStaticFunctionDescriptor<NumberObject>(exec, ExecState::numberPrototypeTable(exec), static_cast<NumberPrototype*>(object), propertyName, descriptor); 94 94 } 95 95 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.h
r98501 r99754 51 51 NumberPrototype(ExecState*, Structure*); 52 52 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 53 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);53 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 54 54 }; 55 55 -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r99675 r99754 95 95 } 96 96 97 bool ObjectConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)98 { 99 return getStaticFunctionDescriptor<JSObject>(exec, ExecState::objectConstructorTable(exec), this, propertyName, descriptor);97 bool ObjectConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 98 { 99 return getStaticFunctionDescriptor<JSObject>(exec, ExecState::objectConstructorTable(exec), static_cast<ObjectConstructor*>(object), propertyName, descriptor); 100 100 } 101 101 … … 153 153 JSObject* object = asObject(exec->argument(0)); 154 154 PropertyDescriptor descriptor; 155 if (!object-> getOwnPropertyDescriptor(exec, Identifier(exec, propertyName), descriptor))155 if (!object->methodTable()->getOwnPropertyDescriptor(object, exec, Identifier(exec, propertyName), descriptor)) 156 156 return JSValue::encode(jsUndefined()); 157 157 if (exec->hadException()) -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h
r98501 r99754 40 40 41 41 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 42 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);42 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 43 43 44 44 static const ClassInfo s_info; -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
r99223 r99754 101 101 } 102 102 103 bool ObjectPrototype::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)104 { 105 return getStaticFunctionDescriptor<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), this, propertyName, descriptor);103 bool ObjectPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 104 { 105 return getStaticFunctionDescriptor<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), static_cast<ObjectPrototype*>(object), propertyName, descriptor); 106 106 } 107 107 -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h
r98501 r99754 55 55 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 56 56 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 57 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);57 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 58 58 59 59 bool m_hasNoPropertiesWithUInt32Names; -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r98501 r99754 210 210 } 211 211 212 bool RegExpConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)213 { 214 return getStaticValueDescriptor<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), this, propertyName, descriptor);212 bool RegExpConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 213 { 214 return getStaticValueDescriptor<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), static_cast<RegExpConstructor*>(object), propertyName, descriptor); 215 215 } 216 216 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h
r98501 r99754 75 75 76 76 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 77 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);77 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 78 78 79 79 static const ClassInfo s_info; -
trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
r99126 r99754 67 67 } 68 68 69 virtual bool getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)69 static bool getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 70 70 { 71 if (subclassData()) 72 fillArrayInstance(exec); 73 return JSArray::getOwnPropertyDescriptor(exec, propertyName, descriptor); 71 RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(object); 72 if (thisObject->subclassData()) 73 thisObject->fillArrayInstance(exec); 74 return JSArray::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 74 75 } 75 76 -
trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp
r98501 r99754 97 97 } 98 98 99 bool RegExpObject::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)100 { 101 return getStaticValueDescriptor<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), this, propertyName, descriptor);99 bool RegExpObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 100 { 101 return getStaticValueDescriptor<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), static_cast<RegExpObject*>(object), propertyName, descriptor); 102 102 } 103 103 -
trunk/Source/JavaScriptCore/runtime/RegExpObject.h
r98501 r99754 67 67 68 68 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 69 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);69 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 70 70 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); 71 71 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r98501 r99754 73 73 } 74 74 75 bool RegExpPrototype::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)75 bool RegExpPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 76 76 { 77 return getStaticFunctionDescriptor<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), this, propertyName, descriptor);77 return getStaticFunctionDescriptor<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), static_cast<RegExpPrototype*>(object), propertyName, descriptor); 78 78 } 79 79 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h
r98501 r99754 51 51 private: 52 52 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 53 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);53 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 54 54 }; 55 55 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r98501 r99754 65 65 } 66 66 67 bool StringConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)67 bool StringConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 68 68 { 69 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::stringConstructorTable(exec), this, propertyName, descriptor);69 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::stringConstructorTable(exec), static_cast<StringConstructor*>(object), propertyName, descriptor); 70 70 } 71 71 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r98501 r99754 56 56 57 57 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 58 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);58 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 59 59 }; 60 60 -
trunk/Source/JavaScriptCore/runtime/StringObject.cpp
r99126 r99754 35 35 } 36 36 37 void StringObject::vtableAnchor() 38 { 39 } 40 37 41 void StringObject::finishCreation(JSGlobalData& globalData, JSString* string) 38 42 { … … 58 62 } 59 63 60 bool StringObject::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)64 bool StringObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 61 65 { 62 if (internalValue()->getStringPropertyDescriptor(exec, propertyName, descriptor)) 66 StringObject* thisObject = static_cast<StringObject*>(object); 67 if (thisObject->internalValue()->getStringPropertyDescriptor(exec, propertyName, descriptor)) 63 68 return true; 64 return JSObject::getOwnPropertyDescriptor( exec, propertyName, descriptor);69 return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 65 70 } 66 71 -
trunk/Source/JavaScriptCore/runtime/StringObject.h
r99126 r99754 31 31 typedef JSWrapperObject Base; 32 32 33 virtual void vtableAnchor(); 34 33 35 static StringObject* create(ExecState* exec, Structure* structure) 34 36 { … … 48 50 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 49 51 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&); 50 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);52 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 51 53 52 54 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r98624 r99754 151 151 } 152 152 153 bool StringPrototype::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)154 { 155 return getStaticFunctionDescriptor<StringObject>(exec, ExecState::stringTable(exec), this, propertyName, descriptor);153 bool StringPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 154 { 155 return getStaticFunctionDescriptor<StringObject>(exec, ExecState::stringTable(exec), static_cast<StringPrototype*>(object), propertyName, descriptor); 156 156 } 157 157 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.h
r98501 r99754 44 44 45 45 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 46 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);46 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 47 47 48 48 static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) -
trunk/Source/WebCore/ChangeLog
r99752 r99754 1 2011-11-09 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 De-virtualize JSObject::getOwnPropertyDescriptor 4 https://bugs.webkit.org/show_bug.cgi?id=71523 5 6 Reviewed by Sam Weinig. 7 8 No new tests. 9 10 Added getOwnPropertyDescriptor to the MethodTable, changed all of the 11 virtual versions of getOwnPropertyDescriptor to static ones, and 12 changed all of the call sites to the corresponding lookup in the MethodTable. 13 14 * WebCore.exp.in: 15 * bindings/js/JSDOMWindowCustom.cpp: 16 (WebCore::JSDOMWindow::getOwnPropertyDescriptor): 17 * bindings/js/JSDOMWindowShell.cpp: 18 (WebCore::JSDOMWindowShell::getOwnPropertyDescriptor): 19 * bindings/js/JSDOMWindowShell.h: 20 * bindings/js/JSWorkerContextCustom.cpp: 21 (WebCore::JSWorkerContext::getOwnPropertyDescriptorDelegate): 22 * bindings/scripts/CodeGeneratorJS.pm: 23 (GenerateGetOwnPropertyDescriptorBody): 24 (GenerateHeader): 25 (GenerateImplementation): 26 (GenerateConstructorDeclaration): 27 (GenerateConstructorDefinition): 28 * bindings/scripts/test/JS/JSTestInterface.cpp: 29 (WebCore::JSTestInterfaceConstructor::getOwnPropertyDescriptor): 30 (WebCore::JSTestInterface::getOwnPropertyDescriptor): 31 * bindings/scripts/test/JS/JSTestInterface.h: 32 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: 33 (WebCore::JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor): 34 (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor): 35 (WebCore::JSTestMediaQueryListListener::getOwnPropertyDescriptor): 36 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: 37 * bindings/scripts/test/JS/JSTestObj.cpp: 38 (WebCore::JSTestObjConstructor::getOwnPropertyDescriptor): 39 (WebCore::JSTestObjPrototype::getOwnPropertyDescriptor): 40 (WebCore::JSTestObj::getOwnPropertyDescriptor): 41 * bindings/scripts/test/JS/JSTestObj.h: 42 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 43 (WebCore::JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor): 44 (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor): 45 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: 46 * bridge/objc/objc_runtime.h: 47 * bridge/objc/objc_runtime.mm: 48 (JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertyDescriptor): 49 * bridge/qt/qt_runtime.cpp: 50 (JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertyDescriptor): 51 (JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertyDescriptor): 52 * bridge/qt/qt_runtime.h: 53 * bridge/runtime_array.cpp: 54 (JSC::RuntimeArray::getOwnPropertyDescriptor): 55 * bridge/runtime_array.h: 56 * bridge/runtime_method.cpp: 57 (JSC::RuntimeMethod::vtableAnchor): Added to prevent a weak vtable. 58 (JSC::RuntimeMethod::getOwnPropertyDescriptor): 59 * bridge/runtime_method.h: Changed getOwnPropertyDescriptor from private to protected to allow 60 subclasses to use it in their MethodTables. 61 * bridge/runtime_object.cpp: 62 (JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor): 63 * bridge/runtime_object.h: 64 1 65 2011-11-09 Julien Chaffraix <jchaffraix@webkit.org> 2 66 -
trunk/Source/WebCore/WebCore.exp.in
r99665 r99754 1707 1707 #if USE(PLUGIN_HOST_PROCESS) 1708 1708 __ZN3JSC13RuntimeMethod11getCallDataEPNS_6JSCellERNS_8CallDataE 1709 __ZN3JSC13RuntimeMethod12vtableAnchorEv 1709 1710 __ZN3JSC13RuntimeMethod14finishCreationERNS_12JSGlobalDataERKNS_10IdentifierE 1710 1711 __ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 1711 __ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_ 9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE1712 __ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 1712 1713 __ZN3JSC13RuntimeMethod6s_infoE 1713 1714 __ZN3JSC13RuntimeMethodC2EPNS_14JSGlobalObjectEPNS_9StructureERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE … … 1720 1721 __ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 1721 1722 __ZN3JSC8Bindings13RuntimeObject19getOwnPropertyNamesEPNS_8JSObjectEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE 1722 __ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_ 9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE1723 __ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 1723 1724 __ZN3JSC8Bindings13RuntimeObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE 1724 1725 __ZN3JSC8Bindings13RuntimeObject6s_infoE -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r99675 r99754 268 268 } 269 269 270 bool JSDOMWindow::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 271 { 270 bool JSDOMWindow::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 271 { 272 JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(object); 272 273 // Never allow cross-domain getOwnPropertyDescriptor 273 if (! allowsAccessFrom(exec))274 if (!thisObject->allowsAccessFrom(exec)) 274 275 return false; 275 276 … … 277 278 278 279 // We don't want any properties other than "close" and "closed" on a closed window. 279 if (! impl()->frame()) {280 if (!thisObject->impl()->frame()) { 280 281 // The following code is safe for cross-domain and same domain use. 281 282 // It ignores any custom properties that might be set on the DOMWindow (including a custom prototype). … … 288 289 if (entry && (entry->attributes() & Function) && entry->function() == jsDOMWindowPrototypeFunctionClose) { 289 290 PropertySlot slot; 290 slot.setCustom(this , nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);291 slot.setCustom(thisObject, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>); 291 292 descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum); 292 293 return true; … … 299 300 if (entry) { 300 301 PropertySlot slot; 301 slot.setCustom(this , entry->propertyGetter());302 slot.setCustom(thisObject, entry->propertyGetter()); 302 303 descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes()); 303 304 return true; … … 309 310 // are in Moz but not IE. Since we have some of these, we have to do 310 311 // it the Moz way. 311 if ( impl()->frame()->tree()->child(identifierToAtomicString(propertyName))) {312 if (thisObject->impl()->frame()->tree()->child(identifierToAtomicString(propertyName))) { 312 313 PropertySlot slot; 313 slot.setCustom(this , childFrameGetter);314 slot.setCustom(thisObject, childFrameGetter); 314 315 descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum); 315 316 return true; … … 318 319 bool ok; 319 320 unsigned i = propertyName.toArrayIndex(ok); 320 if (ok && i < impl()->frame()->tree()->childCount()) {321 if (ok && i < thisObject->impl()->frame()->tree()->childCount()) { 321 322 PropertySlot slot; 322 slot.setCustomIndex(this , i, indexGetter);323 slot.setCustomIndex(thisObject, i, indexGetter); 323 324 descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum); 324 325 return true; … … 326 327 327 328 // Allow shortcuts like 'Image1' instead of document.images.Image1 328 Document* document = impl()->frame()->document();329 Document* document = thisObject->impl()->frame()->document(); 329 330 if (document->isHTMLDocument()) { 330 331 AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName); 331 332 if (atomicPropertyName && (static_cast<HTMLDocument*>(document)->hasNamedItem(atomicPropertyName) || document->hasElementWithId(atomicPropertyName))) { 332 333 PropertySlot slot; 333 slot.setCustom(this , namedItemGetter);334 slot.setCustom(thisObject, namedItemGetter); 334 335 descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum); 335 336 return true; … … 337 338 } 338 339 339 return Base::getOwnPropertyDescriptor( exec, propertyName, descriptor);340 return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 340 341 } 341 342 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
r99675 r99754 97 97 } 98 98 99 bool JSDOMWindowShell::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)99 bool JSDOMWindowShell::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 100 100 { 101 return window()->getOwnPropertyDescriptor(exec, propertyName, descriptor); 101 JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object); 102 return thisObject->window()->methodTable()->getOwnPropertyDescriptor(thisObject->window(), exec, propertyName, descriptor); 102 103 } 103 104 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h
r99675 r99754 81 81 static JSC::UString className(const JSC::JSObject*); 82 82 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 83 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);83 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); 84 84 static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&); 85 85 static void putWithAttributes(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, unsigned attributes); -
trunk/Source/WebCore/bindings/js/JSWorkerContextCustom.cpp
r97537 r99754 81 81 { 82 82 // Look for overrides before looking at any of our own properties. 83 if (JSGlobalObject::getOwnPropertyDescriptor( exec, propertyName, descriptor))83 if (JSGlobalObject::getOwnPropertyDescriptor(this, exec, propertyName, descriptor)) 84 84 return true; 85 85 return false; -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r99675 r99754 518 518 if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) { 519 519 if ($interfaceName eq "DOMWindow") { 520 push(@implContent, " if (! static_cast<$className*>(thisObject)->allowsAccessFrom(exec))\n");520 push(@implContent, " if (!thisObject->allowsAccessFrom(exec))\n"); 521 521 } else { 522 push(@implContent, " if (!allowsAccessFromFrame(exec, static_cast<$className*>(thisObject)->impl()->frame()))\n");522 push(@implContent, " if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))\n"); 523 523 } 524 524 push(@implContent, " return false;\n"); … … 526 526 527 527 if ($interfaceName eq "NamedNodeMap" or $interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") { 528 push(@getOwnPropertyDescriptorImpl, " ${namespaceMaybe}JSValue proto = prototype();\n");528 push(@getOwnPropertyDescriptorImpl, " ${namespaceMaybe}JSValue proto = thisObject->prototype();\n"); 529 529 push(@getOwnPropertyDescriptorImpl, " if (proto.isObject() && static_cast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n"); 530 530 push(@getOwnPropertyDescriptorImpl, " return false;\n\n"); … … 537 537 push(@getOwnPropertyDescriptorImpl, " if (entry) {\n"); 538 538 push(@getOwnPropertyDescriptorImpl, " PropertySlot slot;\n"); 539 push(@getOwnPropertyDescriptorImpl, " slot.setCustom(this , entry->propertyGetter());\n");539 push(@getOwnPropertyDescriptorImpl, " slot.setCustom(thisObject, entry->propertyGetter());\n"); 540 540 push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());\n"); 541 541 push(@getOwnPropertyDescriptorImpl, " return true;\n"); … … 551 551 push(@getOwnPropertyDescriptorImpl, " bool ok;\n"); 552 552 push(@getOwnPropertyDescriptorImpl, " unsigned index = propertyName.toUInt32(ok);\n"); 553 push(@getOwnPropertyDescriptorImpl, " if (ok && index < static_cast<$implClassName*>( impl())->length()) {\n");553 push(@getOwnPropertyDescriptorImpl, " if (ok && index < static_cast<$implClassName*>(thisObject->impl())->length()) {\n"); 554 554 if ($dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) { 555 555 # Assume that if there's a setter, the index will be writable 556 556 if ($dataNode->extendedAttributes->{"HasIndexSetter"} || $dataNode->extendedAttributes->{"HasCustomIndexSetter"}) { 557 push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor( getByIndex(exec, index), ${namespaceMaybe}DontDelete);\n");557 push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(thisObject->getByIndex(exec, index), ${namespaceMaybe}DontDelete);\n"); 558 558 } else { 559 push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor( getByIndex(exec, index), ${namespaceMaybe}DontDelete | ${namespaceMaybe}ReadOnly);\n");559 push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(thisObject->getByIndex(exec, index), ${namespaceMaybe}DontDelete | ${namespaceMaybe}ReadOnly);\n"); 560 560 } 561 561 } else { 562 562 push(@getOwnPropertyDescriptorImpl, " ${namespaceMaybe}PropertySlot slot;\n"); 563 push(@getOwnPropertyDescriptorImpl, " slot.setCustomIndex(this , index, indexGetter);\n");563 push(@getOwnPropertyDescriptorImpl, " slot.setCustomIndex(thisObject, index, indexGetter);\n"); 564 564 # Assume that if there's a setter, the index will be writable 565 565 if ($dataNode->extendedAttributes->{"HasIndexSetter"} || $dataNode->extendedAttributes->{"HasCustomIndexSetter"}) { … … 574 574 575 575 if ($dataNode->extendedAttributes->{"HasNameGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"}) { 576 push(@getOwnPropertyDescriptorImpl, " if (canGetItemsForName(exec, static_cast<$implClassName*>( impl()), propertyName)) {\n");576 push(@getOwnPropertyDescriptorImpl, " if (canGetItemsForName(exec, static_cast<$implClassName*>(thisObject->impl()), propertyName)) {\n"); 577 577 push(@getOwnPropertyDescriptorImpl, " ${namespaceMaybe}PropertySlot slot;\n"); 578 push(@getOwnPropertyDescriptorImpl, " slot.setCustom(this , nameGetter);\n");578 push(@getOwnPropertyDescriptorImpl, " slot.setCustom(thisObject, nameGetter);\n"); 579 579 push(@getOwnPropertyDescriptorImpl, " descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);\n"); 580 580 push(@getOwnPropertyDescriptorImpl, " return true;\n"); … … 592 592 593 593 if ($dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"}) { 594 push(@getOwnPropertyDescriptorImpl, " if ( getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n");594 push(@getOwnPropertyDescriptorImpl, " if (thisObject->getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n"); 595 595 push(@getOwnPropertyDescriptorImpl, " return true;\n"); 596 596 } … … 599 599 if ($inlined) { 600 600 die "Cannot inline if NoStaticTables is set." if ($dataNode->extendedAttributes->{"NoStaticTables"}); 601 push(@getOwnPropertyDescriptorImpl, " return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, s_info.staticPropHashTable, this , propertyName, descriptor);\n");601 push(@getOwnPropertyDescriptorImpl, " return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, s_info.staticPropHashTable, thisObject, propertyName, descriptor);\n"); 602 602 } else { 603 push(@getOwnPropertyDescriptorImpl, " return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, " . hashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", this , propertyName, descriptor);\n");603 push(@getOwnPropertyDescriptorImpl, " return ${namespaceMaybe}getStaticValueDescriptor<$className, Base>(exec, " . hashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n"); 604 604 } 605 605 } else { 606 push(@getOwnPropertyDescriptorImpl, " return Base::getOwnPropertyDescriptor( exec, propertyName, descriptor);\n");606 push(@getOwnPropertyDescriptorImpl, " return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);\n"); 607 607 } 608 608 … … 775 775 if ($hasGetter) { 776 776 push(@headerContent, " static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);\n"); 777 push(@headerContent, " virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);\n");777 push(@headerContent, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);\n"); 778 778 push(@headerContent, " static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n") if ($dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) && !$dataNode->extendedAttributes->{"HasOverridingNameGetter"}; 779 779 push(@headerContent, " bool getOwnPropertySlotDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"}; … … 972 972 push(@headerContent, GenerateGetOwnPropertySlotBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 1)); 973 973 push(@headerContent, "}\n\n"); 974 push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertyDescriptor(JSC:: ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor)\n");974 push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertyDescriptor(JSC::JSObject* object, JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor)\n"); 975 975 push(@headerContent, "{\n"); 976 push(@headerContent, " ASSERT_GC_OBJECT_INHERITS(this, &s_info);\n"); 976 push(@headerContent, " ${className}* thisObject = static_cast<${className}*>(object);\n"); 977 push(@headerContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); 977 978 push(@headerContent, GenerateGetOwnPropertyDescriptorBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 1)); 978 979 push(@headerContent, "}\n\n"); … … 1036 1037 if ($numFunctions > 0 || $numConstants > 0 || $dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}) { 1037 1038 push(@headerContent, " static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n"); 1038 push(@headerContent, " virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n");1039 push(@headerContent, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n"); 1039 1040 push(@headerContent, " bool getOwnPropertySlotDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}; 1040 1041 push(@headerContent, " bool getOwnPropertyDescriptorDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n") if $dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}; … … 1453 1454 push(@implContent, "}\n\n"); 1454 1455 1455 push(@implContent, "bool ${className}Prototype::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");1456 push(@implContent, "bool ${className}Prototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n"); 1456 1457 push(@implContent, "{\n"); 1457 1458 push(@implContent, " ${className}Prototype* thisObject = static_cast<${className}Prototype*>(object);\n"); 1459 1458 1460 if ($dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}) { 1459 push(@implContent, " if ( getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n");1461 push(@implContent, " if (thisObject->getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n"); 1460 1462 push(@implContent, " return true;\n"); 1461 1463 } 1462 1464 1463 1465 if ($numConstants eq 0 && $numFunctions eq 0) { 1464 push(@implContent, " return Base::getOwnPropertyDescriptor( exec, propertyName, descriptor);\n");1466 push(@implContent, " return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);\n"); 1465 1467 } elsif ($numConstants eq 0) { 1466 push(@implContent, " return getStaticFunctionDescriptor<JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", this , propertyName, descriptor);\n");1468 push(@implContent, " return getStaticFunctionDescriptor<JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n"); 1467 1469 } elsif ($numFunctions eq 0) { 1468 push(@implContent, " return getStaticValueDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", this , propertyName, descriptor);\n");1470 push(@implContent, " return getStaticValueDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n"); 1469 1471 } else { 1470 push(@implContent, " return getStaticPropertyDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", this , propertyName, descriptor);\n");1472 push(@implContent, " return getStaticPropertyDescriptor<${className}Prototype, JSObject>(exec, " . prototypeHashTableAccessor($dataNode->extendedAttributes->{"NoStaticTables"}, $className) . ", thisObject, propertyName, descriptor);\n"); 1471 1473 } 1472 1474 push(@implContent, "}\n\n"); … … 1574 1576 push(@implContent, GenerateGetOwnPropertySlotBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 0)); 1575 1577 push(@implContent, "}\n\n"); 1576 push(@implContent, "bool ${className}::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");1578 push(@implContent, "bool ${className}::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n"); 1577 1579 push(@implContent, "{\n"); 1578 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(this, &s_info);\n"); 1580 push(@implContent, " ${className}* thisObject = static_cast<${className}*>(object);\n"); 1581 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); 1579 1582 push(@implContent, GenerateGetOwnPropertyDescriptorBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 0)); 1580 1583 push(@implContent, "}\n\n"); … … 3207 3210 3208 3211 push(@$outputArray, " static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n"); 3209 push(@$outputArray, " virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n");3212 push(@$outputArray, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n"); 3210 3213 push(@$outputArray, " static const JSC::ClassInfo s_info;\n"); 3211 3214 … … 3262 3265 push(@$outputArray, "}\n\n"); 3263 3266 3264 push(@$outputArray, "bool ${constructorClassName}::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");3267 push(@$outputArray, "bool ${constructorClassName}::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n"); 3265 3268 push(@$outputArray, "{\n"); 3266 push(@$outputArray, " return getStaticValueDescriptor<${constructorClassName}, JSDOMWrapper>(exec, &${constructorClassName}Table, this, propertyName, descriptor);\n");3269 push(@$outputArray, " return getStaticValueDescriptor<${constructorClassName}, JSDOMWrapper>(exec, &${constructorClassName}Table, static_cast<${constructorClassName}*>(object), propertyName, descriptor);\n"); 3267 3270 push(@$outputArray, "}\n\n"); 3268 3271 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r98695 r99754 95 95 } 96 96 97 bool JSTestInterfaceConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)98 { 99 return getStaticValueDescriptor<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, this, propertyName, descriptor);97 bool JSTestInterfaceConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 98 { 99 return getStaticValueDescriptor<JSTestInterfaceConstructor, JSDOMWrapper>(exec, &JSTestInterfaceConstructorTable, static_cast<JSTestInterfaceConstructor*>(object), propertyName, descriptor); 100 100 } 101 101 … … 181 181 } 182 182 183 bool JSTestInterface::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 184 { 185 ASSERT_GC_OBJECT_INHERITS(this, &s_info); 186 return getStaticValueDescriptor<JSTestInterface, Base>(exec, &JSTestInterfaceTable, this, propertyName, descriptor); 183 bool JSTestInterface::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 184 { 185 JSTestInterface* thisObject = static_cast<JSTestInterface*>(object); 186 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); 187 return getStaticValueDescriptor<JSTestInterface, Base>(exec, &JSTestInterfaceTable, thisObject, propertyName, descriptor); 187 188 } 188 189 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
r98695 r99754 44 44 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 45 45 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 46 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);46 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); 47 47 static const JSC::ClassInfo s_info; 48 48 … … 120 120 121 121 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); 122 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);122 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); 123 123 static const JSC::ClassInfo s_info; 124 124 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
r99244 r99754 93 93 } 94 94 95 bool JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)96 { 97 return getStaticValueDescriptor<JSTestMediaQueryListListenerConstructor, JSDOMWrapper>(exec, &JSTestMediaQueryListListenerConstructorTable, this, propertyName, descriptor);95 bool JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 96 { 97 return getStaticValueDescriptor<JSTestMediaQueryListListenerConstructor, JSDOMWrapper>(exec, &JSTestMediaQueryListListenerConstructorTable, static_cast<JSTestMediaQueryListListenerConstructor*>(object), propertyName, descriptor); 98 98 } 99 99 … … 131 131 } 132 132 133 bool JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 134 { 135 return getStaticFunctionDescriptor<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, this, propertyName, descriptor); 133 bool JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 134 { 135 JSTestMediaQueryListListenerPrototype* thisObject = static_cast<JSTestMediaQueryListListenerPrototype*>(object); 136 return getStaticFunctionDescriptor<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, thisObject, propertyName, descriptor); 136 137 } 137 138 … … 162 163 } 163 164 164 bool JSTestMediaQueryListListener::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 165 { 166 ASSERT_GC_OBJECT_INHERITS(this, &s_info); 167 return getStaticValueDescriptor<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, this, propertyName, descriptor); 165 bool JSTestMediaQueryListListener::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 166 { 167 JSTestMediaQueryListListener* thisObject = static_cast<JSTestMediaQueryListListener*>(object); 168 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); 169 return getStaticValueDescriptor<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, thisObject, propertyName, descriptor); 168 170 } 169 171 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
r98552 r99754 42 42 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 43 43 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 44 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);44 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); 45 45 static const JSC::ClassInfo s_info; 46 46 … … 77 77 static const JSC::ClassInfo s_info; 78 78 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); 79 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);79 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); 80 80 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) 81 81 { … … 104 104 105 105 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); 106 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);106 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); 107 107 static const JSC::ClassInfo s_info; 108 108 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r99673 r99754 198 198 } 199 199 200 bool JSTestObjConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)201 { 202 return getStaticValueDescriptor<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, this, propertyName, descriptor);200 bool JSTestObjConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 201 { 202 return getStaticValueDescriptor<JSTestObjConstructor, JSDOMWrapper>(exec, &JSTestObjConstructorTable, static_cast<JSTestObjConstructor*>(object), propertyName, descriptor); 203 203 } 204 204 … … 305 305 } 306 306 307 bool JSTestObjPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 308 { 309 return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, this, propertyName, descriptor); 307 bool JSTestObjPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 308 { 309 JSTestObjPrototype* thisObject = static_cast<JSTestObjPrototype*>(object); 310 return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, descriptor); 310 311 } 311 312 … … 336 337 } 337 338 338 bool JSTestObj::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 339 { 340 ASSERT_GC_OBJECT_INHERITS(this, &s_info); 341 return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, this, propertyName, descriptor); 339 bool JSTestObj::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 340 { 341 JSTestObj* thisObject = static_cast<JSTestObj*>(object); 342 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); 343 return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, descriptor); 342 344 } 343 345 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
r99673 r99754 42 42 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 43 43 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 44 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);44 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); 45 45 static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&); 46 46 static const JSC::ClassInfo s_info; … … 90 90 static const JSC::ClassInfo s_info; 91 91 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); 92 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);92 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); 93 93 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) 94 94 { … … 117 117 118 118 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); 119 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);119 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); 120 120 static const JSC::ClassInfo s_info; 121 121 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r98552 r99754 94 94 } 95 95 96 bool JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)96 bool JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 97 97 { 98 return getStaticValueDescriptor<JSTestSerializedScriptValueInterfaceConstructor, JSDOMWrapper>(exec, &JSTestSerializedScriptValueInterfaceConstructorTable, this, propertyName, descriptor);98 return getStaticValueDescriptor<JSTestSerializedScriptValueInterfaceConstructor, JSDOMWrapper>(exec, &JSTestSerializedScriptValueInterfaceConstructorTable, static_cast<JSTestSerializedScriptValueInterfaceConstructor*>(object), propertyName, descriptor); 99 99 } 100 100 … … 151 151 } 152 152 153 bool JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)153 bool JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 154 154 { 155 ASSERT_GC_OBJECT_INHERITS(this, &s_info); 156 return getStaticValueDescriptor<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, this, propertyName, descriptor); 155 JSTestSerializedScriptValueInterface* thisObject = static_cast<JSTestSerializedScriptValueInterface*>(object); 156 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); 157 return getStaticValueDescriptor<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, thisObject, propertyName, descriptor); 157 158 } 158 159 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
r98552 r99754 44 44 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); 45 45 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 46 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);46 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); 47 47 static const JSC::ClassInfo s_info; 48 48 … … 104 104 105 105 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); 106 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);106 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); 107 107 static const JSC::ClassInfo s_info; 108 108 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) -
trunk/Source/WebCore/bridge/objc/objc_runtime.h
r98932 r99754 125 125 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags; 126 126 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 127 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);127 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 128 128 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); 129 129 static CallType getCallData(JSCell*, CallData&); -
trunk/Source/WebCore/bridge/objc/objc_runtime.mm
r98932 r99754 213 213 } 214 214 215 bool ObjcFallbackObjectImp::getOwnPropertyDescriptor( ExecState*, const Identifier&, PropertyDescriptor& descriptor)215 bool ObjcFallbackObjectImp::getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor& descriptor) 216 216 { 217 217 // keep the prototype from getting called instead of just returning false -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r99436 r99754 1512 1512 } 1513 1513 1514 bool QtRuntimeMetaMethod::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 1515 { 1514 bool QtRuntimeMetaMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 1515 { 1516 QtRuntimeMetaMethod* thisObject = static_cast<QtRuntimeMetaMethod*>(object); 1516 1517 if (propertyName == "connect") { 1517 1518 PropertySlot slot; 1518 slot.setCustom(this , connectGetter);1519 slot.setCustom(thisObject, connectGetter); 1519 1520 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum); 1520 1521 return true; … … 1523 1524 if (propertyName == "disconnect") { 1524 1525 PropertySlot slot; 1525 slot.setCustom(this , disconnectGetter);1526 slot.setCustom(thisObject, disconnectGetter); 1526 1527 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum); 1527 1528 return true; … … 1530 1531 if (propertyName == exec->propertyNames().length) { 1531 1532 PropertySlot slot; 1532 slot.setCustom(this , lengthGetter);1533 slot.setCustom(thisObject, lengthGetter); 1533 1534 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum); 1534 1535 return true; 1535 1536 } 1536 1537 1537 return QtRuntimeMethod::getOwnPropertyDescriptor( exec, propertyName, descriptor);1538 return QtRuntimeMethod::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 1538 1539 } 1539 1540 … … 1748 1749 } 1749 1750 1750 bool QtRuntimeConnectionMethod::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 1751 { 1751 bool QtRuntimeConnectionMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 1752 { 1753 QtRuntimeConnectionMethod* thisObject = static_cast<QtRuntimeConnectionMethod*>(object); 1752 1754 if (propertyName == exec->propertyNames().length) { 1753 1755 PropertySlot slot; 1754 slot.setCustom(this , lengthGetter);1756 slot.setCustom(thisObject, lengthGetter); 1755 1757 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum); 1756 1758 return true; 1757 1759 } 1758 1760 1759 return QtRuntimeMethod::getOwnPropertyDescriptor( exec, propertyName, descriptor);1761 return QtRuntimeMethod::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 1760 1762 } 1761 1763 -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r99126 r99754 166 166 167 167 static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&); 168 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);168 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 169 169 static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 170 170 … … 206 206 207 207 static bool getOwnPropertySlot(JSCell*, ExecState *, const Identifier&, PropertySlot&); 208 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);208 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 209 209 static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 210 210 -
trunk/Source/WebCore/bridge/runtime_array.cpp
r99126 r99754 100 100 } 101 101 102 bool RuntimeArray::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)102 bool RuntimeArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 103 103 { 104 RuntimeArray* thisObject = static_cast<RuntimeArray*>(object); 104 105 if (propertyName == exec->propertyNames().length) { 105 106 PropertySlot slot; 106 slot.setCustom(this , lengthGetter);107 slot.setCustom(thisObject, lengthGetter); 107 108 descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum); 108 109 return true; … … 112 113 unsigned index = propertyName.toArrayIndex(ok); 113 114 if (ok) { 114 if (index < getLength()) {115 if (index < thisObject->getLength()) { 115 116 PropertySlot slot; 116 slot.setCustomIndex(this , index, indexGetter);117 slot.setCustomIndex(thisObject, index, indexGetter); 117 118 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | DontEnum); 118 119 return true; … … 120 121 } 121 122 122 return JSObject::getOwnPropertyDescriptor( exec, propertyName, descriptor);123 return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 123 124 } 124 125 -
trunk/Source/WebCore/bridge/runtime_array.h
r99126 r99754 53 53 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 54 54 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned, PropertySlot&); 55 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);55 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 56 56 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); 57 57 static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue); -
trunk/Source/WebCore/bridge/runtime_method.cpp
r98501 r99754 51 51 } 52 52 53 void RuntimeMethod::vtableAnchor() 54 { 55 } 56 53 57 void RuntimeMethod::finishCreation(JSGlobalData& globalData, const Identifier& ident) 54 58 { … … 81 85 } 82 86 83 bool RuntimeMethod::getOwnPropertyDescriptor( ExecState* exec, const Identifier& propertyName, PropertyDescriptor &descriptor)87 bool RuntimeMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor &descriptor) 84 88 { 89 RuntimeMethod* thisObject = static_cast<RuntimeMethod*>(object); 85 90 if (propertyName == exec->propertyNames().length) { 86 91 PropertySlot slot; 87 slot.setCustom(this , lengthGetter);92 slot.setCustom(thisObject, lengthGetter); 88 93 descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum); 89 94 return true; 90 95 } 91 96 92 return InternalFunction::getOwnPropertyDescriptor( exec, propertyName, descriptor);97 return InternalFunction::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 93 98 } 94 99 -
trunk/Source/WebCore/bridge/runtime_method.h
r98501 r99754 38 38 typedef InternalFunction Base; 39 39 40 virtual void vtableAnchor(); 41 40 42 static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& methodList) 41 43 { … … 66 68 67 69 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); 70 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); 68 71 69 72 private: 70 73 static JSValue lengthGetter(ExecState*, JSValue, const Identifier&); 71 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);72 74 73 75 OwnPtr<Bindings::MethodList> _methodList; -
trunk/Source/WebCore/bridge/runtime_object.cpp
r99126 r99754 163 163 } 164 164 165 bool RuntimeObject::getOwnPropertyDescriptor(ExecState *exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 166 { 167 if (!m_instance) { 165 bool RuntimeObject::getOwnPropertyDescriptor(JSObject* object, ExecState *exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 166 { 167 RuntimeObject* thisObject = static_cast<RuntimeObject*>(object); 168 if (!thisObject->m_instance) { 168 169 throwInvalidAccessError(exec); 169 170 return false; 170 171 } 171 172 172 RefPtr<Instance> instance = m_instance;173 RefPtr<Instance> instance = thisObject->m_instance; 173 174 instance->begin(); 174 175 … … 180 181 if (aField) { 181 182 PropertySlot slot; 182 slot.setCustom(this , fieldGetter);183 slot.setCustom(thisObject, fieldGetter); 183 184 instance->end(); 184 185 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete); … … 190 191 if (methodList.size() > 0) { 191 192 PropertySlot slot; 192 slot.setCustom(this , methodGetter);193 slot.setCustom(thisObject, methodGetter); 193 194 instance->end(); 194 195 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly); … … 200 201 if (!aClass->fallbackObject(exec, instance.get(), propertyName).isUndefined()) { 201 202 PropertySlot slot; 202 slot.setCustom(this , fallbackObjectGetter);203 slot.setCustom(thisObject, fallbackObjectGetter); 203 204 instance->end(); 204 205 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly | DontEnum); … … 209 210 instance->end(); 210 211 211 return instance->getOwnPropertyDescriptor(this , exec, propertyName, descriptor);212 return instance->getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); 212 213 } 213 214 -
trunk/Source/WebCore/bridge/runtime_object.h
r99126 r99754 47 47 48 48 static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&); 49 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier& propertyName, PropertyDescriptor&);49 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier& propertyName, PropertyDescriptor&); 50 50 static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); 51 51 static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName); -
trunk/Source/WebKit2/ChangeLog
r99735 r99754 1 2011-11-09 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 De-virtualize JSObject::getOwnPropertyDescriptor 4 https://bugs.webkit.org/show_bug.cgi?id=71523 5 6 Reviewed by Sam Weinig. 7 8 Added getOwnPropertyDescriptor to the MethodTable, changed all of the 9 virtual versions of getOwnPropertyDescriptor to static ones, and 10 changed all of the call sites to the corresponding lookup in the MethodTable. 11 12 * WebProcess/Plugins/Netscape/JSNPObject.cpp: 13 (WebKit::JSNPObject::getOwnPropertyDescriptor): 14 * WebProcess/Plugins/Netscape/JSNPObject.h: 15 1 16 2011-11-09 Alexandru Chiculita <achicu@adobe.com> 2 17 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
r99126 r99754 274 274 } 275 275 276 bool JSNPObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 277 { 278 ASSERT_GC_OBJECT_INHERITS(this, &s_info); 279 if (!m_npObject) { 276 bool JSNPObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 277 { 278 JSNPObject* thisObject = static_cast<JSNPObject*>(object); 279 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); 280 if (!thisObject->m_npObject) { 280 281 throwInvalidAccessError(exec); 281 282 return false; … … 285 286 286 287 // First, check if the NPObject has a property with this name. 287 if ( m_npObject->_class->hasProperty && m_npObject->_class->hasProperty(m_npObject, npIdentifier)) {288 if (thisObject->m_npObject->_class->hasProperty && thisObject->m_npObject->_class->hasProperty(thisObject->m_npObject, npIdentifier)) { 288 289 PropertySlot slot; 289 slot.setCustom(this , propertyGetter);290 slot.setCustom(thisObject, propertyGetter); 290 291 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete); 291 292 return true; … … 293 294 294 295 // Second, check if the NPObject has a method with this name. 295 if ( m_npObject->_class->hasMethod && m_npObject->_class->hasMethod(m_npObject, npIdentifier)) {296 if (thisObject->m_npObject->_class->hasMethod && thisObject->m_npObject->_class->hasMethod(thisObject->m_npObject, npIdentifier)) { 296 297 PropertySlot slot; 297 slot.setCustom(this , methodGetter);298 slot.setCustom(thisObject, methodGetter); 298 299 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly); 299 300 return true; -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
r99126 r99754 84 84 85 85 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); 86 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);86 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); 87 87 static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&); 88 88
Note: See TracChangeset
for help on using the changeset viewer.