Changeset 147570 in webkit
- Timestamp:
- Apr 3, 2013 11:38:33 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r147558 r147570 1 2013-04-02 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 get_by_pname can become confused when iterating over objects with static properties 4 https://bugs.webkit.org/show_bug.cgi?id=113831 5 6 Reviewed by Geoffrey Garen. 7 8 get_by_pname doesn't take static properties into account when using a JSPropertyNameIterator to directly 9 access an object's backing store. One way to fix this is to not cache any properties when iterating over 10 objects with static properties. This patch fixes the bug that was originally reported on swisscom.ch. 11 12 * fast/js/dom-static-property-for-in-iteration-expected.txt: Added. 13 * fast/js/dom-static-property-for-in-iteration.html: Added. 14 1 15 2013-04-03 Felipe Zimmerle <felipe@zimmerle.org> 2 16 -
trunk/Source/JavaScriptCore/ChangeLog
r147514 r147570 1 2013-04-02 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 get_by_pname can become confused when iterating over objects with static properties 4 https://bugs.webkit.org/show_bug.cgi?id=113831 5 6 Reviewed by Geoffrey Garen. 7 8 get_by_pname doesn't take static properties into account when using a JSPropertyNameIterator to directly 9 access an object's backing store. One way to fix this is to not cache any properties when iterating over 10 objects with static properties. This patch fixes the bug that was originally reported on swisscom.ch. 11 12 * runtime/JSObject.cpp: 13 (JSC::JSObject::getOwnNonIndexPropertyNames): 14 * runtime/JSPropertyNameIterator.cpp: 15 (JSC::JSPropertyNameIterator::create): 16 * runtime/PropertyNameArray.h: 17 (JSC::PropertyNameArray::PropertyNameArray): 18 (JSC::PropertyNameArray::numCacheableSlots): 19 (JSC::PropertyNameArray::setNumCacheableSlots): 20 (PropertyNameArray): 21 1 22 2013-04-02 Geoffrey Garen <ggaren@apple.com> 2 23 -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r146829 r147570 1533 1533 { 1534 1534 getClassPropertyNames(exec, object->classInfo(), propertyNames, mode, object->staticFunctionsReified()); 1535 size_t preStructurePropertyNamesCount = propertyNames.size(); 1535 1536 object->structure()->getPropertyNamesFromStructure(exec->globalData(), propertyNames, mode); 1537 size_t numCacheableSlots = preStructurePropertyNamesCount ? 0 : propertyNames.size(); 1538 propertyNames.setNumCacheableSlots(numCacheableSlots); 1536 1539 } 1537 1540 -
trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
r131088 r147570 55 55 if (!o->structure()->hasNonEnumerableProperties() && !o->structure()->hasGetterSetterProperties() 56 56 && !o->structure()->isUncacheableDictionary() && !o->structure()->typeInfo().overridesGetPropertyNames()) 57 numCacheableSlots = o->structure()->totalStorageSize();57 numCacheableSlots = propertyNames.numCacheableSlots(); 58 58 59 59 JSPropertyNameIterator* jsPropertyNameIterator = new (NotNull, allocateCell<JSPropertyNameIterator>(*exec->heap())) JSPropertyNameIterator(exec, propertyNames.data(), numCacheableSlots); -
trunk/Source/JavaScriptCore/runtime/PropertyNameArray.h
r123989 r147570 56 56 : m_data(PropertyNameArrayData::create()) 57 57 , m_globalData(globalData) 58 , m_numCacheableSlots(0) 58 59 { 59 60 } … … 62 63 : m_data(PropertyNameArrayData::create()) 63 64 , m_globalData(&exec->globalData()) 65 , m_numCacheableSlots(0) 64 66 { 65 67 } … … 84 86 const_iterator end() const { return m_data->propertyNameVector().end(); } 85 87 88 size_t numCacheableSlots() const { return m_numCacheableSlots; } 89 void setNumCacheableSlots(size_t numCacheableSlots) { m_numCacheableSlots = numCacheableSlots; } 90 86 91 private: 87 92 typedef HashSet<StringImpl*, PtrHash<StringImpl*> > IdentifierSet; … … 90 95 IdentifierSet m_set; 91 96 JSGlobalData* m_globalData; 97 size_t m_numCacheableSlots; 92 98 }; 93 99
Note: See TracChangeset
for help on using the changeset viewer.