Changeset 124141 in webkit for trunk/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
- Timestamp:
- Jul 30, 2012, 6:48:18 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
r124123 r124141 70 70 } 71 71 72 bool IncrementalSweeper::structuresCanBeSwept()73 {74 ASSERT(m_currentBlockToSweepIndex <= m_blocksToSweep.size());75 return !m_blocksToSweep.size() || m_currentBlockToSweepIndex >= m_blocksToSweep.size();76 }77 78 72 void IncrementalSweeper::doSweep(double sweepBeginTime) 79 73 { 80 74 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++]; 112 76 if (!block->needsSweeping()) 113 77 continue; … … 132 96 WTF::copyToVector(blockSnapshot, m_blocksToSweep); 133 97 m_currentBlockToSweepIndex = 0; 134 m_currentStructureBlockToSweepIndex = 0;135 98 scheduleTimer(); 136 }137 138 void IncrementalSweeper::willFinishSweeping()139 {140 m_currentBlockToSweepIndex = m_currentStructureBlockToSweepIndex = 0;141 m_blocksToSweep.clear();142 if (m_globalData)143 cancelTimer();144 99 } 145 100 … … 148 103 IncrementalSweeper::IncrementalSweeper(JSGlobalData* globalData) 149 104 : HeapTimer(globalData) 150 , m_structuresCanBeSwept(false)151 105 { 152 106 } … … 161 115 } 162 116 163 bool IncrementalSweeper::structuresCanBeSwept()164 {165 return m_structuresCanBeSwept;166 }167 168 117 void IncrementalSweeper::startSweeping(const HashSet<MarkedBlock*>&) 169 118 { 170 m_structuresCanBeSwept = false;171 119 } 172 173 void IncrementalSweeper::willFinishSweeping() 174 { 175 m_structuresCanBeSwept = true; 176 } 177 120 178 121 #endif 179 122
Note:
See TracChangeset
for help on using the changeset viewer.