Changeset 178984 in webkit for trunk/Source/JavaScriptCore/heap


Ignore:
Timestamp:
Jan 22, 2015, 11:04:05 PM (10 years ago)
Author:
[email protected]
Message:

EdenCollections unnecessarily visit SmallStrings
https://bugs.webkit.org/show_bug.cgi?id=140762

Reviewed by Geoffrey Garen.

  • heap/Heap.cpp:

(JSC::Heap::copyBackingStores): Also added a GCPhase for copying
backing stores, which is a significant portion of garbage collection.
(JSC::Heap::visitSmallStrings): Check to see if we need to visit
SmallStrings based on the collection type.

  • runtime/SmallStrings.cpp:

(JSC::SmallStrings::SmallStrings):
(JSC::SmallStrings::visitStrongReferences): Set the fact that we have
visited the SmallStrings since the last modification.

  • runtime/SmallStrings.h:

(JSC::SmallStrings::needsToBeVisited): If we're doing a
FullCollection, we need to visit. Otherwise, it depends on whether
we've been visited since the last modification/allocation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r178884 r178984  
    548548void Heap::copyBackingStores()
    549549{
     550    GCPHASE(CopyBackingStores);
    550551    if (m_operationInProgress == EdenCollection)
    551552        m_storageSpace.startedCopying<EdenCollection>();
     
    612613{
    613614    GCPHASE(VisitSmallStrings);
     615    if (!m_vm->smallStrings.needsToBeVisited(m_operationInProgress))
     616        return;
     617
    614618    m_vm->smallStrings.visitStrongReferences(m_slotVisitor);
    615 
    616619    if (Options::logGC() == GCLogging::Verbose)
    617620        dataLog("Small strings:\n", m_slotVisitor);
    618 
    619621    m_slotVisitor.donateAndDrain();
    620622}
Note: See TracChangeset for help on using the changeset viewer.