-#if ENABLE(GGC)
-template <int _cellSize> void MarkedBlock::gatherDirtyCellsWithSize(DirtyCellVector& dirtyCells)
-{
- if (m_cards.testAndClear(0)) {
- char* ptr = reinterpret_cast<char*>(&atoms()[firstAtom()]);
- const char* end = reinterpret_cast<char*>(this) + bytesPerCard;
- while (ptr < end) {
- JSCell* cell = reinterpret_cast<JSCell*>(ptr);
- if (isMarked(cell))
- dirtyCells.append(cell);
- ptr += _cellSize;
- }
- }
-
- const size_t cellOffset = firstAtom() * atomSize % _cellSize;
- for (size_t i = 1; i < m_cards.cardCount; i++) {
- if (!m_cards.testAndClear(i))
- continue;
- char* ptr = reinterpret_cast<char*>(this) + i * bytesPerCard + cellOffset;
- char* end = reinterpret_cast<char*>(this) + (i + 1) * bytesPerCard;
-
- while (ptr < end) {
- JSCell* cell = reinterpret_cast<JSCell*>(ptr);
- if (isMarked(cell))
- dirtyCells.append(cell);
- ptr += _cellSize;
+ template <typename Functor> inline void MarkedBlock::forEachLiveCell(Functor& functor)
+ {
+ for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) {
+ JSCell* cell = reinterpret_cast_ptr<JSCell*>(&atoms()[i]);
+ if (!isLive(cell))
+ continue;
+
+ functor(cell);