Changeset 161914 in webkit


Ignore:
Timestamp:
Jan 13, 2014 3:50:58 PM (10 years ago)
Author:
mhahnenberg@apple.com
Message:

Performance regression on dromaeo due to generational marking
https://bugs.webkit.org/show_bug.cgi?id=126901

Reviewed by Oliver Hunt.

We were seeing some performance regression with ENABLE_GGC == 0, so this patch
ifdefs out more things to get rid of the additional overhead.

  • heap/Heap.cpp:

(JSC::Heap::markRoots):
(JSC::Heap::writeBarrier):

  • heap/MarkedBlock.cpp:

(JSC::MarkedBlock::clearMarks):
(JSC::MarkedBlock::clearMarksWithCollectionType):

  • heap/MarkedSpace.cpp:

(JSC::MarkedSpace::resetAllocators):

  • heap/MarkedSpace.h:

(JSC::MarkedSpace::didAllocateInBlock):

  • heap/SlotVisitorInlines.h:

(JSC::SlotVisitor::internalAppend):
(JSC::SlotVisitor::reportExtraMemoryUsage):

Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r161900 r161914  
     12014-01-13  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Performance regression on dromaeo due to generational marking
     4        https://bugs.webkit.org/show_bug.cgi?id=126901
     5
     6        Reviewed by Oliver Hunt.
     7
     8        We were seeing some performance regression with ENABLE_GGC == 0, so this patch
     9        ifdefs out more things to get rid of the additional overhead.
     10
     11        * heap/Heap.cpp:
     12        (JSC::Heap::markRoots):
     13        (JSC::Heap::writeBarrier):
     14        * heap/MarkedBlock.cpp:
     15        (JSC::MarkedBlock::clearMarks):
     16        (JSC::MarkedBlock::clearMarksWithCollectionType):
     17        * heap/MarkedSpace.cpp:
     18        (JSC::MarkedSpace::resetAllocators):
     19        * heap/MarkedSpace.h:
     20        (JSC::MarkedSpace::didAllocateInBlock):
     21        * heap/SlotVisitorInlines.h:
     22        (JSC::SlotVisitor::internalAppend):
     23        (JSC::SlotVisitor::reportExtraMemoryUsage):
     24
    1252014-01-13  Brian Burg  <bburg@apple.com>
    226
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r161615 r161914  
    490490    HeapRootVisitor heapRootVisitor(visitor);
    491491
     492#if ENABLE(GGC)
    492493    Vector<const JSCell*> rememberedSet(m_slotVisitor.markStack().size());
    493494    m_slotVisitor.markStack().fillVector(rememberedSet);
     495#endif
    494496
    495497    {
     
    596598    }
    597599
     600#if ENABLE(GGC)
    598601    {
    599602        GCPHASE(ClearRememberedSet);
     
    603606        }
    604607    }
     608#endif
    605609
    606610    GCCOUNTER(VisitedValueCount, visitor.visitCount());
     
    10771081void Heap::writeBarrier(const JSCell* from)
    10781082{
     1083#if ENABLE(GGC)
    10791084    ASSERT_GC_OBJECT_LOOKS_VALID(const_cast<JSCell*>(from));
    10801085    if (!from || !isMarked(from))
     
    10821087    Heap* heap = Heap::heap(from);
    10831088    heap->addToRememberedSet(from);
     1089#else
     1090    UNUSED_PARAM(from);
     1091#endif
    10841092}
    10851093
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp

    r161615 r161914  
    200200void MarkedBlock::clearMarks()
    201201{
     202#if ENABLE(GGC)
    202203    if (heap()->operationInProgress() == JSC::EdenCollection)
    203204        this->clearMarksWithCollectionType<EdenCollection>();
    204205    else
    205206        this->clearMarksWithCollectionType<FullCollection>();
     207#else
     208    this->clearMarksWithCollectionType<FullCollection>();
     209#endif
    206210}
    207211
     
    220224    if (collectionType == FullCollection) {
    221225        m_marks.clearAll();
     226#if ENABLE(GGC)
    222227        m_rememberedSet.clearAll();
     228#endif
    223229    }
    224230
  • trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp

    r161615 r161914  
    146146    m_immortalStructureDestructorSpace.largeAllocator.reset();
    147147
     148#if ENABLE(GGC)
    148149    m_blocksWithNewObjects.clear();
     150#endif
    149151}
    150152
  • trunk/Source/JavaScriptCore/heap/MarkedSpace.h

    r161615 r161914  
    278278inline void MarkedSpace::didAllocateInBlock(MarkedBlock* block)
    279279{
     280#if ENABLE(GGC)
    280281    m_blocksWithNewObjects.append(block);
     282#else
     283    UNUSED_PARAM(block);
     284#endif
    281285}
    282286
  • trunk/Source/JavaScriptCore/heap/SlotVisitorInlines.h

    r161615 r161914  
    102102
    103103    m_bytesVisited += MarkedBlock::blockFor(cell)->cellSize();
    104     m_visitCount++;
    105104       
    106105    MARK_LOG_CHILD(*this, cell);
     
    243242inline void SlotVisitor::reportExtraMemoryUsage(JSCell* owner, size_t size)
    244243{
     244#if ENABLE(GGC)
    245245    // We don't want to double-count the extra memory that was reported in previous collections.
    246246    if (heap()->operationInProgress() == EdenCollection && MarkedBlock::blockFor(owner)->isRemembered(owner))
    247247        return;
     248#else
     249    UNUSED_PARAM(owner);
     250#endif
    248251
    249252    size_t* counter = &m_shared.m_vm->heap.m_extraMemoryUsage;
Note: See TracChangeset for help on using the changeset viewer.