namespace JSC {
-inline void CopyVisitor::visitCell(JSCell* cell)
+inline void CopyVisitor::visitItem(CopyWorklistItem item)
{
- ASSERT(cell->structure()->classInfo()->methodTable.copyBackingStore == JSObject::copyBackingStore);
- JSObject::copyBackingStore(cell, *this);
+ if (item.token() == ButterflyCopyToken) {
+ JSObject::copyBackingStore(item.cell(), *this, ButterflyCopyToken);
+ return;
+ }
+
+ item.cell()->methodTable()->copyBackingStore(item.cell(), *this, item.token());
}
inline bool CopyVisitor::checkIfShouldCopy(void* oldPtr)
inline void* CopyVisitor::allocateNewSpace(size_t bytes)
{
void* result = 0; // Compilers don't realize that this will be assigned.
- if (LIKELY(m_copiedAllocator.tryAllocate(bytes, &result)))
+ if (LIKELY(m_copiedAllocator.tryAllocateDuringCopying(bytes, &result)))
return result;
result = allocateNewSpaceSlow(bytes);
m_copiedAllocator.setCurrentBlock(newBlock);
void* result = 0;
- CheckedBoolean didSucceed = m_copiedAllocator.tryAllocate(bytes, &result);
+ CheckedBoolean didSucceed = m_copiedAllocator.tryAllocateDuringCopying(bytes, &result);
ASSERT(didSucceed);
return result;
}
ASSERT(!block->isPinned());
block->didEvacuateBytes(bytes);
-
}
} // namespace JSC