X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..refs/heads/master:/heap/CopyVisitorInlines.h diff --git a/heap/CopyVisitorInlines.h b/heap/CopyVisitorInlines.h index 4e087b8..6e197fc 100644 --- a/heap/CopyVisitorInlines.h +++ b/heap/CopyVisitorInlines.h @@ -34,10 +34,14 @@ 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) @@ -51,7 +55,7 @@ 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); @@ -66,7 +70,7 @@ inline void* CopyVisitor::allocateNewSpaceSlow(size_t 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; } @@ -94,7 +98,6 @@ inline void CopyVisitor::didCopy(void* ptr, size_t bytes) ASSERT(!block->isPinned()); block->didEvacuateBytes(bytes); - } } // namespace JSC