Changeset 124141 in webkit


Ignore:
Timestamp:
Jul 30, 2012 6:48:18 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r124123.
http://trac.webkit.org/changeset/124123
https://bugs.webkit.org/show_bug.cgi?id=92700

ASSERT crashes terminate webkit Layout tests (Requested by
msaboff on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-07-30

  • heap/Heap.cpp:
  • heap/Heap.h:

(Heap):

  • heap/IncrementalSweeper.cpp:

(JSC::IncrementalSweeper::doSweep):
(JSC::IncrementalSweeper::startSweeping):
(JSC::IncrementalSweeper::IncrementalSweeper):
(JSC):

  • heap/IncrementalSweeper.h:

(IncrementalSweeper):

  • heap/MarkedAllocator.cpp:

(JSC::MarkedAllocator::tryAllocateHelper):
(JSC::MarkedAllocator::addBlock):

  • heap/MarkedAllocator.h:

(JSC::MarkedAllocator::zapFreeList):

  • heap/MarkedBlock.cpp:

(JSC::MarkedBlock::sweepHelper):

  • heap/MarkedSpace.cpp:
  • heap/MarkedSpace.h:

(JSC::MarkedSpace::sweep):
(JSC):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::~JSGlobalData):

Location:
trunk/Source/JavaScriptCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r124123 r124141  
     12012-07-30  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r124123.
     4        http://trac.webkit.org/changeset/124123
     5        https://bugs.webkit.org/show_bug.cgi?id=92700
     6
     7        ASSERT crashes terminate webkit Layout tests (Requested by
     8        msaboff on #webkit).
     9
     10        * heap/Heap.cpp:
     11        * heap/Heap.h:
     12        (Heap):
     13        * heap/IncrementalSweeper.cpp:
     14        (JSC::IncrementalSweeper::doSweep):
     15        (JSC::IncrementalSweeper::startSweeping):
     16        (JSC::IncrementalSweeper::IncrementalSweeper):
     17        (JSC):
     18        * heap/IncrementalSweeper.h:
     19        (IncrementalSweeper):
     20        * heap/MarkedAllocator.cpp:
     21        (JSC::MarkedAllocator::tryAllocateHelper):
     22        (JSC::MarkedAllocator::addBlock):
     23        * heap/MarkedAllocator.h:
     24        (JSC::MarkedAllocator::zapFreeList):
     25        * heap/MarkedBlock.cpp:
     26        (JSC::MarkedBlock::sweepHelper):
     27        * heap/MarkedSpace.cpp:
     28        * heap/MarkedSpace.h:
     29        (JSC::MarkedSpace::sweep):
     30        (JSC):
     31        * runtime/JSGlobalData.cpp:
     32        (JSC::JSGlobalData::~JSGlobalData):
     33
    1342012-07-30  Mark Hahnenberg  <mhahnenberg@apple.com>
    235
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r124123 r124141  
    831831}
    832832
    833 bool Heap::isSafeToSweepStructures()
    834 {
    835     return !m_sweeper || m_sweeper->structuresCanBeSwept();
    836 }
    837 
    838 void Heap::didStartVMShutdown()
    839 {
    840     m_activityCallback->didStartVMShutdown();
    841     m_activityCallback = 0;
    842     m_sweeper->didStartVMShutdown();
    843     m_sweeper = 0;
    844     lastChanceToFinalize();
    845 }
    846 
    847833} // namespace JSC
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r124123 r124141  
    169169
    170170        bool isPagedOut(double deadline);
    171         bool isSafeToSweepStructures();
    172         void didStartVMShutdown();
    173171
    174172    private:
  • trunk/Source/JavaScriptCore/heap/IncrementalSweeper.cpp

    r124123 r124141  
    7070}
    7171
    72 bool IncrementalSweeper::structuresCanBeSwept()
    73 {
    74     ASSERT(m_currentBlockToSweepIndex <= m_blocksToSweep.size());
    75     return !m_blocksToSweep.size() || m_currentBlockToSweepIndex >= m_blocksToSweep.size();
    76 }
    77 
    7872void IncrementalSweeper::doSweep(double sweepBeginTime)
    7973{
    8074    while (m_currentBlockToSweepIndex < m_blocksToSweep.size()) {
    81         MarkedBlock* block = m_blocksToSweep[m_currentBlockToSweepIndex];
    82         if (block->onlyContainsStructures()) {
    83             m_currentBlockToSweepIndex++;
    84             continue;
    85         }
    86 
    87         m_blocksToSweep[m_currentBlockToSweepIndex++] = 0;
    88 
    89         if (!block->needsSweeping())
    90             continue;
    91 
    92         block->sweep();
    93         m_globalData->heap.objectSpace().freeOrShrinkBlock(block);
    94 
    95         CFTimeInterval elapsedTime = WTF::monotonicallyIncreasingTime() - sweepBeginTime;
    96         if (elapsedTime < sweepTimeSlice)
    97             continue;
    98 
    99         scheduleTimer();
    100         return;
    101     }
    102 
    103     while (m_currentStructureBlockToSweepIndex < m_blocksToSweep.size()) {
    104         MarkedBlock* block = m_blocksToSweep[m_currentStructureBlockToSweepIndex];
    105         if (!block) {
    106             m_currentStructureBlockToSweepIndex++;
    107             continue;
    108         }
    109 
    110         m_blocksToSweep[m_currentStructureBlockToSweepIndex++] = 0;
    111 
     75        MarkedBlock* block = m_blocksToSweep[m_currentBlockToSweepIndex++];
    11276        if (!block->needsSweeping())
    11377            continue;
     
    13296    WTF::copyToVector(blockSnapshot, m_blocksToSweep);
    13397    m_currentBlockToSweepIndex = 0;
    134     m_currentStructureBlockToSweepIndex = 0;
    13598    scheduleTimer();
    136 }
    137 
    138 void IncrementalSweeper::willFinishSweeping()
    139 {
    140     m_currentBlockToSweepIndex = m_currentStructureBlockToSweepIndex = 0;
    141     m_blocksToSweep.clear();
    142     if (m_globalData)
    143         cancelTimer();
    14499}
    145100
     
    148103IncrementalSweeper::IncrementalSweeper(JSGlobalData* globalData)
    149104    : HeapTimer(globalData)
    150     , m_structuresCanBeSwept(false)
    151105{
    152106}
     
    161115}
    162116
    163 bool IncrementalSweeper::structuresCanBeSwept()
    164 {
    165     return m_structuresCanBeSwept;
    166 }
    167 
    168117void IncrementalSweeper::startSweeping(const HashSet<MarkedBlock*>&)
    169118{
    170     m_structuresCanBeSwept = false;
    171119}
    172 
    173 void IncrementalSweeper::willFinishSweeping()
    174 {
    175     m_structuresCanBeSwept = true;
    176 }
    177 
     120   
    178121#endif
    179122
  • trunk/Source/JavaScriptCore/heap/IncrementalSweeper.h

    r124123 r124141  
    4343    void startSweeping(const HashSet<MarkedBlock*>& blockSnapshot);
    4444    virtual void doWork();
    45     bool structuresCanBeSwept();
    46     void willFinishSweeping();
    4745
    4846private:
    49 
    5047#if USE(CF)
    5148    IncrementalSweeper(Heap*, CFRunLoopRef);
     
    5653   
    5754    unsigned m_currentBlockToSweepIndex;
    58     unsigned m_currentStructureBlockToSweepIndex;
    5955    Vector<MarkedBlock*> m_blocksToSweep;
    6056#else
    6157   
    6258    IncrementalSweeper(JSGlobalData*);
    63    
    64     bool m_structuresCanBeSwept;
    65 
     59   
    6660#endif
    6761};
  • trunk/Source/JavaScriptCore/heap/MarkedAllocator.cpp

    r124123 r124141  
    44#include "GCActivityCallback.h"
    55#include "Heap.h"
    6 #include "IncrementalSweeper.h"
    76#include "JSGlobalData.h"
    87#include <wtf/CurrentTime.h>
     
    3130{
    3231    if (!m_freeList.head) {
    33         if (m_onlyContainsStructures && !m_heap->isSafeToSweepStructures()) {
    34             if (m_currentBlock) {
    35                 m_currentBlock->didConsumeFreeList();
    36                 m_currentBlock = 0;
    37             }
    38             return 0;
    39         }
    40 
    4132        for (MarkedBlock*& block = m_blocksToSweep; block; block = static_cast<MarkedBlock*>(block->next())) {
    4233            m_freeList = block->sweep(MarkedBlock::SweepToFreeList);
     
    114105{
    115106    ASSERT(!m_currentBlock);
     107    ASSERT(!m_blocksToSweep);
    116108    ASSERT(!m_freeList.head);
    117109   
  • trunk/Source/JavaScriptCore/heap/MarkedAllocator.h

    r124123 r124141  
    102102   
    103103    m_currentBlock->zapFreeList(m_freeList);
    104     m_currentBlock = 0;
    105104    m_freeList = MarkedBlock::FreeList();
    106105}
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp

    r124123 r124141  
    2727#include "MarkedBlock.h"
    2828
    29 #include "IncrementalSweeper.h"
    3029#include "JSCell.h"
    3130#include "JSObject.h"
     
    142141        return FreeList();
    143142    case Marked:
    144         ASSERT(!m_onlyContainsStructures || heap()->isSafeToSweepStructures());
    145143        return sweepMode == SweepToFreeList
    146144            ? specializedSweep<Marked, SweepToFreeList, destructorCallNeeded>()
    147145            : specializedSweep<Marked, SweepOnly, destructorCallNeeded>();
    148146    case Zapped:
    149         ASSERT(!m_onlyContainsStructures || heap()->isSafeToSweepStructures());
    150147        return sweepMode == SweepToFreeList
    151148            ? specializedSweep<Zapped, SweepToFreeList, destructorCallNeeded>()
  • trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp

    r124123 r124141  
    2222#include "MarkedSpace.h"
    2323
    24 #include "IncrementalSweeper.h"
    2524#include "JSGlobalObject.h"
    2625#include "JSLock.h"
     
    108107    canonicalizeCellLivenessData();
    109108    forEachBlock<LastChanceToFinalize>();
    110 }
    111 
    112 void MarkedSpace::sweep()
    113 {
    114     m_heap->sweeper()->willFinishSweeping();
    115     forEachBlock<Sweep>();
    116109}
    117110
  • trunk/Source/JavaScriptCore/heap/MarkedSpace.h

    r124123 r124141  
    236236}
    237237
     238inline void MarkedSpace::sweep()
     239{
     240    forEachBlock<Sweep>();
     241}
     242
    238243inline size_t MarkedSpace::objectCount()
    239244{
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r124123 r124141  
    224224{
    225225    ASSERT(!m_apiLock.currentThreadIsHoldingLock());
    226     heap.didStartVMShutdown();
     226    heap.activityCallback()->didStartVMShutdown();
     227    heap.sweeper()->didStartVMShutdown();
     228    heap.lastChanceToFinalize();
    227229
    228230    delete interpreter;
Note: See TracChangeset for help on using the changeset viewer.