Ignore:
Timestamp:
Feb 11, 2010, 9:01:07 PM (15 years ago)
Author:
[email protected]
Message:

2010-02-11 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt and Darin Adler.

The rest of the fix for
https://bugs.webkit.org/show_bug.cgi?id=34864 | <rdar://problem/7594198>
Many objects left uncollected after visiting mail.google.com and closing
window


Don't unconditionally hang onto small strings. Instead, hang onto all
small strings as long as any small string is still referenced.


SunSpider reports no change.

  • runtime/Collector.cpp: (JSC::Heap::markRoots): Mark the small strings cache last, so it can check if anything else has kept any strings alive.
  • runtime/SmallStrings.cpp: (JSC::isMarked): (JSC::SmallStrings::markChildren): Only keep our strings alive if some other reference to at least one of them exists, too.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Collector.cpp

    r54672 r54701  
    11231123    if (m_globalData->exception)
    11241124        markStack.append(m_globalData->exception);
    1125     m_globalData->smallStrings.markChildren(markStack);
    11261125    if (m_globalData->functionCodeBlockBeingReparsed)
    11271126        m_globalData->functionCodeBlockBeingReparsed->markAggregate(markStack);
    11281127    if (m_globalData->firstStringifierToMark)
    11291128        JSONObject::markStringifiers(markStack, m_globalData->firstStringifierToMark);
     1129
     1130    // Mark the small strings cache last, since it will clear itself if nothing
     1131    // else has marked it.
     1132    m_globalData->smallStrings.markChildren(markStack);
    11301133
    11311134    markStack.drain();
Note: See TracChangeset for help on using the changeset viewer.