Changeset 37300 in webkit
- Timestamp:
- Oct 4, 2008 2:57:26 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37297 r37300 1 2008-10-04 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 Fix https://bugs.webkit.org/show_bug.cgi?id=21320 6 leaks of PropertyNameArrayData seen on buildbot 7 8 - Fix RefPtr cycle by making PropertyNameArrayData's pointer back 9 to the StructureID a weak pointer. 10 11 * kjs/PropertyNameArray.h: 12 (JSC::PropertyNameArrayData::setCachedStructureID): 13 (JSC::PropertyNameArrayData::cachedStructureID): 14 * kjs/StructureID.cpp: 15 (JSC::StructureID::getEnumerablePropertyNames): 16 (JSC::StructureID::clearEnumerationCache): 17 (JSC::StructureID::~StructureID): 18 1 19 2008-10-04 Darin Adler <darin@apple.com> 2 20 -
trunk/JavaScriptCore/kjs/PropertyNameArray.h
r36789 r37300 42 42 PropertyNameVector& propertyNameVector() { return m_propertyNameVector; } 43 43 44 void setCachedStructureID( PassRefPtr<StructureID>structureID) { m_cachedStructureID = structureID; }45 StructureID* cachedStructureID() const { return m_cachedStructureID .get(); }44 void setCachedStructureID(StructureID* structureID) { m_cachedStructureID = structureID; } 45 StructureID* cachedStructureID() const { return m_cachedStructureID; } 46 46 47 47 void setCachedPrototypeChain(PassRefPtr<StructureIDChain> cachedPrototypeChain) { m_cachedPrototypeChain = cachedPrototypeChain; } … … 50 50 private: 51 51 PropertyNameArrayData() 52 : m_cachedStructureID(0) 52 53 { 53 54 } 54 55 55 56 PropertyNameVector m_propertyNameVector; 56 RefPtr<StructureID>m_cachedStructureID;57 StructureID* m_cachedStructureID; 57 58 RefPtr<StructureIDChain> m_cachedPrototypeChain; 58 59 }; -
trunk/JavaScriptCore/kjs/StructureID.cpp
r36977 r37300 82 82 83 83 if (shouldCache) { 84 if (m_cachedPropertyNameArrayData) 85 m_cachedPropertyNameArrayData->setCachedStructureID(0); 86 84 87 m_cachedPropertyNameArrayData = propertyNames.data(); 85 88 … … 94 97 void StructureID::clearEnumerationCache() 95 98 { 99 if (m_cachedPropertyNameArrayData) 100 m_cachedPropertyNameArrayData->setCachedStructureID(0); 96 101 m_cachedPropertyNameArrayData.clear(); 97 102 } … … 183 188 m_previous->m_transitionTable.remove(make_pair(m_nameInPrevious, m_attributesInPrevious)); 184 189 } 190 191 if (m_cachedPropertyNameArrayData) 192 m_cachedPropertyNameArrayData->setCachedStructureID(0); 185 193 } 186 194
Note: See TracChangeset
for help on using the changeset viewer.