void IncrementalSweeper::sweepNextBlock() { while (m_currentBlockToSweepIndex < m_blocksToSweep.size()) { MarkedBlock* block = m_blocksToSweep[m_currentBlockToSweepIndex++]; if (!block->needsSweeping()) continue; block->sweep(); m_globalData->heap.objectSpace().freeOrShrinkBlock(block); return; } }
void MarkedSpace::freeBlocks(MarkedBlock* head) { MarkedBlock* next; for (MarkedBlock* block = head; block; block = next) { next = static_cast<MarkedBlock*>(block->next()); m_blocks.remove(block); block->sweep(); MutexLocker locker(m_heap->m_freeBlockLock); m_heap->m_freeBlocks.append(block); m_heap->m_numberOfFreeBlocks++; } }
void IncrementalSweeper::sweepNextBlock() { while (m_currentBlockToSweepIndex < m_blocksToSweep.size()) { MarkedBlock* block = m_blocksToSweep[m_currentBlockToSweepIndex++]; if (block->onlyContainsStructures()) m_structuresCanBeSwept = true; else ASSERT(!m_structuresCanBeSwept); if (!block->needsSweeping()) continue; block->sweep(); m_globalData->heap.objectSpace().freeOrShrinkBlock(block); return; } }