Ignore:
Timestamp:
Aug 1, 2012, 11:55:03 AM (13 years ago)
Author:
[email protected]
Message:

MarkedBlock::sweep() should sweep another block if it can't sweep a Structure block
https://bugs.webkit.org/show_bug.cgi?id=92819

Reviewed by Geoffrey Garen.

If we are forced to allocate a new block for Structures because we are unable to safely
sweep our pre-existing Structure blocks, we should sweep another random block so that we
can start sweeping Structure blocks sooner.

  • heap/IncrementalSweeper.cpp:

(JSC::IncrementalSweeper::doSweep): Change to use sweepNextBlock.
(JSC):
(JSC::IncrementalSweeper::sweepNextBlock):

  • heap/IncrementalSweeper.h:

(IncrementalSweeper):

  • heap/MarkedAllocator.cpp:

(JSC::MarkedAllocator::tryAllocateHelper): When we can't safely sweep
our Structure blocks, call sweepNextBlock instead.

File:
1 edited

Legend:

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

    r124265 r124352  
    7474{
    7575    while (m_currentBlockToSweepIndex < m_blocksToSweep.size()) {
     76        sweepNextBlock();
     77
     78        CFTimeInterval elapsedTime = WTF::monotonicallyIncreasingTime() - sweepBeginTime;
     79        if (elapsedTime < sweepTimeSlice)
     80            continue;
     81
     82        scheduleTimer();
     83        return;
     84    }
     85
     86    m_blocksToSweep.clear();
     87    cancelTimer();
     88}
     89
     90void IncrementalSweeper::sweepNextBlock()
     91{
     92    while (m_currentBlockToSweepIndex < m_blocksToSweep.size()) {
    7693        MarkedBlock* block = m_blocksToSweep[m_currentBlockToSweepIndex++];
    7794        if (block->onlyContainsStructures())
     
    85102        block->sweep();
    86103        m_globalData->heap.objectSpace().freeOrShrinkBlock(block);
    87 
    88         CFTimeInterval elapsedTime = WTF::monotonicallyIncreasingTime() - sweepBeginTime;
    89         if (elapsedTime < sweepTimeSlice)
    90             continue;
    91 
    92         scheduleTimer();
    93104        return;
    94105    }
    95 
    96     m_blocksToSweep.clear();
    97     cancelTimer();
    98106}
    99107
     
    144152}
    145153
     154void IncrementalSweeper::sweepNextBlock()
     155{
     156}
     157
    146158#endif
    147159
Note: See TracChangeset for help on using the changeset viewer.