Changeset 124265 in webkit for trunk/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
- Timestamp:
- Jul 31, 2012, 4:05:12 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
r124141 r124265 52 52 : HeapTimer(heap->globalData(), runLoop) 53 53 , m_currentBlockToSweepIndex(0) 54 , m_structuresCanBeSwept(false) 54 55 { 55 56 } … … 74 75 while (m_currentBlockToSweepIndex < m_blocksToSweep.size()) { 75 76 MarkedBlock* block = m_blocksToSweep[m_currentBlockToSweepIndex++]; 77 if (block->onlyContainsStructures()) 78 m_structuresCanBeSwept = true; 79 else 80 ASSERT(!m_structuresCanBeSwept); 81 76 82 if (!block->needsSweeping()) 77 83 continue; … … 94 100 void IncrementalSweeper::startSweeping(const HashSet<MarkedBlock*>& blockSnapshot) 95 101 { 96 WTF::copyToVector(blockSnapshot, m_blocksToSweep); 102 m_blocksToSweep.resize(blockSnapshot.size()); 103 CopyFunctor functor(m_blocksToSweep); 104 m_globalData->heap.objectSpace().forEachBlock(functor); 97 105 m_currentBlockToSweepIndex = 0; 106 m_structuresCanBeSwept = false; 98 107 scheduleTimer(); 108 } 109 110 void IncrementalSweeper::willFinishSweeping() 111 { 112 m_currentBlockToSweepIndex = 0; 113 m_structuresCanBeSwept = true; 114 m_blocksToSweep.clear(); 115 if (m_globalData) 116 cancelTimer(); 99 117 } 100 118 … … 103 121 IncrementalSweeper::IncrementalSweeper(JSGlobalData* globalData) 104 122 : HeapTimer(globalData) 123 , m_structuresCanBeSwept(false) 105 124 { 106 125 } … … 117 136 void IncrementalSweeper::startSweeping(const HashSet<MarkedBlock*>&) 118 137 { 138 m_structuresCanBeSwept = false; 119 139 } 120 140 141 void IncrementalSweeper::willFinishSweeping() 142 { 143 m_structuresCanBeSwept = true; 144 } 145 121 146 #endif 122 147 148 bool IncrementalSweeper::structuresCanBeSwept() 149 { 150 return m_structuresCanBeSwept; 151 } 152 123 153 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.