void SlotVisitor::appendToMarkStack(JSCell* cell) { if (cell->isLargeAllocation()) appendToMarkStack(cell->largeAllocation(), cell); else appendToMarkStack(cell->markedBlock(), cell); }
void SlotVisitor::appendJSCellOrAuxiliary(HeapCell* heapCell) { if (!heapCell) return; ASSERT(!m_isCheckingForDefaultMarkViolation); if (Heap::testAndSetMarked(m_markingVersion, heapCell)) return; switch (heapCell->cellKind()) { case HeapCell::JSCell: { JSCell* jsCell = static_cast<JSCell*>(heapCell); if (!jsCell->structure()) { ASSERT_NOT_REACHED(); return; } jsCell->setCellState(CellState::Grey); appendToMarkStack(jsCell); return; } case HeapCell::Auxiliary: { noteLiveAuxiliaryCell(heapCell); return; } } }
ALWAYS_INLINE void SlotVisitor::setMarkedAndAppendToMarkStack(ContainerType& container, JSCell* cell) { container.aboutToMark(m_markingVersion); if (container.testAndSetMarked(cell)) return; ASSERT(cell->structure()); // Indicate that the object is grey and that: // In case of concurrent GC: it's the first time it is grey in this GC cycle. // In case of eden collection: it's a new object that became grey rather than an old remembered object. cell->setCellState(CellState::Grey); appendToMarkStack(container, cell); }
void SlotVisitor::setMarkedAndAppendToMarkStack(JSCell* cell) { ASSERT(!m_isCheckingForDefaultMarkViolation); if (!cell) return; #if ENABLE(GC_VALIDATION) validate(cell); #endif if (Heap::testAndSetMarked(cell) || !cell->structure()) { ASSERT(cell->structure()); return; } // Indicate that the object is grey and that: // In case of concurrent GC: it's the first time it is grey in this GC cycle. // In case of eden collection: it's a new object that became grey rather than an old remembered object. cell->setCellState(CellState::NewGrey); appendToMarkStack(cell); }