Changeset 153532 in webkit
- Timestamp:
- Jul 31, 2013 12:03:05 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 80 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r148696 r153532 177 177 static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType); 178 178 179 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);180 static bool getOwnPropertySlotByIndex(JS Cell*, ExecState*, unsigned propertyName, PropertySlot&);179 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 180 static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&); 181 181 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 182 182 -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r153145 r153532 123 123 124 124 template <class Parent> 125 bool JSCallbackObject<Parent>::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)126 { 127 JSCallbackObject* thisObject = jsCast<JSCallbackObject*>( cell);125 bool JSCallbackObject<Parent>::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 126 { 127 JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(object); 128 128 JSContextRef ctx = toRef(exec); 129 129 JSObjectRef thisRef = toRef(thisObject); … … 184 184 185 185 template <class Parent> 186 bool JSCallbackObject<Parent>::getOwnPropertySlotByIndex(JS Cell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)187 { 188 return cell->methodTable()->getOwnPropertySlot(cell, exec, Identifier::from(exec, propertyName), slot);186 bool JSCallbackObject<Parent>::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot) 187 { 188 return object->methodTable()->getOwnPropertySlot(object, exec, Identifier::from(exec, propertyName), slot); 189 189 } 190 190 -
trunk/Source/JavaScriptCore/ChangeLog
r153527 r153532 1 2013-07-30 Gavin Barraclough <barraclough@apple.com> 2 3 Some cleanup in JSValue::get 4 https://bugs.webkit.org/show_bug.cgi?id=119343 5 6 Reviewed by Geoff Garen. 7 8 JSValue::get is implemented to: 9 1) Check if the value is a cell – if not, synthesize a prototype to search, 10 2) call getOwnPropertySlot on the cell, 11 3) if this returns false, cast to JSObject to get the prototype, and walk the prototype chain. 12 By all rights this should crash when passed a string and accessing a property that does not exist, because 13 the string is a cell, getOwnPropertySlot should return false, and the cast to JSObject should be unsafe. 14 To work around this, JSString::getOwnPropertySlot actually implements 'get' functionality - searching the 15 prototype chain, and faking out a return value of undefined if no property is found. 16 17 This is a huge hazard, since fixing JSString::getOwnPropertySlot or calling getOwnPropertySlot on cells 18 from elsewhere would introduce bugs. Fortunately it is only ever called in this one place. 19 20 The fix here is to move getOwnPropertySlot onto JSObjecte and end this madness - cells don't have property 21 slots anyway. 22 23 Interesting changes are in JSCJSValueInlines.h, JSString.cpp - the rest is pretty much all JSCell -> JSObject. 24 1 25 2013-07-31 Michael Saboff <msaboff@apple.com> 2 26 -
trunk/Source/JavaScriptCore/JSCTypedArrayStubs.h
r148696 r153532 54 54 }\ 55 55 \ 56 static bool getOwnPropertySlot(JSC::JS Cell*, JSC::ExecState*, JSC::PropertyName propertyName, JSC::PropertySlot&);\56 static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName propertyName, JSC::PropertySlot&);\ 57 57 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName propertyName, JSC::PropertyDescriptor&);\ 58 static bool getOwnPropertySlotByIndex(JSC::JS Cell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\58 static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\ 59 59 static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName propertyName, JSC::JSValue, JSC::PutPropertySlot&);\ 60 60 static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool);\ … … 100 100 }\ 101 101 \ 102 bool JS##name##Array::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\103 {\ 104 JS##name##Array* thisObject = jsCast<JS##name##Array*>( cell);\102 bool JS##name##Array::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\ 103 {\ 104 JS##name##Array* thisObject = jsCast<JS##name##Array*>(object);\ 105 105 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\ 106 106 unsigned index = propertyName.asIndex();\ … … 110 110 return true;\ 111 111 }\ 112 return Base::getOwnPropertySlot( cell, exec, propertyName, slot);\112 return Base::getOwnPropertySlot(object, exec, propertyName, slot);\ 113 113 }\ 114 114 \ … … 126 126 }\ 127 127 \ 128 bool JS##name##Array::getOwnPropertySlotByIndex(JS Cell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)\129 {\ 130 JS##name##Array* thisObject = jsCast<JS##name##Array*>( cell);\128 bool JS##name##Array::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot)\ 129 {\ 130 JS##name##Array* thisObject = jsCast<JS##name##Array*>(object);\ 131 131 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\ 132 132 if (propertyName < thisObject->m_storageLength) {\ -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
r148696 r153532 66 66 } 67 67 68 bool DebuggerActivation::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)68 bool DebuggerActivation::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 69 69 { 70 DebuggerActivation* thisObject = jsCast<DebuggerActivation*>( cell);70 DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(object); 71 71 return thisObject->m_activation->methodTable()->getOwnPropertySlot(thisObject->m_activation.get(), exec, propertyName, slot); 72 72 } -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h
r148696 r153532 44 44 static void visitChildren(JSCell*, SlotVisitor&); 45 45 static String className(const JSObject*); 46 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);46 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 47 47 static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); 48 48 static void putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned attributes); -
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r153211 r153532 91 91 } 92 92 93 bool Arguments::getOwnPropertySlotByIndex(JS Cell* cell, ExecState* exec, unsigned i, PropertySlot& slot)94 { 95 Arguments* thisObject = jsCast<Arguments*>( cell);93 bool Arguments::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned i, PropertySlot& slot) 94 { 95 Arguments* thisObject = jsCast<Arguments*>(object); 96 96 if (JSValue value = thisObject->tryGetArgument(i)) { 97 97 slot.setValue(value); … … 124 124 } 125 125 126 bool Arguments::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)127 { 128 Arguments* thisObject = jsCast<Arguments*>( cell);126 bool Arguments::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 127 { 128 Arguments* thisObject = jsCast<Arguments*>(object); 129 129 unsigned i = propertyName.asIndex(); 130 130 if (JSValue value = thisObject->tryGetArgument(i)) { -
trunk/Source/JavaScriptCore/runtime/Arguments.h
r148696 r153532 98 98 private: 99 99 static void destroy(JSCell*); 100 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);101 static bool getOwnPropertySlotByIndex(JS Cell*, ExecState*, unsigned propertyName, PropertySlot&);100 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 101 static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&); 102 102 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 103 103 static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r148696 r153532 67 67 } 68 68 69 bool ArrayConstructor::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)69 bool ArrayConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 70 70 { 71 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), jsCast<ArrayConstructor*>( cell), propertyName, slot);71 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), jsCast<ArrayConstructor*>(object), propertyName, slot); 72 72 } 73 73 -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r148696 r153532 54 54 private: 55 55 ArrayConstructor(JSGlobalObject*, Structure*); 56 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);56 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 57 57 58 58 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r153221 r153532 137 137 } 138 138 139 bool ArrayPrototype::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)140 { 141 return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), jsCast<ArrayPrototype*>( cell), propertyName, slot);139 bool ArrayPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 140 { 141 return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), jsCast<ArrayPrototype*>(object), propertyName, slot); 142 142 } 143 143 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h
r148696 r153532 36 36 static ArrayPrototype* create(ExecState*, JSGlobalObject*, Structure*); 37 37 38 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);38 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 39 39 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 40 40 -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r148696 r153532 64 64 } 65 65 66 bool BooleanPrototype::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)66 bool BooleanPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 67 67 { 68 return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), jsCast<BooleanPrototype*>( cell), propertyName, slot);68 return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), jsCast<BooleanPrototype*>(object), propertyName, slot); 69 69 } 70 70 -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h
r148696 r153532 50 50 private: 51 51 BooleanPrototype(ExecState*, Structure*); 52 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);52 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 53 53 54 54 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); -
trunk/Source/JavaScriptCore/runtime/ClassInfo.h
r153145 r153532 61 61 DeletePropertyByIndexFunctionPtr deletePropertyByIndex; 62 62 63 typedef bool (*GetOwnPropertySlotFunctionPtr)(JS Cell*, ExecState*, PropertyName, PropertySlot&);63 typedef bool (*GetOwnPropertySlotFunctionPtr)(JSObject*, ExecState*, PropertyName, PropertySlot&); 64 64 GetOwnPropertySlotFunctionPtr getOwnPropertySlot; 65 65 66 typedef bool (*GetOwnPropertySlotByIndexFunctionPtr)(JS Cell*, ExecState*, unsigned, PropertySlot&);66 typedef bool (*GetOwnPropertySlotByIndexFunctionPtr)(JSObject*, ExecState*, unsigned, PropertySlot&); 67 67 GetOwnPropertySlotByIndexFunctionPtr getOwnPropertySlotByIndex; 68 68 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r148696 r153532 87 87 } 88 88 89 bool DateConstructor::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)90 { 91 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), jsCast<DateConstructor*>( cell), propertyName, slot);89 bool DateConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 90 { 91 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), jsCast<DateConstructor*>(object), propertyName, slot); 92 92 } 93 93 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r148696 r153532 55 55 static CallType getCallData(JSCell*, CallData&); 56 56 57 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);57 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 58 58 59 59 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r153145 r153532 515 515 } 516 516 517 bool DatePrototype::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)518 { 519 return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), jsCast<DatePrototype*>( cell), propertyName, slot);517 bool DatePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 518 { 519 return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), jsCast<DatePrototype*>(object), propertyName, slot); 520 520 } 521 521 -
trunk/Source/JavaScriptCore/runtime/DatePrototype.h
r148696 r153532 41 41 return prototype; 42 42 } 43 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);43 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 44 44 45 45 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
r148696 r153532 62 62 } 63 63 64 bool ErrorPrototype::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)64 bool ErrorPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 65 65 { 66 return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), jsCast<ErrorPrototype*>( cell), propertyName, slot);66 return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), jsCast<ErrorPrototype*>(object), propertyName, slot); 67 67 } 68 68 -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h
r148696 r153532 53 53 54 54 private: 55 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);55 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 56 56 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 57 57 }; -
trunk/Source/JavaScriptCore/runtime/JSActivation.cpp
r153170 r153532 151 151 } 152 152 153 bool JSActivation::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)154 { 155 JSActivation* thisObject = jsCast<JSActivation*>( cell);153 bool JSActivation::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 154 { 155 JSActivation* thisObject = jsCast<JSActivation*>(object); 156 156 157 157 if (propertyName == exec->propertyNames().arguments) { -
trunk/Source/JavaScriptCore/runtime/JSActivation.h
r153221 r153532 63 63 static void visitChildren(JSCell*, SlotVisitor&); 64 64 65 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);65 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 66 66 static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 67 67 JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r153189 r153532 178 178 } 179 179 180 bool JSArray::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)181 { 182 JSArray* thisObject = jsCast<JSArray*>( cell);180 bool JSArray::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 181 { 182 JSArray* thisObject = jsCast<JSArray*>(object); 183 183 if (propertyName == exec->propertyNames().length) { 184 184 slot.setValue(jsNumber(thisObject->length())); -
trunk/Source/JavaScriptCore/runtime/JSArray.h
r153189 r153532 56 56 JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool throwException); 57 57 58 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);58 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 59 59 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 60 60 -
trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h
r153229 r153532 628 628 inline JSValue JSValue::get(ExecState* exec, PropertyName propertyName, PropertySlot& slot) const 629 629 { 630 if (UNLIKELY(!isCell())) { 631 JSObject* prototype = synthesizePrototype(exec); 632 if (!prototype->getPropertySlot(exec, propertyName, slot)) 633 return jsUndefined(); 630 // If this is a primitive, we'll need to synthesize the prototype - 631 // and if it's a string there are special properties to check first. 632 JSObject* object; 633 if (UNLIKELY(!isObject())) { 634 if (isCell() && asString(*this)->getStringPropertySlot(exec, propertyName, slot)) 635 return slot.getValue(exec, propertyName); 636 object = synthesizePrototype(exec); 637 } else 638 object = asObject(asCell()); 639 640 if (object->getPropertySlot(exec, propertyName, slot)) 634 641 return slot.getValue(exec, propertyName); 635 } 636 JSCell* cell = asCell(); 637 while (true) { 638 if (cell->fastGetOwnPropertySlot(exec, propertyName, slot)) 639 return slot.getValue(exec, propertyName); 640 JSValue prototype = asObject(cell)->prototype(); 641 if (!prototype.isObject()) 642 return jsUndefined(); 643 cell = asObject(prototype); 644 } 642 return jsUndefined(); 645 643 } 646 644 … … 653 651 inline JSValue JSValue::get(ExecState* exec, unsigned propertyName, PropertySlot& slot) const 654 652 { 655 if (UNLIKELY(!isCell())) { 656 JSObject* prototype = synthesizePrototype(exec); 657 if (!prototype->getPropertySlot(exec, propertyName, slot)) 658 return jsUndefined(); 653 // If this is a primitive, we'll need to synthesize the prototype - 654 // and if it's a string there are special properties to check first. 655 JSObject* object; 656 if (UNLIKELY(!isObject())) { 657 if (isCell() && asString(*this)->getStringPropertySlot(exec, propertyName, slot)) 658 return slot.getValue(exec, propertyName); 659 object = synthesizePrototype(exec); 660 } else 661 object = asObject(asCell()); 662 663 if (object->getPropertySlot(exec, propertyName, slot)) 659 664 return slot.getValue(exec, propertyName); 660 } 661 JSCell* cell = const_cast<JSCell*>(asCell()); 662 while (true) { 663 if (cell->methodTable()->getOwnPropertySlotByIndex(cell, exec, propertyName, slot)) 664 return slot.getValue(exec, propertyName); 665 JSValue prototype = asObject(cell)->prototype(); 666 if (!prototype.isObject()) 667 return jsUndefined(); 668 cell = prototype.asCell(); 669 } 665 return jsUndefined(); 670 666 } 671 667 -
trunk/Source/JavaScriptCore/runtime/JSCell.cpp
r153145 r153532 83 83 } 84 84 85 bool JSCell::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName identifier, PropertySlot& slot)86 {87 // This is not a general purpose implementation of getOwnPropertySlot.88 // It should only be called by JSValue::get.89 // It calls getPropertySlot, not getOwnPropertySlot.90 JSObject* object = cell->toObject(exec, exec->lexicalGlobalObject());91 slot.setBase(object);92 if (!object->getPropertySlot(exec, identifier, slot))93 slot.setUndefined();94 return true;95 }96 97 bool JSCell::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned identifier, PropertySlot& slot)98 {99 // This is not a general purpose implementation of getOwnPropertySlot.100 // It should only be called by JSValue::get.101 // It calls getPropertySlot, not getOwnPropertySlot.102 JSObject* object = cell->toObject(exec, exec->lexicalGlobalObject());103 slot.setBase(object);104 if (!object->getPropertySlot(exec, identifier, slot))105 slot.setUndefined();106 return true;107 }108 109 85 void JSCell::put(JSCell* cell, ExecState* exec, PropertyName identifier, JSValue value, PutPropertySlot& slot) 110 86 { … … 187 163 } 188 164 165 bool JSCell::getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&) 166 { 167 RELEASE_ASSERT_NOT_REACHED(); 168 return false; 169 } 170 171 bool JSCell::getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned, PropertySlot&) 172 { 173 RELEASE_ASSERT_NOT_REACHED(); 174 return false; 175 } 176 189 177 void JSCell::getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode) 190 178 { -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r153145 r153532 119 119 bool isZapped() const { return !*reinterpret_cast<uintptr_t* const*>(this); } 120 120 121 // FIXME: Rename getOwnPropertySlot to virtualGetOwnPropertySlot, and122 // fastGetOwnPropertySlot to getOwnPropertySlot. Callers should always123 // call this function, not its slower virtual counterpart. (For integer124 // property names, we want a similar interface with appropriate optimizations.)125 bool fastGetOwnPropertySlot(ExecState*, PropertyName, PropertySlot&);126 121 JSValue fastGetOwnProperty(ExecState*, const String&); 127 122 … … 146 141 void finishCreation(VM&, Structure*, CreatingEarlyCellTag); 147 142 148 // Base implementation; for non-object classes implements getPropertySlot.149 static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);150 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);151 152 143 // Dummy implementations of override-able static functions for classes to put in their MethodTable 153 144 static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType); … … 160 151 static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow); 161 152 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 153 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 154 static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&); 162 155 163 156 private: -
trunk/Source/JavaScriptCore/runtime/JSCellInlines.h
r153148 r153532 166 166 } 167 167 168 ALWAYS_INLINE bool JSCell::fastGetOwnPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)169 {170 if (!structure()->typeInfo().overridesGetOwnPropertySlot())171 return asObject(this)->inlineGetOwnPropertySlot(exec, propertyName, slot);172 return methodTable()->getOwnPropertySlot(this, exec, propertyName, slot);173 }174 175 168 // Fast call to get a property where we may not yet have converted the string to an 176 169 // identifier. The first time we perform a property access with a given string, try -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r153218 r153532 241 241 } 242 242 243 bool JSFunction::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)244 { 245 JSFunction* thisObject = jsCast<JSFunction*>( cell);243 bool JSFunction::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 244 { 245 JSFunction* thisObject = jsCast<JSFunction*>(object); 246 246 if (thisObject->isHostFunction()) 247 247 return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r153124 r153532 171 171 ObjectAllocationProfile* createAllocationProfile(ExecState*, size_t inlineCapacity); 172 172 173 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);173 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 174 174 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 175 175 static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r153357 r153532 570 570 } 571 571 572 bool JSGlobalObject::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)573 { 574 JSGlobalObject* thisObject = jsCast<JSGlobalObject*>( cell);572 bool JSGlobalObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 573 { 574 JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object); 575 575 if (getStaticFunctionSlot<Base>(exec, ExecState::globalObjectTable(exec), thisObject, propertyName, slot)) 576 576 return true; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r153244 r153532 237 237 JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&); 238 238 239 JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);239 JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 240 240 JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 241 241 bool hasOwnPropertyForWrite(ExecState*, PropertyName); -
trunk/Source/JavaScriptCore/runtime/JSNameScope.cpp
r153145 r153532 76 76 } 77 77 78 bool JSNameScope::getOwnPropertySlot(JS Cell* cell, ExecState*, PropertyName propertyName, PropertySlot& slot)78 bool JSNameScope::getOwnPropertySlot(JSObject* object, ExecState*, PropertyName propertyName, PropertySlot& slot) 79 79 { 80 return symbolTableGet(jsCast<JSNameScope*>( cell), propertyName, slot);80 return symbolTableGet(jsCast<JSNameScope*>(object), propertyName, slot); 81 81 } 82 82 -
trunk/Source/JavaScriptCore/runtime/JSNameScope.h
r153221 r153532 53 53 static void visitChildren(JSCell*, SlotVisitor&); 54 54 static JSValue toThis(JSCell*, ExecState*, ECMAMode); 55 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);55 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 56 56 static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); 57 57 -
trunk/Source/JavaScriptCore/runtime/JSNotAnObject.cpp
r149980 r153532 47 47 48 48 // JSObject methods 49 bool JSNotAnObject::getOwnPropertySlot(JS Cell*, ExecState* exec, PropertyName, PropertySlot&)49 bool JSNotAnObject::getOwnPropertySlot(JSObject*, ExecState* exec, PropertyName, PropertySlot&) 50 50 { 51 51 ASSERT_UNUSED(exec, exec->hadException()); … … 53 53 } 54 54 55 bool JSNotAnObject::getOwnPropertySlotByIndex(JS Cell*, ExecState* exec, unsigned, PropertySlot&)55 bool JSNotAnObject::getOwnPropertySlotByIndex(JSObject*, ExecState* exec, unsigned, PropertySlot&) 56 56 { 57 57 ASSERT_UNUSED(exec, exec->hadException()); -
trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h
r148696 r153532 69 69 70 70 // JSObject methods 71 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);72 static bool getOwnPropertySlotByIndex(JS Cell*, ExecState*, unsigned propertyName, PropertySlot&);71 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 72 static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&); 73 73 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 74 74 -
trunk/Source/JavaScriptCore/runtime/JSONObject.cpp
r148696 r153532 591 591 // ECMA 15.8 592 592 593 bool JSONObject::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)594 { 595 return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), jsCast<JSONObject*>( cell), propertyName, slot);593 bool JSONObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 594 { 595 return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), jsCast<JSONObject*>(object), propertyName, slot); 596 596 } 597 597 -
trunk/Source/JavaScriptCore/runtime/JSONObject.h
r148696 r153532 57 57 private: 58 58 JSONObject(JSGlobalObject*, Structure*); 59 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);59 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 60 60 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 61 61 -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r153374 r153532 263 263 } 264 264 265 bool JSObject::getOwnPropertySlotByIndex(JS Cell* cell, ExecState* exec, unsigned i, PropertySlot& slot)265 bool JSObject::getOwnPropertySlotByIndex(JSObject* thisObject, ExecState* exec, unsigned i, PropertySlot& slot) 266 266 { 267 267 // NB. The fact that we're directly consulting our indexed storage implies that it is not 268 268 // legal for anyone to override getOwnPropertySlot() without also overriding 269 269 // getOwnPropertySlotByIndex(). 270 271 JSObject* thisObject = jsCast<JSObject*>(cell);272 270 273 271 if (i > MAX_ARRAY_INDEX) -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r153223 r153532 132 132 JSValue get(ExecState*, unsigned propertyName) const; 133 133 134 bool fastGetOwnPropertySlot(ExecState*, PropertyName, PropertySlot&); 134 135 bool getPropertySlot(ExecState*, PropertyName, PropertySlot&); 135 136 bool getPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 136 137 JS_EXPORT_PRIVATE bool getPropertyDescriptor(ExecState*, PropertyName, PropertyDescriptor&); 137 138 138 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);139 JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JS Cell*, ExecState*, unsigned propertyName, PropertySlot&);139 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 140 JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&); 140 141 JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 141 142 … … 1172 1173 // but it makes a big difference to property lookup that derived classes can inline their 1173 1174 // base class call to this. 1174 ALWAYS_INLINE bool JSObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 1175 { 1176 return jsCast<JSObject*>(cell)->inlineGetOwnPropertySlot(exec, propertyName, slot); 1175 ALWAYS_INLINE bool JSObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 1176 { 1177 return object->inlineGetOwnPropertySlot(exec, propertyName, slot); 1178 } 1179 1180 ALWAYS_INLINE bool JSObject::fastGetOwnPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot) 1181 { 1182 if (!structure()->typeInfo().overridesGetOwnPropertySlot()) 1183 return asObject(this)->inlineGetOwnPropertySlot(exec, propertyName, slot); 1184 return methodTable()->getOwnPropertySlot(this, exec, propertyName, slot); 1177 1185 } 1178 1186 -
trunk/Source/JavaScriptCore/runtime/JSProxy.cpp
r148696 r153532 71 71 } 72 72 73 bool JSProxy::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)73 bool JSProxy::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 74 74 { 75 JSProxy* thisObject = jsCast<JSProxy*>( cell);75 JSProxy* thisObject = jsCast<JSProxy*>(object); 76 76 return thisObject->target()->methodTable()->getOwnPropertySlot(thisObject->target(), exec, propertyName, slot); 77 77 } 78 78 79 bool JSProxy::getOwnPropertySlotByIndex(JS Cell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)79 bool JSProxy::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot) 80 80 { 81 JSProxy* thisObject = jsCast<JSProxy*>( cell);81 JSProxy* thisObject = jsCast<JSProxy*>(object); 82 82 return thisObject->target()->methodTable()->getOwnPropertySlotByIndex(thisObject->target(), exec, propertyName, slot); 83 83 } -
trunk/Source/JavaScriptCore/runtime/JSProxy.h
r148696 r153532 75 75 76 76 JS_EXPORT_PRIVATE static String className(const JSObject*); 77 JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);78 JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JS Cell*, ExecState*, unsigned, PropertySlot&);77 JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 78 JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned, PropertySlot&); 79 79 JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 80 80 JS_EXPORT_PRIVATE static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r153247 r153532 231 231 } 232 232 233 JS String* JSRopeString::getIndexSlowCase(ExecState* exec, unsigned i)233 JS_EXPORT JSString* JSRopeString::getIndexSlowCase(ExecState* exec, unsigned i) 234 234 { 235 235 ASSERT(isRope()); … … 284 284 } 285 285 286 bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)287 {288 JSString* thisObject = jsCast<JSString*>(cell);289 // The semantics here are really getPropertySlot, not getOwnPropertySlot.290 // This function should only be called by JSValue::get.291 if (thisObject->getStringPropertySlot(exec, propertyName, slot))292 return true;293 slot.setBase(thisObject);294 JSObject* object;295 for (JSValue prototype = exec->lexicalGlobalObject()->stringPrototype(); !prototype.isNull(); prototype = object->prototype()) {296 object = asObject(prototype);297 if (object->methodTable()->getOwnPropertySlot(object, exec, propertyName, slot))298 return true;299 }300 slot.setUndefined();301 return true;302 }303 304 286 bool JSString::getStringPropertyDescriptor(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor) 305 287 { … … 319 301 } 320 302 321 bool JSString::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)322 {323 JSString* thisObject = jsCast<JSString*>(cell);324 // The semantics here are really getPropertySlot, not getOwnPropertySlot.325 // This function should only be called by JSValue::get.326 if (thisObject->getStringPropertySlot(exec, propertyName, slot))327 return true;328 return JSString::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);329 }330 331 303 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSString.h
r153240 r153532 204 204 static JSValue toThis(JSCell*, ExecState*, ECMAMode); 205 205 206 // Actually getPropertySlot, not getOwnPropertySlot (see JSCell).207 static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);208 static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);209 210 206 String& string() { ASSERT(!isRope()); return m_value; } 211 207 -
trunk/Source/JavaScriptCore/runtime/NamePrototype.cpp
r148696 r153532 59 59 } 60 60 61 bool NamePrototype::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)61 bool NamePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 62 62 { 63 return getStaticFunctionSlot<Base>(exec, ExecState::privateNamePrototypeTable(exec), jsCast<NamePrototype*>( cell), propertyName, slot);63 return getStaticFunctionSlot<Base>(exec, ExecState::privateNamePrototypeTable(exec), jsCast<NamePrototype*>(object), propertyName, slot); 64 64 } 65 65 -
trunk/Source/JavaScriptCore/runtime/NamePrototype.h
r148696 r153532 56 56 57 57 private: 58 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);58 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 59 59 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 60 60 }; -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r148696 r153532 73 73 } 74 74 75 bool NumberConstructor::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)75 bool NumberConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 76 76 { 77 return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), jsCast<NumberConstructor*>( cell), propertyName, slot);77 return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), jsCast<NumberConstructor*>(object), propertyName, slot); 78 78 } 79 79 -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.h
r148696 r153532 41 41 static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); 42 42 43 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);43 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 44 44 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 45 45 JSValue getValueProperty(ExecState*, int token) const; -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r153240 r153532 84 84 } 85 85 86 bool NumberPrototype::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)87 { 88 return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), jsCast<NumberPrototype*>( cell), propertyName, slot);86 bool NumberPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 87 { 88 return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), jsCast<NumberPrototype*>(object), propertyName, slot); 89 89 } 90 90 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.h
r148696 r153532 50 50 private: 51 51 NumberPrototype(ExecState*, Structure*); 52 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);52 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 53 53 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 54 54 }; -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r153218 r153532 95 95 } 96 96 97 bool ObjectConstructor::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)98 { 99 return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), jsCast<ObjectConstructor*>( cell), propertyName, slot);97 bool ObjectConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 98 { 99 return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), jsCast<ObjectConstructor*>(object), propertyName, slot); 100 100 } 101 101 -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h
r148696 r153532 41 41 } 42 42 43 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);43 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 44 44 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 45 45 -
trunk/Source/JavaScriptCore/runtime/PropertySlot.h
r153454 r153532 195 195 { 196 196 return m_slotBase; 197 }198 199 void setBase(JSValue base)200 {201 ASSERT(m_slotBase);202 ASSERT(base);203 m_slotBase = base;204 197 } 205 198 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r148696 r153532 154 154 } 155 155 156 bool RegExpConstructor::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)157 { 158 return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), jsCast<RegExpConstructor*>( cell), propertyName, slot);156 bool RegExpConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 157 { 158 return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), jsCast<RegExpConstructor*>(object), propertyName, slot); 159 159 } 160 160 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h
r148696 r153532 51 51 static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); 52 52 53 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);53 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 54 54 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 55 55 -
trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
r148696 r153532 68 68 } 69 69 70 static bool getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)70 static bool getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 71 71 { 72 RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>( cell);72 RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(object); 73 73 thisObject->reifyAllPropertiesIfNecessary(exec); 74 74 return JSArray::getOwnPropertySlot(thisObject, exec, propertyName, slot); 75 75 } 76 76 77 static bool getOwnPropertySlotByIndex(JS Cell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)77 static bool getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot) 78 78 { 79 RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>( cell);79 RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(object); 80 80 if (propertyName) 81 81 thisObject->reifyAllPropertiesIfNecessary(exec); -
trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp
r148696 r153532 90 90 } 91 91 92 bool RegExpObject::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)92 bool RegExpObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 93 93 { 94 94 if (propertyName == exec->propertyNames().lastIndex) { 95 RegExpObject* regExp = asRegExpObject( cell);95 RegExpObject* regExp = asRegExpObject(object); 96 96 slot.setValue(regExp, regExp->getLastIndex()); 97 97 return true; 98 98 } 99 return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), jsCast<RegExpObject*>( cell), propertyName, slot);99 return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), jsCast<RegExpObject*>(object), propertyName, slot); 100 100 } 101 101 -
trunk/Source/JavaScriptCore/runtime/RegExpObject.h
r148696 r153532 71 71 JSValue exec(ExecState*, JSString*); 72 72 73 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);73 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 74 74 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 75 75 static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r148696 r153532 66 66 } 67 67 68 bool RegExpPrototype::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)68 bool RegExpPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 69 69 { 70 return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), jsCast<RegExpPrototype*>( cell), propertyName, slot);70 return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), jsCast<RegExpPrototype*>(object), propertyName, slot); 71 71 } 72 72 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h
r148696 r153532 50 50 51 51 private: 52 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);52 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 53 53 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 54 54 }; -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r148696 r153532 61 61 } 62 62 63 bool StringConstructor::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)63 bool StringConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 64 64 { 65 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), jsCast<StringConstructor*>( cell), propertyName, slot);65 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), jsCast<StringConstructor*>(object), propertyName, slot); 66 66 } 67 67 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r148696 r153532 55 55 static CallType getCallData(JSCell*, CallData&); 56 56 57 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);57 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 58 58 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 59 59 }; -
trunk/Source/JavaScriptCore/runtime/StringObject.cpp
r148696 r153532 45 45 } 46 46 47 bool StringObject::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)47 bool StringObject::getOwnPropertySlot(JSObject* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 48 48 { 49 49 StringObject* thisObject = jsCast<StringObject*>(cell); … … 53 53 } 54 54 55 bool StringObject::getOwnPropertySlotByIndex(JS Cell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)55 bool StringObject::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot) 56 56 { 57 StringObject* thisObject = jsCast<StringObject*>( cell);57 StringObject* thisObject = jsCast<StringObject*>(object); 58 58 if (thisObject->internalValue()->getStringPropertySlot(exec, propertyName, slot)) 59 59 return true; -
trunk/Source/JavaScriptCore/runtime/StringObject.h
r148696 r153532 46 46 static StringObject* create(ExecState*, JSGlobalObject*, JSString*); 47 47 48 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);49 static bool getOwnPropertySlotByIndex(JS Cell*, ExecState*, unsigned propertyName, PropertySlot&);48 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 49 static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&); 50 50 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 51 51 -
trunk/Source/WebCore/ChangeLog
r153531 r153532 1 2013-07-30 Gavin Barraclough <barraclough@apple.com> 2 3 Some cleanup in JSValue::get 4 https://bugs.webkit.org/show_bug.cgi?id=119343 5 6 Reviewed by Geoff Garen. 7 8 * WebCore.exp.in: 9 * bindings/js/JSDOMWindowCustom.cpp: 10 (WebCore::JSDOMWindow::getOwnPropertySlot): 11 (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): 12 * bindings/scripts/CodeGeneratorJS.pm: 13 (GenerateHeader): 14 (GenerateImplementation): 15 (GenerateConstructorDeclaration): 16 (GenerateConstructorHelperMethods): 17 * bridge/objc/objc_runtime.h: 18 * bridge/objc/objc_runtime.mm: 19 (JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertySlot): 20 * bridge/runtime_array.cpp: 21 (JSC::RuntimeArray::getOwnPropertySlot): 22 (JSC::RuntimeArray::getOwnPropertySlotByIndex): 23 * bridge/runtime_array.h: 24 * bridge/runtime_method.cpp: 25 (JSC::RuntimeMethod::getOwnPropertySlot): 26 * bridge/runtime_method.h: 27 * bridge/runtime_object.cpp: 28 (JSC::Bindings::RuntimeObject::getOwnPropertySlot): 29 * bridge/runtime_object.h: 30 - getOwnPropertySlot, JSCell -> JSObject 31 1 32 2013-07-31 Alexey Proskuryakov <ap@apple.com> 2 33 -
trunk/Source/WebCore/WebCore.exp.in
r153515 r153532 2638 2638 __ZN3JSC13RuntimeMethod11getCallDataEPNS_6JSCellERNS_8CallDataE 2639 2639 __ZN3JSC13RuntimeMethod14finishCreationERNS_2VMERKN3WTF6StringE 2640 __ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_ 6JSCellEPNS_9ExecStateENS_12PropertyNameERNS_12PropertySlotE2640 __ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_12PropertySlotE 2641 2641 __ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_18PropertyDescriptorE 2642 2642 __ZN3JSC13RuntimeMethod6s_infoE … … 2648 2648 __ZN3JSC8Bindings13RuntimeObject14finishCreationEPNS_14JSGlobalObjectE 2649 2649 __ZN3JSC8Bindings13RuntimeObject16getConstructDataEPNS_6JSCellERNS_13ConstructDataE 2650 __ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_ 6JSCellEPNS_9ExecStateENS_12PropertyNameERNS_12PropertySlotE2650 __ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_12PropertySlotE 2651 2651 __ZN3JSC8Bindings13RuntimeObject19getOwnPropertyNamesEPNS_8JSObjectEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE 2652 2652 __ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_18PropertyDescriptorE -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r150311 r153532 111 111 } 112 112 113 bool JSDOMWindow::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)114 { 115 JSDOMWindow* thisObject = jsCast<JSDOMWindow*>( cell);113 bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 114 { 115 JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object); 116 116 // When accessing a Window cross-domain, functions are always the native built-in ones, and they 117 117 // are not affected by properties changed on the Window or anything in its prototype chain. … … 257 257 } 258 258 259 bool JSDOMWindow::getOwnPropertySlotByIndex(JS Cell* cell, ExecState* exec, unsigned index, PropertySlot& slot)260 { 261 JSDOMWindow* thisObject = jsCast<JSDOMWindow*>( cell);259 bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot) 260 { 261 JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object); 262 262 263 263 if (!thisObject->impl()->frame()) { -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r153145 r153532 791 791 # Getters 792 792 if ($hasGetter) { 793 push(@headerContent, " static bool getOwnPropertySlot(JSC::JS Cell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");793 push(@headerContent, " static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); 794 794 push(@headerContent, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n"); 795 push(@headerContent, " static bool getOwnPropertySlotByIndex(JSC::JS Cell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n") if ($hasComplexGetter);795 push(@headerContent, " static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n") if ($hasComplexGetter); 796 796 push(@headerContent, " bool getOwnPropertySlotDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n") if $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}; 797 797 push(@headerContent, " bool getOwnPropertyDescriptorDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n") if $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}; … … 1020 1020 1021 1021 if ($interface->extendedAttributes->{"JSInlineGetOwnPropertySlot"} && !$interface->extendedAttributes->{"CustomGetOwnPropertySlot"}) { 1022 push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertySlot(JSC::JS Cell* cell, JSC::ExecState* exec, JSC::PropertyName propertyName, JSC::PropertySlot& slot)\n");1022 push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertySlot(JSC::JSObject* object, JSC::ExecState* exec, JSC::PropertyName propertyName, JSC::PropertySlot& slot)\n"); 1023 1023 push(@headerContent, "{\n"); 1024 push(@headerContent, " ${className}* thisObject = JSC::jsCast<${className}*>( cell);\n");1024 push(@headerContent, " ${className}* thisObject = JSC::jsCast<${className}*>(object);\n"); 1025 1025 push(@headerContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); 1026 1026 push(@headerContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numAttributes > 0, 1)); … … 1098 1098 push(@headerContent, " static const JSC::ClassInfo s_info;\n"); 1099 1099 if ($numFunctions > 0 || $numConstants > 0) { 1100 push(@headerContent, " static bool getOwnPropertySlot(JSC::JS Cell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");1100 push(@headerContent, " static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); 1101 1101 push(@headerContent, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n"); 1102 1102 $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1; … … 1769 1769 1770 1770 if ($numConstants > 0 || $numFunctions > 0) { 1771 push(@implContent, "bool ${className}Prototype::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n");1771 push(@implContent, "bool ${className}Prototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n"); 1772 1772 push(@implContent, "{\n"); 1773 push(@implContent, " ${className}Prototype* thisObject = jsCast<${className}Prototype*>( cell);\n");1773 push(@implContent, " ${className}Prototype* thisObject = jsCast<${className}Prototype*>(object);\n"); 1774 1774 1775 1775 if ($numConstants eq 0 && $numFunctions eq 0) { … … 1921 1921 if ($hasGetter) { 1922 1922 if (!$interface->extendedAttributes->{"JSInlineGetOwnPropertySlot"} && !$interface->extendedAttributes->{"CustomGetOwnPropertySlot"}) { 1923 push(@implContent, "bool ${className}::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n");1923 push(@implContent, "bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n"); 1924 1924 push(@implContent, "{\n"); 1925 push(@implContent, " ${className}* thisObject = jsCast<${className}*>( cell);\n");1925 push(@implContent, " ${className}* thisObject = jsCast<${className}*>(object);\n"); 1926 1926 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); 1927 1927 push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numAttributes > 0, 0)); … … 1938 1938 || $interface->extendedAttributes->{"CustomNamedGetter"} 1939 1939 || $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}) { 1940 push(@implContent, "bool ${className}::getOwnPropertySlotByIndex(JS Cell* cell, ExecState* exec, unsigned index, PropertySlot& slot)\n");1940 push(@implContent, "bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot)\n"); 1941 1941 push(@implContent, "{\n"); 1942 push(@implContent, " ${className}* thisObject = jsCast<${className}*>( cell);\n");1942 push(@implContent, " ${className}* thisObject = jsCast<${className}*>(object);\n"); 1943 1943 push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n"); 1944 1944 … … 3883 3883 push(@$outputArray, " }\n\n"); 3884 3884 3885 push(@$outputArray, " static bool getOwnPropertySlot(JSC::JS Cell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");3885 push(@$outputArray, " static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); 3886 3886 push(@$outputArray, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);\n"); 3887 3887 push(@$outputArray, " static const JSC::ClassInfo s_info;\n"); … … 4265 4265 my $kind = $hasStaticFunctions ? "Property" : "Value"; 4266 4266 4267 push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n");4267 push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)\n"); 4268 4268 push(@$outputArray, "{\n"); 4269 push(@$outputArray, " return getStatic${kind}Slot<${constructorClassName}, JSDOMWrapper>(exec, " . constructorHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $constructorClassName) . ", jsCast<${constructorClassName}*>( cell), propertyName, slot);\n");4269 push(@$outputArray, " return getStatic${kind}Slot<${constructorClassName}, JSDOMWrapper>(exec, " . constructorHashTableAccessor($interface->extendedAttributes->{"JSNoStaticTables"}, $constructorClassName) . ", jsCast<${constructorClassName}*>(object), propertyName, slot);\n"); 4270 4270 push(@$outputArray, "}\n\n"); 4271 4271 -
trunk/Source/WebCore/bridge/objc/objc_runtime.h
r148696 r153532 125 125 static void destroy(JSCell*); 126 126 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags; 127 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);127 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 128 128 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 129 129 static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); -
trunk/Source/WebCore/bridge/objc/objc_runtime.mm
r149255 r153532 209 209 } 210 210 211 bool ObjcFallbackObjectImp::getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot& slot)211 bool ObjcFallbackObjectImp::getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot& slot) 212 212 { 213 213 // keep the prototype from getting called instead of just returning false -
trunk/Source/WebCore/bridge/runtime_array.cpp
r151747 r153532 86 86 } 87 87 88 bool RuntimeArray::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)88 bool RuntimeArray::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 89 89 { 90 RuntimeArray* thisObject = jsCast<RuntimeArray*>( cell);90 RuntimeArray* thisObject = jsCast<RuntimeArray*>(object); 91 91 if (propertyName == exec->propertyNames().length) { 92 92 slot.setCacheableCustom(thisObject, thisObject->lengthGetter); … … 126 126 } 127 127 128 bool RuntimeArray::getOwnPropertySlotByIndex(JS Cell* cell, ExecState *exec, unsigned index, PropertySlot& slot)128 bool RuntimeArray::getOwnPropertySlotByIndex(JSObject* object, ExecState *exec, unsigned index, PropertySlot& slot) 129 129 { 130 RuntimeArray* thisObject = jsCast<RuntimeArray*>( cell);130 RuntimeArray* thisObject = jsCast<RuntimeArray*>(object); 131 131 if (index < thisObject->getLength()) { 132 132 slot.setCustomIndex(thisObject, index, thisObject->indexGetter); -
trunk/Source/WebCore/bridge/runtime_array.h
r148696 r153532 54 54 55 55 static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 56 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);57 static bool getOwnPropertySlotByIndex(JS Cell*, ExecState*, unsigned, PropertySlot&);56 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 57 static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned, PropertySlot&); 58 58 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 59 59 static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); -
trunk/Source/WebCore/bridge/runtime_method.cpp
r148696 r153532 62 62 } 63 63 64 bool RuntimeMethod::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot &slot)64 bool RuntimeMethod::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) 65 65 { 66 RuntimeMethod* thisObject = jsCast<RuntimeMethod*>( cell);66 RuntimeMethod* thisObject = jsCast<RuntimeMethod*>(object); 67 67 if (propertyName == exec->propertyNames().length) { 68 68 slot.setCacheableCustom(thisObject, thisObject->lengthGetter); -
trunk/Source/WebCore/bridge/runtime_method.h
r148696 r153532 65 65 static CallType getCallData(JSCell*, CallData&); 66 66 67 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);67 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 68 68 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 69 69 -
trunk/Source/WebCore/bridge/runtime_object.cpp
r148696 r153532 117 117 } 118 118 119 bool RuntimeObject::getOwnPropertySlot(JS Cell* cell, ExecState *exec, PropertyName propertyName, PropertySlot& slot)120 { 121 RuntimeObject* thisObject = jsCast<RuntimeObject*>( cell);119 bool RuntimeObject::getOwnPropertySlot(JSObject* object, ExecState *exec, PropertyName propertyName, PropertySlot& slot) 120 { 121 RuntimeObject* thisObject = jsCast<RuntimeObject*>(object); 122 122 if (!thisObject->m_instance) { 123 123 throwInvalidAccessError(exec); -
trunk/Source/WebCore/bridge/runtime_object.h
r148696 r153532 46 46 static void destroy(JSCell*); 47 47 48 static bool getOwnPropertySlot(JS Cell*, ExecState*, PropertyName, PropertySlot&);48 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 49 49 static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); 50 50 static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); -
trunk/Source/WebKit2/ChangeLog
r153520 r153532 1 2013-07-30 Gavin Barraclough <barraclough@apple.com> 2 3 Some cleanup in JSValue::get 4 https://bugs.webkit.org/show_bug.cgi?id=119343 5 6 Reviewed by Geoff Garen. 7 8 * WebProcess/Plugins/Netscape/JSNPObject.cpp: 9 (WebKit::JSNPObject::getOwnPropertySlot): 10 * WebProcess/Plugins/Netscape/JSNPObject.h: 11 - getOwnPropertySlot, JSCell -> JSObject 12 1 13 2013-07-31 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 14 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
r148696 r153532 259 259 } 260 260 261 bool JSNPObject::getOwnPropertySlot(JS Cell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)262 { 263 JSNPObject* thisObject = JSC::jsCast<JSNPObject*>( cell);261 bool JSNPObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 262 { 263 JSNPObject* thisObject = JSC::jsCast<JSNPObject*>(object); 264 264 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); 265 265 if (!thisObject->m_npObject) { -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
r148696 r153532 86 86 static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&); 87 87 88 static bool getOwnPropertySlot(JSC::JS Cell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);88 static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&); 89 89 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&); 90 90 static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
Note: See TracChangeset
for help on using the changeset viewer.