void MarkedSpace::clearNewlyAllocated() { for (size_t i = 0; i < preciseCount; ++i) { clearNewlyAllocatedInBlock(m_normalSpace.preciseAllocators[i].takeCanonicalizedBlock()); clearNewlyAllocatedInBlock(m_normalDestructorSpace.preciseAllocators[i].takeCanonicalizedBlock()); clearNewlyAllocatedInBlock(m_immortalStructureDestructorSpace.preciseAllocators[i].takeCanonicalizedBlock()); } for (size_t i = 0; i < impreciseCount; ++i) { clearNewlyAllocatedInBlock(m_normalSpace.impreciseAllocators[i].takeCanonicalizedBlock()); clearNewlyAllocatedInBlock(m_normalDestructorSpace.impreciseAllocators[i].takeCanonicalizedBlock()); clearNewlyAllocatedInBlock(m_immortalStructureDestructorSpace.impreciseAllocators[i].takeCanonicalizedBlock()); } // We have to iterate all of the blocks in the large allocators because they are // canonicalized as they are used up (see MarkedAllocator::tryAllocateHelper) // which creates the m_newlyAllocated bitmap. ClearNewlyAllocated functor; m_normalSpace.largeAllocator.forEachBlock(functor); m_normalDestructorSpace.largeAllocator.forEachBlock(functor); m_immortalStructureDestructorSpace.largeAllocator.forEachBlock(functor); #ifndef NDEBUG VerifyNewlyAllocated verifyFunctor; forEachBlock(verifyFunctor); #endif }
void BlockDirectory::lastChanceToFinalize() { forEachBlock( [&] (MarkedBlock::Handle* block) { block->lastChanceToFinalize(); }); }
void MarkedAllocator::lastChanceToFinalize() { forEachBlock( [&] (MarkedBlock::Handle* block) { block->lastChanceToFinalize(); }); }
void MarkedAllocator::lastChanceToFinalize() { m_blockList.append(m_retiredBlocks); forEachBlock( [&] (MarkedBlock* block) { block->lastChanceToFinalize(); }); }
size_t CodeCache::totalUsed() const { size_t ret = 0; forEachBlock([&ret](const char*, const CodeBlock& b) { // A thread with the write lease may be modifying b.m_frontier while we // call b.used() but it should never modify b.m_base. This means that at // worst b.used() will return a slightly stale value. ret += b.used(); }); return ret; }
void MarkedSpace::gatherDirtyCells(MarkedBlock::DirtyCellVector& dirtyCells) { GatherDirtyCells gatherDirtyCells(&dirtyCells); forEachBlock(gatherDirtyCells); }
void MarkedSpace::shrink() { // We record a temporary list of empties to avoid modifying m_blocks while iterating it. TakeIfUnmarked takeIfUnmarked(this); freeBlocks(forEachBlock(takeIfUnmarked)); }
void MarkedAllocator::lastChanceToFinalize() { m_blockList.append(m_retiredBlocks); LastChanceToFinalize functor; forEachBlock(functor); }
MarkedSpace::~MarkedSpace() { Free free(Free::FreeAll, this); forEachBlock(free); }
void MarkedSpace::shrink() { Free freeOrShrink(Free::FreeOrShrink, this); forEachBlock(freeOrShrink); }
void MarkedSpace::visitWeakSets(HeapRootVisitor& heapRootVisitor) { VisitWeakSet visitWeakSet(heapRootVisitor); forEachBlock(visitWeakSet); }
void Heap::shrink() { // We record a temporary list of empties to avoid modifying m_blocks while iterating it. TakeIfEmpty takeIfEmpty(&m_newSpace); freeBlocks(forEachBlock(takeIfEmpty)); }