From: mjs@apple.com Date: Thu, 16 Oct 2008 11:11:24 +0000 (+0000) Subject: 2008-10-16 Maciej Stachowiak X-Git-Url: https://git.webkit.org/?p=WebKit.git;a=commitdiff_plain;h=389fb965c8deb837ef149c49d00453b880ec4d83 2008-10-16 Maciej Stachowiak Reviewed by Cameron Zwarich. - fix for: REGRESSION: over 100 StructureIDs leak loading about:blank (result of fix for bug 21633) Apparent slight progression (< 0.5%) on v8 benchmarks and SunSpider. * kjs/StructureID.cpp: (JSC::StructureID::~StructureID): Don't deref this object's parent's pointer to itself from the destructor; that doesn't even make sense. (JSC::StructureID::addPropertyTransition): Don't refer the single transition; the rule is that parent StructureIDs are ref'd but child ones are not. Refing the child creates a cycle. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37632 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index 040e37afe5f2..3a9c4028571a 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,3 +1,18 @@ +2008-10-16 Maciej Stachowiak + + Reviewed by Cameron Zwarich. + + - fix for: REGRESSION: over 100 StructureIDs leak loading about:blank (result of fix for bug 21633) + + Apparent slight progression (< 0.5%) on v8 benchmarks and SunSpider. + + * kjs/StructureID.cpp: + (JSC::StructureID::~StructureID): Don't deref this object's parent's pointer to + itself from the destructor; that doesn't even make sense. + (JSC::StructureID::addPropertyTransition): Don't refer the single transition; + the rule is that parent StructureIDs are ref'd but child ones are not. Refing + the child creates a cycle. + 2008-10-15 Alexey Proskuryakov Reviewed by Darin Adler. diff --git a/JavaScriptCore/kjs/StructureID.cpp b/JavaScriptCore/kjs/StructureID.cpp index b2db9b9176b8..f72fdd2e17a7 100644 --- a/JavaScriptCore/kjs/StructureID.cpp +++ b/JavaScriptCore/kjs/StructureID.cpp @@ -108,7 +108,6 @@ StructureID::~StructureID() { if (m_previous) { if (m_previous->m_usingSingleTransitionSlot) { - m_previous->m_transitions.singleTransition->deref(); m_previous->m_transitions.singleTransition = 0; } else { ASSERT(m_previous->m_transitions.table->contains(make_pair(m_nameInPrevious, m_attributesInPrevious))); @@ -119,10 +118,7 @@ StructureID::~StructureID() if (m_cachedPropertyNameArrayData) m_cachedPropertyNameArrayData->setCachedStructureID(0); - if (m_usingSingleTransitionSlot) { - if (m_transitions.singleTransition) - m_transitions.singleTransition->deref(); - } else + if (!m_usingSingleTransitionSlot) delete m_transitions.table; #ifndef NDEBUG @@ -265,7 +261,6 @@ PassRefPtr StructureID::addPropertyTransition(StructureID* structur if (structureID->m_usingSingleTransitionSlot) { if (!structureID->m_transitions.singleTransition) { structureID->m_transitions.singleTransition = transition.get(); - transition->ref(); return transition.release(); } @@ -274,7 +269,6 @@ PassRefPtr StructureID::addPropertyTransition(StructureID* structur TransitionTable* transitionTable = new TransitionTable; structureID->m_transitions.table = transitionTable; transitionTable->add(make_pair(existingTransition->m_nameInPrevious, existingTransition->m_attributesInPrevious), existingTransition); - existingTransition->deref(); } structureID->m_transitions.table->add(make_pair(propertyName.ustring().rep(), attributes), transition.get()); return transition.release();