Rename MarkedAllocator to BlockDirectory and AllocatorAttributes to CellAttributes
https://bugs.webkit.org/show_bug.cgi?id=181543
Rubber stamped by Michael Saboff.
Source/JavaScriptCore:
In a world that has thread-local caches, the thing we now call the "MarkedAllocator" doesn't
really have anything to do with allocation anymore. The allocation will be done by something
in the TLC. When you move the allocation logic out of MarkedAllocator, it becomes just a
place to find blocks (a "block directory").
Once we do that renaming, the term "allocator attributes" becomes weird. Those are really the
attributes of the HeapCellType. So let's call them CellAttributes.
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/ObjectAllocationProfile.h:
* bytecode/ObjectAllocationProfileInlines.h:
(JSC::ObjectAllocationProfile::initializeProfile):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
(JSC::DFG::SpeculativeJIT::compileMakeRope):
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileNewObject):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::emitAllocateJSCell):
(JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMakeRope):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorageWithSizeImpl):
(JSC::FTL::DFG::LowerDFGToB3::allocateHeapCell):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):
(JSC::FTL::DFG::LowerDFGToB3::allocatorForSize):
* heap/AlignedMemoryAllocator.cpp:
(JSC::AlignedMemoryAllocator::registerDirectory):
(JSC::AlignedMemoryAllocator::registerAllocator): Deleted.
* heap/AlignedMemoryAllocator.h:
(JSC::AlignedMemoryAllocator::firstDirectory const):
(JSC::AlignedMemoryAllocator::firstAllocator const): Deleted.
* heap/AllocatorAttributes.cpp: Removed.
* heap/AllocatorAttributes.h: Removed.
* heap/BlockDirectory.cpp: Copied from Source/JavaScriptCore/heap/MarkedAllocator.cpp.
(JSC::BlockDirectory::BlockDirectory):
(JSC::BlockDirectory::setSubspace):
(JSC::BlockDirectory::isPagedOut):
(JSC::BlockDirectory::findEmptyBlockToSteal):
(JSC::BlockDirectory::didConsumeFreeList):
(JSC::BlockDirectory::tryAllocateWithoutCollecting):
(JSC::BlockDirectory::allocateIn):
(JSC::BlockDirectory::tryAllocateIn):
(JSC::BlockDirectory::doTestCollectionsIfNeeded):
(JSC::BlockDirectory::allocateSlowCase):
(JSC::BlockDirectory::blockSizeForBytes):
(JSC::BlockDirectory::tryAllocateBlock):
(JSC::BlockDirectory::addBlock):
(JSC::BlockDirectory::removeBlock):
(JSC::BlockDirectory::stopAllocating):
(JSC::BlockDirectory::prepareForAllocation):
(JSC::BlockDirectory::lastChanceToFinalize):
(JSC::BlockDirectory::resumeAllocating):
(JSC::BlockDirectory::beginMarkingForFullCollection):
(JSC::BlockDirectory::endMarking):
(JSC::BlockDirectory::snapshotUnsweptForEdenCollection):
(JSC::BlockDirectory::snapshotUnsweptForFullCollection):
(JSC::BlockDirectory::findBlockToSweep):
(JSC::BlockDirectory::sweep):
(JSC::BlockDirectory::shrink):
(JSC::BlockDirectory::assertNoUnswept):
(JSC::BlockDirectory::parallelNotEmptyBlockSource):
(JSC::BlockDirectory::dump const):
(JSC::BlockDirectory::dumpBits):
(JSC::BlockDirectory::markedSpace const):
(JSC::MarkedAllocator::MarkedAllocator): Deleted.
(JSC::MarkedAllocator::setSubspace): Deleted.
(JSC::MarkedAllocator::isPagedOut): Deleted.
(JSC::MarkedAllocator::findEmptyBlockToSteal): Deleted.
(JSC::MarkedAllocator::didConsumeFreeList): Deleted.
(JSC::MarkedAllocator::tryAllocateWithoutCollecting): Deleted.
(JSC::MarkedAllocator::allocateIn): Deleted.
(JSC::MarkedAllocator::tryAllocateIn): Deleted.
(JSC::MarkedAllocator::doTestCollectionsIfNeeded): Deleted.
(JSC::MarkedAllocator::allocateSlowCase): Deleted.
(JSC::MarkedAllocator::blockSizeForBytes): Deleted.
(JSC::MarkedAllocator::tryAllocateBlock): Deleted.
(JSC::MarkedAllocator::addBlock): Deleted.
(JSC::MarkedAllocator::removeBlock): Deleted.
(JSC::MarkedAllocator::stopAllocating): Deleted.
(JSC::MarkedAllocator::prepareForAllocation): Deleted.
(JSC::MarkedAllocator::lastChanceToFinalize): Deleted.
(JSC::MarkedAllocator::resumeAllocating): Deleted.
(JSC::MarkedAllocator::beginMarkingForFullCollection): Deleted.
(JSC::MarkedAllocator::endMarking): Deleted.
(JSC::MarkedAllocator::snapshotUnsweptForEdenCollection): Deleted.
(JSC::MarkedAllocator::snapshotUnsweptForFullCollection): Deleted.
(JSC::MarkedAllocator::findBlockToSweep): Deleted.
(JSC::MarkedAllocator::sweep): Deleted.
(JSC::MarkedAllocator::shrink): Deleted.
(JSC::MarkedAllocator::assertNoUnswept): Deleted.
(JSC::MarkedAllocator::parallelNotEmptyBlockSource): Deleted.
(JSC::MarkedAllocator::dump const): Deleted.
(JSC::MarkedAllocator::dumpBits): Deleted.
(JSC::MarkedAllocator::markedSpace const): Deleted.
* heap/BlockDirectory.h: Copied from Source/JavaScriptCore/heap/MarkedAllocator.h.
(JSC::BlockDirectory::attributes const):
(JSC::BlockDirectory::forEachBitVector):
(JSC::BlockDirectory::forEachBitVectorWithName):
(JSC::BlockDirectory::nextDirectory const):
(JSC::BlockDirectory::nextDirectoryInSubspace const):
(JSC::BlockDirectory::nextDirectoryInAlignedMemoryAllocator const):
(JSC::BlockDirectory::setNextDirectory):
(JSC::BlockDirectory::setNextDirectoryInSubspace):
(JSC::BlockDirectory::setNextDirectoryInAlignedMemoryAllocator):
(JSC::BlockDirectory::offsetOfFreeList):
(JSC::BlockDirectory::offsetOfCellSize):
(JSC::MarkedAllocator::cellSize const): Deleted.
(JSC::MarkedAllocator::attributes const): Deleted.
(JSC::MarkedAllocator::needsDestruction const): Deleted.
(JSC::MarkedAllocator::destruction const): Deleted.
(JSC::MarkedAllocator::cellKind const): Deleted.
(JSC::MarkedAllocator::heap): Deleted.
(JSC::MarkedAllocator::bitvectorLock): Deleted.
(JSC::MarkedAllocator::forEachBitVector): Deleted.
(JSC::MarkedAllocator::forEachBitVectorWithName): Deleted.
(JSC::MarkedAllocator::nextAllocator const): Deleted.
(JSC::MarkedAllocator::nextAllocatorInSubspace const): Deleted.
(JSC::MarkedAllocator::nextAllocatorInAlignedMemoryAllocator const): Deleted.
(JSC::MarkedAllocator::setNextAllocator): Deleted.
(JSC::MarkedAllocator::setNextAllocatorInSubspace): Deleted.
(JSC::MarkedAllocator::setNextAllocatorInAlignedMemoryAllocator): Deleted.
(JSC::MarkedAllocator::subspace const): Deleted.
(JSC::MarkedAllocator::freeList const): Deleted.
(JSC::MarkedAllocator::offsetOfFreeList): Deleted.
(JSC::MarkedAllocator::offsetOfCellSize): Deleted.
* heap/BlockDirectoryInlines.h: Copied from Source/JavaScriptCore/heap/MarkedAllocatorInlines.h.
(JSC::BlockDirectory::isFreeListedCell const):
(JSC::BlockDirectory::allocate):
(JSC::BlockDirectory::forEachBlock):
(JSC::BlockDirectory::forEachNotEmptyBlock):
(JSC::MarkedAllocator::isFreeListedCell const): Deleted.
(JSC::MarkedAllocator::allocate): Deleted.
(JSC::MarkedAllocator::forEachBlock): Deleted.
(JSC::MarkedAllocator::forEachNotEmptyBlock): Deleted.
* heap/CellAttributes.cpp: Copied from Source/JavaScriptCore/heap/AllocatorAttributes.cpp.
(JSC::CellAttributes::dump const):
(JSC::AllocatorAttributes::dump const): Deleted.
* heap/CellAttributes.h: Copied from Source/JavaScriptCore/heap/AllocatorAttributes.h.
(JSC::CellAttributes::CellAttributes):
(JSC::AllocatorAttributes::AllocatorAttributes): Deleted.
* heap/CompleteSubspace.cpp:
(JSC::CompleteSubspace::allocatorFor):
(JSC::CompleteSubspace::allocateNonVirtual):
(JSC::CompleteSubspace::allocatorForSlow):
(JSC::CompleteSubspace::tryAllocateSlow):
* heap/CompleteSubspace.h:
(JSC::CompleteSubspace::allocatorForSizeStep):
(JSC::CompleteSubspace::allocatorForNonVirtual):
* heap/GCDeferralContext.h:
* heap/Heap.cpp:
(JSC::Heap::updateAllocationLimits):
* heap/Heap.h:
* heap/HeapCell.h:
* heap/HeapCellInlines.h:
(JSC::HeapCell::cellAttributes const):
(JSC::HeapCell::destructionMode const):
(JSC::HeapCell::cellKind const):
(JSC::HeapCell::allocatorAttributes const): Deleted.
* heap/HeapCellType.cpp:
(JSC::HeapCellType::HeapCellType):
* heap/HeapCellType.h:
(JSC::HeapCellType::attributes const):
* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::IncrementalSweeper):
(JSC::IncrementalSweeper::sweepNextBlock):
(JSC::IncrementalSweeper::startSweeping):
(JSC::IncrementalSweeper::stopSweeping):
* heap/IncrementalSweeper.h:
* heap/IsoCellSet.cpp:
(JSC::IsoCellSet::IsoCellSet):
(JSC::IsoCellSet::parallelNotEmptyMarkedBlockSource):
(JSC::IsoCellSet::addSlow):
(JSC::IsoCellSet::didRemoveBlock):
(JSC::IsoCellSet::sweepToFreeList):
* heap/IsoCellSetInlines.h:
(JSC::IsoCellSet::forEachMarkedCell):
(JSC::IsoCellSet::forEachLiveCell):
* heap/IsoSubspace.cpp:
(JSC::IsoSubspace::IsoSubspace):
(JSC::IsoSubspace::allocatorFor):
(JSC::IsoSubspace::allocateNonVirtual):
* heap/IsoSubspace.h:
(JSC::IsoSubspace::allocatorForNonVirtual):
* heap/LargeAllocation.h:
(JSC::LargeAllocation::attributes const):
* heap/MarkedAllocator.cpp: Removed.
* heap/MarkedAllocator.h: Removed.
* heap/MarkedAllocatorInlines.h: Removed.
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::~Handle):
(JSC::MarkedBlock::Handle::setIsFreeListed):
(JSC::MarkedBlock::Handle::stopAllocating):
(JSC::MarkedBlock::Handle::lastChanceToFinalize):
(JSC::MarkedBlock::Handle::resumeAllocating):
(JSC::MarkedBlock::aboutToMarkSlow):
(JSC::MarkedBlock::Handle::didConsumeFreeList):
(JSC::MarkedBlock::noteMarkedSlow):
(JSC::MarkedBlock::Handle::removeFromDirectory):
(JSC::MarkedBlock::Handle::didAddToDirectory):
(JSC::MarkedBlock::Handle::didRemoveFromDirectory):
(JSC::MarkedBlock::Handle::dumpState):
(JSC::MarkedBlock::Handle::subspace const):
(JSC::MarkedBlock::Handle::sweep):
(JSC::MarkedBlock::Handle::isFreeListedCell const):
(JSC::MarkedBlock::Handle::removeFromAllocator): Deleted.
(JSC::MarkedBlock::Handle::didAddToAllocator): Deleted.
(JSC::MarkedBlock::Handle::didRemoveFromAllocator): Deleted.
* heap/MarkedBlock.h:
(JSC::MarkedBlock::Handle::directory const):
(JSC::MarkedBlock::Handle::attributes const):
(JSC::MarkedBlock::attributes const):
(JSC::MarkedBlock::Handle::allocator const): Deleted.
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::isAllocated):
(JSC::MarkedBlock::Handle::isLive):
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::isEmpty):
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::lastChanceToFinalize):
(JSC::MarkedSpace::sweep):
(JSC::MarkedSpace::stopAllocating):
(JSC::MarkedSpace::resumeAllocating):
(JSC::MarkedSpace::isPagedOut):
(JSC::MarkedSpace::freeBlock):
(JSC::MarkedSpace::shrink):
(JSC::MarkedSpace::beginMarking):
(JSC::MarkedSpace::endMarking):
(JSC::MarkedSpace::snapshotUnswept):
(JSC::MarkedSpace::assertNoUnswept):
(JSC::MarkedSpace::dumpBits):
(JSC::MarkedSpace::addBlockDirectory):
(JSC::MarkedSpace::addMarkedAllocator): Deleted.
* heap/MarkedSpace.h:
(JSC::MarkedSpace::firstDirectory const):
(JSC::MarkedSpace::directoryLock):
(JSC::MarkedSpace::forEachBlock):
(JSC::MarkedSpace::forEachDirectory):
(JSC::MarkedSpace::firstAllocator const): Deleted.
(JSC::MarkedSpace::allocatorLock): Deleted.
(JSC::MarkedSpace::forEachAllocator): Deleted.
* heap/MarkedSpaceInlines.h:
* heap/Subspace.cpp:
(JSC::Subspace::initialize):
(JSC::Subspace::prepareForAllocation):
(JSC::Subspace::findEmptyBlockToSteal):
(JSC::Subspace::parallelDirectorySource):
(JSC::Subspace::parallelNotEmptyMarkedBlockSource):
(JSC::Subspace::sweep):
(JSC::Subspace::parallelAllocatorSource): Deleted.
* heap/Subspace.h:
(JSC::Subspace::attributes const):
(JSC::Subspace::didCreateFirstDirectory):
(JSC::Subspace::didCreateFirstAllocator): Deleted.
* heap/SubspaceInlines.h:
(JSC::Subspace::forEachDirectory):
(JSC::Subspace::forEachMarkedBlock):
(JSC::Subspace::forEachNotEmptyMarkedBlock):
(JSC::Subspace::forEachAllocator): Deleted.
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitAllocateWithNonNullAllocator):
(JSC::AssemblyHelpers::emitAllocate):
(JSC::AssemblyHelpers::emitAllocateJSCell):
(JSC::AssemblyHelpers::emitAllocateJSObject):
(JSC::AssemblyHelpers::emitAllocateJSObjectWithKnownSize):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_new_object):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_new_object):
* runtime/JSDestructibleObjectHeapCellType.cpp:
(JSC::JSDestructibleObjectHeapCellType::JSDestructibleObjectHeapCellType):
* runtime/JSSegmentedVariableObjectHeapCellType.cpp:
(JSC::JSSegmentedVariableObjectHeapCellType::JSSegmentedVariableObjectHeapCellType):
* runtime/JSStringHeapCellType.cpp:
(JSC::JSStringHeapCellType::JSStringHeapCellType):
* runtime/VM.cpp:
(JSC::VM::VM):
* wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp:
(JSC::JSWebAssemblyCodeBlockHeapCellType::JSWebAssemblyCodeBlockHeapCellType):
Source/WebCore:
No new tests because I'm just renaming things.
* ForwardingHeaders/heap/BlockDirectoryInlines.h: Copied from Source/WebCore/ForwardingHeaders/heap/MarkedAllocatorInlines.h.
* ForwardingHeaders/heap/MarkedAllocatorInlines.h: Removed.
* bindings/js/DOMGCOutputConstraint.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@226822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 474e956..e13e240 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,297 @@
+2018-01-11 Filip Pizlo <fpizlo@apple.com>
+
+ Rename MarkedAllocator to BlockDirectory and AllocatorAttributes to CellAttributes
+ https://bugs.webkit.org/show_bug.cgi?id=181543
+
+ Rubber stamped by Michael Saboff.
+
+ In a world that has thread-local caches, the thing we now call the "MarkedAllocator" doesn't
+ really have anything to do with allocation anymore. The allocation will be done by something
+ in the TLC. When you move the allocation logic out of MarkedAllocator, it becomes just a
+ place to find blocks (a "block directory").
+
+ Once we do that renaming, the term "allocator attributes" becomes weird. Those are really the
+ attributes of the HeapCellType. So let's call them CellAttributes.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * Sources.txt:
+ * bytecode/AccessCase.cpp:
+ (JSC::AccessCase::generateImpl):
+ * bytecode/ObjectAllocationProfile.h:
+ * bytecode/ObjectAllocationProfileInlines.h:
+ (JSC::ObjectAllocationProfile::initializeProfile):
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
+ (JSC::DFG::SpeculativeJIT::compileMakeRope):
+ (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
+ (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
+ (JSC::DFG::SpeculativeJIT::compileNewObject):
+ * dfg/DFGSpeculativeJIT.h:
+ (JSC::DFG::SpeculativeJIT::emitAllocateJSCell):
+ (JSC::DFG::SpeculativeJIT::emitAllocateJSObject):
+ * ftl/FTLAbstractHeapRepository.h:
+ * ftl/FTLLowerDFGToB3.cpp:
+ (JSC::FTL::DFG::LowerDFGToB3::compileMakeRope):
+ (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
+ (JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorageWithSizeImpl):
+ (JSC::FTL::DFG::LowerDFGToB3::allocateHeapCell):
+ (JSC::FTL::DFG::LowerDFGToB3::allocateObject):
+ (JSC::FTL::DFG::LowerDFGToB3::allocatorForSize):
+ * heap/AlignedMemoryAllocator.cpp:
+ (JSC::AlignedMemoryAllocator::registerDirectory):
+ (JSC::AlignedMemoryAllocator::registerAllocator): Deleted.
+ * heap/AlignedMemoryAllocator.h:
+ (JSC::AlignedMemoryAllocator::firstDirectory const):
+ (JSC::AlignedMemoryAllocator::firstAllocator const): Deleted.
+ * heap/AllocatorAttributes.cpp: Removed.
+ * heap/AllocatorAttributes.h: Removed.
+ * heap/BlockDirectory.cpp: Copied from Source/JavaScriptCore/heap/MarkedAllocator.cpp.
+ (JSC::BlockDirectory::BlockDirectory):
+ (JSC::BlockDirectory::setSubspace):
+ (JSC::BlockDirectory::isPagedOut):
+ (JSC::BlockDirectory::findEmptyBlockToSteal):
+ (JSC::BlockDirectory::didConsumeFreeList):
+ (JSC::BlockDirectory::tryAllocateWithoutCollecting):
+ (JSC::BlockDirectory::allocateIn):
+ (JSC::BlockDirectory::tryAllocateIn):
+ (JSC::BlockDirectory::doTestCollectionsIfNeeded):
+ (JSC::BlockDirectory::allocateSlowCase):
+ (JSC::BlockDirectory::blockSizeForBytes):
+ (JSC::BlockDirectory::tryAllocateBlock):
+ (JSC::BlockDirectory::addBlock):
+ (JSC::BlockDirectory::removeBlock):
+ (JSC::BlockDirectory::stopAllocating):
+ (JSC::BlockDirectory::prepareForAllocation):
+ (JSC::BlockDirectory::lastChanceToFinalize):
+ (JSC::BlockDirectory::resumeAllocating):
+ (JSC::BlockDirectory::beginMarkingForFullCollection):
+ (JSC::BlockDirectory::endMarking):
+ (JSC::BlockDirectory::snapshotUnsweptForEdenCollection):
+ (JSC::BlockDirectory::snapshotUnsweptForFullCollection):
+ (JSC::BlockDirectory::findBlockToSweep):
+ (JSC::BlockDirectory::sweep):
+ (JSC::BlockDirectory::shrink):
+ (JSC::BlockDirectory::assertNoUnswept):
+ (JSC::BlockDirectory::parallelNotEmptyBlockSource):
+ (JSC::BlockDirectory::dump const):
+ (JSC::BlockDirectory::dumpBits):
+ (JSC::BlockDirectory::markedSpace const):
+ (JSC::MarkedAllocator::MarkedAllocator): Deleted.
+ (JSC::MarkedAllocator::setSubspace): Deleted.
+ (JSC::MarkedAllocator::isPagedOut): Deleted.
+ (JSC::MarkedAllocator::findEmptyBlockToSteal): Deleted.
+ (JSC::MarkedAllocator::didConsumeFreeList): Deleted.
+ (JSC::MarkedAllocator::tryAllocateWithoutCollecting): Deleted.
+ (JSC::MarkedAllocator::allocateIn): Deleted.
+ (JSC::MarkedAllocator::tryAllocateIn): Deleted.
+ (JSC::MarkedAllocator::doTestCollectionsIfNeeded): Deleted.
+ (JSC::MarkedAllocator::allocateSlowCase): Deleted.
+ (JSC::MarkedAllocator::blockSizeForBytes): Deleted.
+ (JSC::MarkedAllocator::tryAllocateBlock): Deleted.
+ (JSC::MarkedAllocator::addBlock): Deleted.
+ (JSC::MarkedAllocator::removeBlock): Deleted.
+ (JSC::MarkedAllocator::stopAllocating): Deleted.
+ (JSC::MarkedAllocator::prepareForAllocation): Deleted.
+ (JSC::MarkedAllocator::lastChanceToFinalize): Deleted.
+ (JSC::MarkedAllocator::resumeAllocating): Deleted.
+ (JSC::MarkedAllocator::beginMarkingForFullCollection): Deleted.
+ (JSC::MarkedAllocator::endMarking): Deleted.
+ (JSC::MarkedAllocator::snapshotUnsweptForEdenCollection): Deleted.
+ (JSC::MarkedAllocator::snapshotUnsweptForFullCollection): Deleted.
+ (JSC::MarkedAllocator::findBlockToSweep): Deleted.
+ (JSC::MarkedAllocator::sweep): Deleted.
+ (JSC::MarkedAllocator::shrink): Deleted.
+ (JSC::MarkedAllocator::assertNoUnswept): Deleted.
+ (JSC::MarkedAllocator::parallelNotEmptyBlockSource): Deleted.
+ (JSC::MarkedAllocator::dump const): Deleted.
+ (JSC::MarkedAllocator::dumpBits): Deleted.
+ (JSC::MarkedAllocator::markedSpace const): Deleted.
+ * heap/BlockDirectory.h: Copied from Source/JavaScriptCore/heap/MarkedAllocator.h.
+ (JSC::BlockDirectory::attributes const):
+ (JSC::BlockDirectory::forEachBitVector):
+ (JSC::BlockDirectory::forEachBitVectorWithName):
+ (JSC::BlockDirectory::nextDirectory const):
+ (JSC::BlockDirectory::nextDirectoryInSubspace const):
+ (JSC::BlockDirectory::nextDirectoryInAlignedMemoryAllocator const):
+ (JSC::BlockDirectory::setNextDirectory):
+ (JSC::BlockDirectory::setNextDirectoryInSubspace):
+ (JSC::BlockDirectory::setNextDirectoryInAlignedMemoryAllocator):
+ (JSC::BlockDirectory::offsetOfFreeList):
+ (JSC::BlockDirectory::offsetOfCellSize):
+ (JSC::MarkedAllocator::cellSize const): Deleted.
+ (JSC::MarkedAllocator::attributes const): Deleted.
+ (JSC::MarkedAllocator::needsDestruction const): Deleted.
+ (JSC::MarkedAllocator::destruction const): Deleted.
+ (JSC::MarkedAllocator::cellKind const): Deleted.
+ (JSC::MarkedAllocator::heap): Deleted.
+ (JSC::MarkedAllocator::bitvectorLock): Deleted.
+ (JSC::MarkedAllocator::forEachBitVector): Deleted.
+ (JSC::MarkedAllocator::forEachBitVectorWithName): Deleted.
+ (JSC::MarkedAllocator::nextAllocator const): Deleted.
+ (JSC::MarkedAllocator::nextAllocatorInSubspace const): Deleted.
+ (JSC::MarkedAllocator::nextAllocatorInAlignedMemoryAllocator const): Deleted.
+ (JSC::MarkedAllocator::setNextAllocator): Deleted.
+ (JSC::MarkedAllocator::setNextAllocatorInSubspace): Deleted.
+ (JSC::MarkedAllocator::setNextAllocatorInAlignedMemoryAllocator): Deleted.
+ (JSC::MarkedAllocator::subspace const): Deleted.
+ (JSC::MarkedAllocator::freeList const): Deleted.
+ (JSC::MarkedAllocator::offsetOfFreeList): Deleted.
+ (JSC::MarkedAllocator::offsetOfCellSize): Deleted.
+ * heap/BlockDirectoryInlines.h: Copied from Source/JavaScriptCore/heap/MarkedAllocatorInlines.h.
+ (JSC::BlockDirectory::isFreeListedCell const):
+ (JSC::BlockDirectory::allocate):
+ (JSC::BlockDirectory::forEachBlock):
+ (JSC::BlockDirectory::forEachNotEmptyBlock):
+ (JSC::MarkedAllocator::isFreeListedCell const): Deleted.
+ (JSC::MarkedAllocator::allocate): Deleted.
+ (JSC::MarkedAllocator::forEachBlock): Deleted.
+ (JSC::MarkedAllocator::forEachNotEmptyBlock): Deleted.
+ * heap/CellAttributes.cpp: Copied from Source/JavaScriptCore/heap/AllocatorAttributes.cpp.
+ (JSC::CellAttributes::dump const):
+ (JSC::AllocatorAttributes::dump const): Deleted.
+ * heap/CellAttributes.h: Copied from Source/JavaScriptCore/heap/AllocatorAttributes.h.
+ (JSC::CellAttributes::CellAttributes):
+ (JSC::AllocatorAttributes::AllocatorAttributes): Deleted.
+ * heap/CompleteSubspace.cpp:
+ (JSC::CompleteSubspace::allocatorFor):
+ (JSC::CompleteSubspace::allocateNonVirtual):
+ (JSC::CompleteSubspace::allocatorForSlow):
+ (JSC::CompleteSubspace::tryAllocateSlow):
+ * heap/CompleteSubspace.h:
+ (JSC::CompleteSubspace::allocatorForSizeStep):
+ (JSC::CompleteSubspace::allocatorForNonVirtual):
+ * heap/GCDeferralContext.h:
+ * heap/Heap.cpp:
+ (JSC::Heap::updateAllocationLimits):
+ * heap/Heap.h:
+ * heap/HeapCell.h:
+ * heap/HeapCellInlines.h:
+ (JSC::HeapCell::cellAttributes const):
+ (JSC::HeapCell::destructionMode const):
+ (JSC::HeapCell::cellKind const):
+ (JSC::HeapCell::allocatorAttributes const): Deleted.
+ * heap/HeapCellType.cpp:
+ (JSC::HeapCellType::HeapCellType):
+ * heap/HeapCellType.h:
+ (JSC::HeapCellType::attributes const):
+ * heap/IncrementalSweeper.cpp:
+ (JSC::IncrementalSweeper::IncrementalSweeper):
+ (JSC::IncrementalSweeper::sweepNextBlock):
+ (JSC::IncrementalSweeper::startSweeping):
+ (JSC::IncrementalSweeper::stopSweeping):
+ * heap/IncrementalSweeper.h:
+ * heap/IsoCellSet.cpp:
+ (JSC::IsoCellSet::IsoCellSet):
+ (JSC::IsoCellSet::parallelNotEmptyMarkedBlockSource):
+ (JSC::IsoCellSet::addSlow):
+ (JSC::IsoCellSet::didRemoveBlock):
+ (JSC::IsoCellSet::sweepToFreeList):
+ * heap/IsoCellSetInlines.h:
+ (JSC::IsoCellSet::forEachMarkedCell):
+ (JSC::IsoCellSet::forEachLiveCell):
+ * heap/IsoSubspace.cpp:
+ (JSC::IsoSubspace::IsoSubspace):
+ (JSC::IsoSubspace::allocatorFor):
+ (JSC::IsoSubspace::allocateNonVirtual):
+ * heap/IsoSubspace.h:
+ (JSC::IsoSubspace::allocatorForNonVirtual):
+ * heap/LargeAllocation.h:
+ (JSC::LargeAllocation::attributes const):
+ * heap/MarkedAllocator.cpp: Removed.
+ * heap/MarkedAllocator.h: Removed.
+ * heap/MarkedAllocatorInlines.h: Removed.
+ * heap/MarkedBlock.cpp:
+ (JSC::MarkedBlock::Handle::~Handle):
+ (JSC::MarkedBlock::Handle::setIsFreeListed):
+ (JSC::MarkedBlock::Handle::stopAllocating):
+ (JSC::MarkedBlock::Handle::lastChanceToFinalize):
+ (JSC::MarkedBlock::Handle::resumeAllocating):
+ (JSC::MarkedBlock::aboutToMarkSlow):
+ (JSC::MarkedBlock::Handle::didConsumeFreeList):
+ (JSC::MarkedBlock::noteMarkedSlow):
+ (JSC::MarkedBlock::Handle::removeFromDirectory):
+ (JSC::MarkedBlock::Handle::didAddToDirectory):
+ (JSC::MarkedBlock::Handle::didRemoveFromDirectory):
+ (JSC::MarkedBlock::Handle::dumpState):
+ (JSC::MarkedBlock::Handle::subspace const):
+ (JSC::MarkedBlock::Handle::sweep):
+ (JSC::MarkedBlock::Handle::isFreeListedCell const):
+ (JSC::MarkedBlock::Handle::removeFromAllocator): Deleted.
+ (JSC::MarkedBlock::Handle::didAddToAllocator): Deleted.
+ (JSC::MarkedBlock::Handle::didRemoveFromAllocator): Deleted.
+ * heap/MarkedBlock.h:
+ (JSC::MarkedBlock::Handle::directory const):
+ (JSC::MarkedBlock::Handle::attributes const):
+ (JSC::MarkedBlock::attributes const):
+ (JSC::MarkedBlock::Handle::allocator const): Deleted.
+ * heap/MarkedBlockInlines.h:
+ (JSC::MarkedBlock::Handle::isAllocated):
+ (JSC::MarkedBlock::Handle::isLive):
+ (JSC::MarkedBlock::Handle::specializedSweep):
+ (JSC::MarkedBlock::Handle::isEmpty):
+ * heap/MarkedSpace.cpp:
+ (JSC::MarkedSpace::lastChanceToFinalize):
+ (JSC::MarkedSpace::sweep):
+ (JSC::MarkedSpace::stopAllocating):
+ (JSC::MarkedSpace::resumeAllocating):
+ (JSC::MarkedSpace::isPagedOut):
+ (JSC::MarkedSpace::freeBlock):
+ (JSC::MarkedSpace::shrink):
+ (JSC::MarkedSpace::beginMarking):
+ (JSC::MarkedSpace::endMarking):
+ (JSC::MarkedSpace::snapshotUnswept):
+ (JSC::MarkedSpace::assertNoUnswept):
+ (JSC::MarkedSpace::dumpBits):
+ (JSC::MarkedSpace::addBlockDirectory):
+ (JSC::MarkedSpace::addMarkedAllocator): Deleted.
+ * heap/MarkedSpace.h:
+ (JSC::MarkedSpace::firstDirectory const):
+ (JSC::MarkedSpace::directoryLock):
+ (JSC::MarkedSpace::forEachBlock):
+ (JSC::MarkedSpace::forEachDirectory):
+ (JSC::MarkedSpace::firstAllocator const): Deleted.
+ (JSC::MarkedSpace::allocatorLock): Deleted.
+ (JSC::MarkedSpace::forEachAllocator): Deleted.
+ * heap/MarkedSpaceInlines.h:
+ * heap/Subspace.cpp:
+ (JSC::Subspace::initialize):
+ (JSC::Subspace::prepareForAllocation):
+ (JSC::Subspace::findEmptyBlockToSteal):
+ (JSC::Subspace::parallelDirectorySource):
+ (JSC::Subspace::parallelNotEmptyMarkedBlockSource):
+ (JSC::Subspace::sweep):
+ (JSC::Subspace::parallelAllocatorSource): Deleted.
+ * heap/Subspace.h:
+ (JSC::Subspace::attributes const):
+ (JSC::Subspace::didCreateFirstDirectory):
+ (JSC::Subspace::didCreateFirstAllocator): Deleted.
+ * heap/SubspaceInlines.h:
+ (JSC::Subspace::forEachDirectory):
+ (JSC::Subspace::forEachMarkedBlock):
+ (JSC::Subspace::forEachNotEmptyMarkedBlock):
+ (JSC::Subspace::forEachAllocator): Deleted.
+ * jit/AssemblyHelpers.h:
+ (JSC::AssemblyHelpers::emitAllocateWithNonNullAllocator):
+ (JSC::AssemblyHelpers::emitAllocate):
+ (JSC::AssemblyHelpers::emitAllocateJSCell):
+ (JSC::AssemblyHelpers::emitAllocateJSObject):
+ (JSC::AssemblyHelpers::emitAllocateJSObjectWithKnownSize):
+ * jit/JIT.h:
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_new_object):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_new_object):
+ * runtime/JSDestructibleObjectHeapCellType.cpp:
+ (JSC::JSDestructibleObjectHeapCellType::JSDestructibleObjectHeapCellType):
+ * runtime/JSSegmentedVariableObjectHeapCellType.cpp:
+ (JSC::JSSegmentedVariableObjectHeapCellType::JSSegmentedVariableObjectHeapCellType):
+ * runtime/JSStringHeapCellType.cpp:
+ (JSC::JSStringHeapCellType::JSStringHeapCellType):
+ * runtime/VM.cpp:
+ (JSC::VM::VM):
+ * wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp:
+ (JSC::JSWebAssemblyCodeBlockHeapCellType::JSWebAssemblyCodeBlockHeapCellType):
+
2018-01-11 Saam Barati <sbarati@apple.com>
When inserting Unreachable in byte code parser we need to flush all the right things
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 0b59cea..a3ebe48 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -409,7 +409,7 @@
0F7DF1381E2970E40095951B /* SubspaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF1331E2970D50095951B /* SubspaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F7DF13C1E2971130095951B /* JSDestructibleObjectHeapCellType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF13A1E29710E0095951B /* JSDestructibleObjectHeapCellType.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F7DF13F1E2AFC4D0095951B /* JSStringHeapCellType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF13E1E2AFC4B0095951B /* JSStringHeapCellType.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0F7DF1461E2BEF6A0095951B /* MarkedAllocatorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF1451E2BEF680095951B /* MarkedAllocatorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F7DF1461E2BEF6A0095951B /* BlockDirectoryInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF1451E2BEF680095951B /* BlockDirectoryInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F7F988C1D9596C800F4F12E /* DFGStoreBarrierClusteringPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7F988A1D9596C300F4F12E /* DFGStoreBarrierClusteringPhase.h */; };
0F8023EA1613832B00A0BA45 /* ByValInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8023E91613832300A0BA45 /* ByValInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F8335B81639C1EA001443B5 /* ArrayAllocationProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8335B51639C1E3001443B5 /* ArrayAllocationProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -438,7 +438,7 @@
0F9495881C57F47500413A48 /* B3StackSlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9495861C57F47500413A48 /* B3StackSlot.h */; };
0F952AA11DF7860900E06FBD /* VisitRaceKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F952AA01DF7860700E06FBD /* VisitRaceKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F952ABD1B487A7700C367C5 /* TrackedReferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F952ABB1B487A7700C367C5 /* TrackedReferences.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0F96303A1D4192C8005609D9 /* AllocatorAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9630361D4192C3005609D9 /* AllocatorAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F96303A1D4192C8005609D9 /* CellAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9630361D4192C3005609D9 /* CellAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F96303C1D4192CD005609D9 /* DestructionMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9630381D4192C3005609D9 /* DestructionMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F96EBB316676EF6008BADE3 /* CodeBlockWithJITType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F96EBB116676EF4008BADE3 /* CodeBlockWithJITType.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1624,7 +1624,7 @@
C29ECB031804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = C29ECB011804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.mm */; };
C2A7F688160432D400F76B98 /* JSDestructibleObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2A7F687160432D400F76B98 /* JSDestructibleObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
C2B6D75318A33793004A9301 /* WriteBarrierInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B6D75218A33793004A9301 /* WriteBarrierInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
- C2B916C214DA014E00CBAC86 /* MarkedAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ C2B916C214DA014E00CBAC86 /* BlockDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B916C114DA014E00CBAC86 /* BlockDirectory.h */; settings = {ATTRIBUTES = (Private, ); }; };
C2C0F7CE17BBFC5B00464FE4 /* DFGDesiredTransitions.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */; };
C2CF39C216E15A8100DD69BE /* JSAPIWrapperObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */; };
C2DA778318E259990066FCB6 /* HeapInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2DA778218E259990066FCB6 /* HeapInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2450,7 +2450,7 @@
0F7DF13A1E29710E0095951B /* JSDestructibleObjectHeapCellType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDestructibleObjectHeapCellType.h; sourceTree = "<group>"; };
0F7DF13D1E2AFC4B0095951B /* JSStringHeapCellType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStringHeapCellType.cpp; sourceTree = "<group>"; };
0F7DF13E1E2AFC4B0095951B /* JSStringHeapCellType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringHeapCellType.h; sourceTree = "<group>"; };
- 0F7DF1451E2BEF680095951B /* MarkedAllocatorInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedAllocatorInlines.h; sourceTree = "<group>"; };
+ 0F7DF1451E2BEF680095951B /* BlockDirectoryInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockDirectoryInlines.h; sourceTree = "<group>"; };
0F7F98891D9596C300F4F12E /* DFGStoreBarrierClusteringPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGStoreBarrierClusteringPhase.cpp; path = dfg/DFGStoreBarrierClusteringPhase.cpp; sourceTree = "<group>"; };
0F7F988A1D9596C300F4F12E /* DFGStoreBarrierClusteringPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStoreBarrierClusteringPhase.h; path = dfg/DFGStoreBarrierClusteringPhase.h; sourceTree = "<group>"; };
0F8023E91613832300A0BA45 /* ByValInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByValInfo.h; sourceTree = "<group>"; };
@@ -2504,8 +2504,8 @@
0F952AA01DF7860700E06FBD /* VisitRaceKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitRaceKey.h; sourceTree = "<group>"; };
0F952ABA1B487A7700C367C5 /* TrackedReferences.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackedReferences.cpp; sourceTree = "<group>"; };
0F952ABB1B487A7700C367C5 /* TrackedReferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackedReferences.h; sourceTree = "<group>"; };
- 0F9630351D4192C3005609D9 /* AllocatorAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AllocatorAttributes.cpp; sourceTree = "<group>"; };
- 0F9630361D4192C3005609D9 /* AllocatorAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllocatorAttributes.h; sourceTree = "<group>"; };
+ 0F9630351D4192C3005609D9 /* CellAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CellAttributes.cpp; sourceTree = "<group>"; };
+ 0F9630361D4192C3005609D9 /* CellAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CellAttributes.h; sourceTree = "<group>"; };
0F9630371D4192C3005609D9 /* DestructionMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DestructionMode.cpp; sourceTree = "<group>"; };
0F9630381D4192C3005609D9 /* DestructionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DestructionMode.h; sourceTree = "<group>"; };
0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueProfile.h; sourceTree = "<group>"; };
@@ -4419,8 +4419,8 @@
C29ECB021804D0ED00D2CBB4 /* CurrentThisInsideBlockGetterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CurrentThisInsideBlockGetterTest.h; path = API/tests/CurrentThisInsideBlockGetterTest.h; sourceTree = "<group>"; };
C2A7F687160432D400F76B98 /* JSDestructibleObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDestructibleObject.h; sourceTree = "<group>"; };
C2B6D75218A33793004A9301 /* WriteBarrierInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WriteBarrierInlines.h; sourceTree = "<group>"; };
- C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedAllocator.h; sourceTree = "<group>"; };
- C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkedAllocator.cpp; sourceTree = "<group>"; };
+ C2B916C114DA014E00CBAC86 /* BlockDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockDirectory.h; sourceTree = "<group>"; };
+ C2B916C414DA040C00CBAC86 /* BlockDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlockDirectory.cpp; sourceTree = "<group>"; };
C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredTransitions.cpp; path = dfg/DFGDesiredTransitions.cpp; sourceTree = "<group>"; };
C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredTransitions.h; path = dfg/DFGDesiredTransitions.h; sourceTree = "<group>"; };
C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSAPIWrapperObject.mm; sourceTree = "<group>"; };
@@ -5546,10 +5546,13 @@
0FEC3C511F33A41600F59B6C /* AlignedMemoryAllocator.h */,
0FA7620A1DB959F600B7A2FD /* AllocatingScope.h */,
0FDCE11B1FAE61F4006F3901 /* AllocationFailureMode.h */,
- 0F9630351D4192C3005609D9 /* AllocatorAttributes.cpp */,
- 0F9630361D4192C3005609D9 /* AllocatorAttributes.h */,
0F30CB5D1FCE46B4004B5323 /* AllocatorForMode.h */,
0FB4677E1FDDA6E5003FCB09 /* AtomIndices.h */,
+ C2B916C414DA040C00CBAC86 /* BlockDirectory.cpp */,
+ C2B916C114DA014E00CBAC86 /* BlockDirectory.h */,
+ 0F7DF1451E2BEF680095951B /* BlockDirectoryInlines.h */,
+ 0F9630351D4192C3005609D9 /* CellAttributes.cpp */,
+ 0F9630361D4192C3005609D9 /* CellAttributes.h */,
0FDE87F81DFD0C6D0064C390 /* CellContainer.cpp */,
0F070A421D543A89006E7232 /* CellContainer.h */,
0F070A431D543A89006E7232 /* CellContainerInlines.h */,
@@ -5647,9 +5650,6 @@
0F208AD61DF0925A007D3269 /* LockDuringMarking.h */,
14B7233F12D7D0DA003BD5ED /* MachineStackMarker.cpp */,
14B7234012D7D0DA003BD5ED /* MachineStackMarker.h */,
- C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */,
- C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */,
- 0F7DF1451E2BEF680095951B /* MarkedAllocatorInlines.h */,
142D6F0613539A2800B02E86 /* MarkedBlock.cpp */,
142D6F0713539A2800B02E86 /* MarkedBlock.h */,
0F7C5FB71D888A010044F5E2 /* MarkedBlockInlines.h */,
@@ -8089,7 +8089,7 @@
0FEC3C531F33A41600F59B6C /* AlignedMemoryAllocator.h in Headers */,
0FA7620B1DB959F900B7A2FD /* AllocatingScope.h in Headers */,
0FDCE11C1FAE6209006F3901 /* AllocationFailureMode.h in Headers */,
- 0F96303A1D4192C8005609D9 /* AllocatorAttributes.h in Headers */,
+ 0F96303A1D4192C8005609D9 /* CellAttributes.h in Headers */,
0F30CB5E1FCE4E37004B5323 /* AllocatorForMode.h in Headers */,
0F3730911C0CD70C00052BFA /* AllowMacroScratchRegisterUsage.h in Headers */,
A5EA70E919F5B1010098F5EC /* AlternateDispatchableAgent.h in Headers */,
@@ -9073,8 +9073,8 @@
A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */,
A74DEF94182D991400522C22 /* MapIteratorPrototype.h in Headers */,
A700873E17CBE8D300C3E643 /* MapPrototype.h in Headers */,
- C2B916C214DA014E00CBAC86 /* MarkedAllocator.h in Headers */,
- 0F7DF1461E2BEF6A0095951B /* MarkedAllocatorInlines.h in Headers */,
+ C2B916C214DA014E00CBAC86 /* BlockDirectory.h in Headers */,
+ 0F7DF1461E2BEF6A0095951B /* BlockDirectoryInlines.h in Headers */,
142D6F0913539A2800B02E86 /* MarkedBlock.h in Headers */,
0F7C5FB81D888A0C0044F5E2 /* MarkedBlockInlines.h in Headers */,
141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */,
diff --git a/Source/JavaScriptCore/Sources.txt b/Source/JavaScriptCore/Sources.txt
index 8ad3f2a..51d8e47 100644
--- a/Source/JavaScriptCore/Sources.txt
+++ b/Source/JavaScriptCore/Sources.txt
@@ -466,7 +466,8 @@
ftl/FTLValueRange.cpp
heap/AlignedMemoryAllocator.cpp
-heap/AllocatorAttributes.cpp
+heap/BlockDirectory.cpp
+heap/CellAttributes.cpp
heap/CellContainer.cpp
heap/CodeBlockSet.cpp
heap/CollectionScope.cpp
@@ -502,7 +503,6 @@
heap/MachineStackMarker.cpp
heap/MarkStack.cpp
heap/MarkStackMergingConstraint.cpp
-heap/MarkedAllocator.cpp
heap/MarkedBlock.cpp
heap/MarkedSpace.cpp
heap/MarkingConstraint.cpp
diff --git a/Source/JavaScriptCore/bytecode/AccessCase.cpp b/Source/JavaScriptCore/bytecode/AccessCase.cpp
index 4f25c10..c8f4a49 100644
--- a/Source/JavaScriptCore/bytecode/AccessCase.cpp
+++ b/Source/JavaScriptCore/bytecode/AccessCase.cpp
@@ -955,7 +955,7 @@
size_t newSize = newStructure()->outOfLineCapacity() * sizeof(JSValue);
if (allocatingInline) {
- MarkedAllocator* allocator = vm.jsValueGigacageAuxiliarySpace.allocatorFor(newSize, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = vm.jsValueGigacageAuxiliarySpace.allocatorFor(newSize, AllocatorForMode::AllocatorIfExists);
if (!allocator) {
// Yuck, this case would suck!
diff --git a/Source/JavaScriptCore/bytecode/ObjectAllocationProfile.h b/Source/JavaScriptCore/bytecode/ObjectAllocationProfile.h
index 10c3aa2..41e5585 100644
--- a/Source/JavaScriptCore/bytecode/ObjectAllocationProfile.h
+++ b/Source/JavaScriptCore/bytecode/ObjectAllocationProfile.h
@@ -77,7 +77,7 @@
private:
unsigned possibleDefaultPropertyCount(VM&, JSObject* prototype);
- MarkedAllocator* m_allocator; // Precomputed to make things easier for generated code.
+ BlockDirectory* m_allocator; // Precomputed to make things easier for generated code.
WriteBarrier<Structure> m_structure;
unsigned m_inlineCapacity;
};
diff --git a/Source/JavaScriptCore/bytecode/ObjectAllocationProfileInlines.h b/Source/JavaScriptCore/bytecode/ObjectAllocationProfileInlines.h
index ae5e3ae..9e21913 100644
--- a/Source/JavaScriptCore/bytecode/ObjectAllocationProfileInlines.h
+++ b/Source/JavaScriptCore/bytecode/ObjectAllocationProfileInlines.h
@@ -99,7 +99,7 @@
ASSERT(inlineCapacity <= JSFinalObject::maxInlineCapacity());
size_t allocationSize = JSFinalObject::allocationSize(inlineCapacity);
- MarkedAllocator* allocator = vm.cellSpace.allocatorForNonVirtual(allocationSize, AllocatorForMode::EnsureAllocator);
+ BlockDirectory* allocator = vm.cellSpace.allocatorForNonVirtual(allocationSize, AllocatorForMode::EnsureAllocator);
// Take advantage of extra inline capacity available in the size class.
if (allocator) {
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index 3c07cc9..f56a90a 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -113,7 +113,7 @@
m_jit.move(TrustedImmPtr(0), storageGPR);
if (size) {
- if (MarkedAllocator* allocator = m_jit.vm()->jsValueGigacageAuxiliarySpace.allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists)) {
+ if (BlockDirectory* allocator = m_jit.vm()->jsValueGigacageAuxiliarySpace.allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists)) {
m_jit.move(TrustedImmPtr(allocator), scratchGPR);
m_jit.emitAllocate(storageGPR, allocator, scratchGPR, scratch2GPR, slowCases);
@@ -128,7 +128,7 @@
}
size_t allocationSize = JSFinalObject::allocationSize(inlineCapacity);
- MarkedAllocator* allocatorPtr = subspaceFor<JSFinalObject>(*m_jit.vm())->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocatorPtr = subspaceFor<JSFinalObject>(*m_jit.vm())->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
if (allocatorPtr) {
m_jit.move(TrustedImmPtr(allocatorPtr), scratchGPR);
uint32_t mask = WTF::computeIndexingMask(vectorLength);
@@ -4208,9 +4208,9 @@
GPRReg scratchGPR = scratch.gpr();
JITCompiler::JumpList slowPath;
- MarkedAllocator* markedAllocator = subspaceFor<JSRopeString>(*m_jit.vm())->allocatorForNonVirtual(sizeof(JSRopeString), AllocatorForMode::AllocatorIfExists);
- m_jit.move(TrustedImmPtr(markedAllocator), allocatorGPR);
- emitAllocateJSCell(resultGPR, markedAllocator, allocatorGPR, TrustedImmPtr(m_jit.graph().registerStructure(m_jit.vm()->stringStructure.get())), scratchGPR, slowPath);
+ BlockDirectory* blockDirectory = subspaceFor<JSRopeString>(*m_jit.vm())->allocatorForNonVirtual(sizeof(JSRopeString), AllocatorForMode::AllocatorIfExists);
+ m_jit.move(TrustedImmPtr(blockDirectory), allocatorGPR);
+ emitAllocateJSCell(resultGPR, blockDirectory, allocatorGPR, TrustedImmPtr(m_jit.graph().registerStructure(m_jit.vm()->stringStructure.get())), scratchGPR, slowPath);
m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(resultGPR, JSString::offsetOfValue()));
for (unsigned i = 0; i < numOpGPRs; ++i)
@@ -8383,7 +8383,7 @@
size_t size = initialOutOfLineCapacity * sizeof(JSValue);
- MarkedAllocator* allocator = m_jit.vm()->jsValueGigacageAuxiliarySpace.allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = m_jit.vm()->jsValueGigacageAuxiliarySpace.allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists);
if (!allocator || node->transition()->previous->couldHaveIndexingHeader()) {
SpeculateCellOperand base(this, node->child1());
@@ -8428,7 +8428,7 @@
size_t newSize = oldSize * outOfLineGrowthFactor;
ASSERT(newSize == node->transition()->next->outOfLineCapacity() * sizeof(JSValue));
- MarkedAllocator* allocator = m_jit.vm()->jsValueGigacageAuxiliarySpace.allocatorForNonVirtual(newSize, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = m_jit.vm()->jsValueGigacageAuxiliarySpace.allocatorForNonVirtual(newSize, AllocatorForMode::AllocatorIfExists);
if (!allocator || node->transition()->previous->couldHaveIndexingHeader()) {
SpeculateCellOperand base(this, node->child1());
@@ -11448,7 +11448,7 @@
RegisteredStructure structure = node->structure();
size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
- MarkedAllocator* allocatorPtr = subspaceFor<JSFinalObject>(*m_jit.vm())->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocatorPtr = subspaceFor<JSFinalObject>(*m_jit.vm())->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
m_jit.move(TrustedImmPtr(allocatorPtr), allocatorGPR);
auto butterfly = TrustedImmPtr(nullptr);
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index f21f624..37e7727 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -27,6 +27,7 @@
#if ENABLE(DFG_JIT)
+#include "BlockDirectory.h"
#include "DFGAbstractInterpreter.h"
#include "DFGGenerationInfo.h"
#include "DFGInPlaceAbstractState.h"
@@ -37,7 +38,6 @@
#include "DFGSilentRegisterSavePlan.h"
#include "JITMathIC.h"
#include "JITOperations.h"
-#include "MarkedAllocator.h"
#include "PutKind.h"
#include "SpillRegistersMode.h"
#include "StructureStubInfo.h"
@@ -3120,7 +3120,7 @@
// Allocator for a cell of a specific size.
template <typename StructureType> // StructureType can be GPR or ImmPtr.
void emitAllocateJSCell(
- GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, StructureType structure,
+ GPRReg resultGPR, BlockDirectory* allocator, GPRReg allocatorGPR, StructureType structure,
GPRReg scratchGPR, MacroAssembler::JumpList& slowPath)
{
m_jit.emitAllocateJSCell(resultGPR, allocator, allocatorGPR, structure, scratchGPR, slowPath);
@@ -3129,7 +3129,7 @@
// Allocator for an object of a specific size.
template <typename StructureType, typename StorageType, typename MaskType> // StructureType, StorageType and, MaskType can be GPR or ImmPtr.
void emitAllocateJSObject(
- GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, StructureType structure,
+ GPRReg resultGPR, BlockDirectory* allocator, GPRReg allocatorGPR, StructureType structure,
StorageType storage, MaskType mask, GPRReg scratchGPR, MacroAssembler::JumpList& slowPath)
{
m_jit.emitAllocateJSObject(
diff --git a/Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.h b/Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.h
index 1392197..862e735 100644
--- a/Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.h
+++ b/Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.h
@@ -131,7 +131,7 @@
#define FOR_EACH_INDEXED_ABSTRACT_HEAP(macro) \
macro(ArrayStorage_vector, ArrayStorage::vectorOffset(), sizeof(WriteBarrier<Unknown>)) \
- macro(CompleteSubspace_allocatorForSizeStep, CompleteSubspace::offsetOfAllocatorForSizeStep(), sizeof(MarkedAllocator*)) \
+ macro(CompleteSubspace_allocatorForSizeStep, CompleteSubspace::offsetOfAllocatorForSizeStep(), sizeof(BlockDirectory*)) \
macro(DirectArguments_storage, DirectArguments::storageOffset(), sizeof(EncodedJSValue)) \
macro(JSLexicalEnvironment_variables, JSLexicalEnvironment::offsetOfVariables(), sizeof(EncodedJSValue)) \
macro(JSPropertyNameEnumerator_cachedPropertyNamesVectorContents, 0, sizeof(WriteBarrier<JSString>)) \
diff --git a/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp b/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
index 55bafd5..bf62608 100644
--- a/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
+++ b/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
@@ -5833,7 +5833,7 @@
LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
- MarkedAllocator* allocator = subspaceFor<JSRopeString>(vm())->allocatorForNonVirtual(sizeof(JSRopeString), AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = subspaceFor<JSRopeString>(vm())->allocatorForNonVirtual(sizeof(JSRopeString), AllocatorForMode::AllocatorIfExists);
LValue result = allocateCell(
m_out.constIntPtr(allocator), vm().stringStructure.get(), slowPath);
@@ -9861,7 +9861,7 @@
if (structure->outOfLineCapacity() || hasIndexedProperties(structure->indexingType())) {
size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
- MarkedAllocator* cellAllocator = subspaceFor<JSFinalObject>(vm())->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* cellAllocator = subspaceFor<JSFinalObject>(vm())->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
bool hasIndexingHeader = hasIndexedProperties(structure->indexingType());
unsigned indexingHeaderSize = 0;
@@ -10892,7 +10892,7 @@
LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
size_t sizeInBytes = sizeInValues * sizeof(JSValue);
- MarkedAllocator* allocator = vm().jsValueGigacageAuxiliarySpace.allocatorForNonVirtual(sizeInBytes, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = vm().jsValueGigacageAuxiliarySpace.allocatorForNonVirtual(sizeInBytes, AllocatorForMode::AllocatorIfExists);
LValue startOfStorage = allocateHeapCell(m_out.constIntPtr(allocator), slowPath);
ValueFromBlock fastButterfly = m_out.anchor(
m_out.add(m_out.constIntPtr(sizeInBytes + sizeof(IndexingHeader)), startOfStorage));
@@ -11925,9 +11925,9 @@
LValue allocateHeapCell(LValue allocator, LBasicBlock slowPath)
{
- MarkedAllocator* actualAllocator = nullptr;
+ BlockDirectory* actualAllocator = nullptr;
if (allocator->hasIntPtr())
- actualAllocator = bitwise_cast<MarkedAllocator*>(allocator->asIntPtr());
+ actualAllocator = bitwise_cast<BlockDirectory*>(allocator->asIntPtr());
if (!actualAllocator) {
// This means that either we know that the allocator is null or we don't know what the
@@ -12054,7 +12054,7 @@
LValue allocateObject(
size_t size, StructureType structure, LValue butterfly, LValue indexingMask, LBasicBlock slowPath)
{
- MarkedAllocator* allocator = subspaceFor<ClassType>(vm())->allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = subspaceFor<ClassType>(vm())->allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists);
return allocateObject(m_out.constIntPtr(allocator), structure, butterfly, indexingMask, slowPath);
}
@@ -12074,7 +12074,7 @@
CompleteSubspace* actualSubspace = bitwise_cast<CompleteSubspace*>(subspace->asIntPtr());
size_t actualSize = size->asIntPtr();
- MarkedAllocator* actualAllocator = actualSubspace->allocatorForNonVirtual(actualSize, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* actualAllocator = actualSubspace->allocatorForNonVirtual(actualSize, AllocatorForMode::AllocatorIfExists);
if (!actualAllocator) {
LBasicBlock continuation = m_out.newBlock();
LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
@@ -12134,7 +12134,7 @@
LValue allocateObject(RegisteredStructure structure)
{
size_t allocationSize = JSFinalObject::allocationSize(structure.get()->inlineCapacity());
- MarkedAllocator* allocator = subspaceFor<JSFinalObject>(vm())->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = subspaceFor<JSFinalObject>(vm())->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
// FIXME: If the allocator is null, we could simply emit a normal C call to the allocator
// instead of putting it on the slow path.
diff --git a/Source/JavaScriptCore/heap/AlignedMemoryAllocator.cpp b/Source/JavaScriptCore/heap/AlignedMemoryAllocator.cpp
index 97fb863..dabc7a9 100644
--- a/Source/JavaScriptCore/heap/AlignedMemoryAllocator.cpp
+++ b/Source/JavaScriptCore/heap/AlignedMemoryAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,7 +26,7 @@
#include "config.h"
#include "AlignedMemoryAllocator.h"
-#include "MarkedAllocator.h"
+#include "BlockDirectory.h"
#include "Subspace.h"
namespace JSC {
@@ -39,16 +39,16 @@
{
}
-void AlignedMemoryAllocator::registerAllocator(MarkedAllocator* allocator)
+void AlignedMemoryAllocator::registerDirectory(BlockDirectory* directory)
{
- RELEASE_ASSERT(!allocator->nextAllocatorInAlignedMemoryAllocator());
+ RELEASE_ASSERT(!directory->nextDirectoryInAlignedMemoryAllocator());
- if (m_allocators.isEmpty()) {
+ if (m_directories.isEmpty()) {
for (Subspace* subspace = m_subspaces.first(); subspace; subspace = subspace->nextSubspaceInAlignedMemoryAllocator())
- subspace->didCreateFirstAllocator(allocator);
+ subspace->didCreateFirstDirectory(directory);
}
- m_allocators.append(std::mem_fn(&MarkedAllocator::setNextAllocatorInAlignedMemoryAllocator), allocator);
+ m_directories.append(std::mem_fn(&BlockDirectory::setNextDirectoryInAlignedMemoryAllocator), directory);
}
void AlignedMemoryAllocator::registerSubspace(Subspace* subspace)
diff --git a/Source/JavaScriptCore/heap/AlignedMemoryAllocator.h b/Source/JavaScriptCore/heap/AlignedMemoryAllocator.h
index a688144..47bf001 100644
--- a/Source/JavaScriptCore/heap/AlignedMemoryAllocator.h
+++ b/Source/JavaScriptCore/heap/AlignedMemoryAllocator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,7 +30,7 @@
namespace JSC {
-class MarkedAllocator;
+class BlockDirectory;
class Subspace;
class AlignedMemoryAllocator {
@@ -45,13 +45,13 @@
virtual void dump(PrintStream&) const = 0;
- void registerAllocator(MarkedAllocator*);
- MarkedAllocator* firstAllocator() const { return m_allocators.first(); }
+ void registerDirectory(BlockDirectory*);
+ BlockDirectory* firstDirectory() const { return m_directories.first(); }
void registerSubspace(Subspace*);
private:
- SinglyLinkedListWithTail<MarkedAllocator> m_allocators;
+ SinglyLinkedListWithTail<BlockDirectory> m_directories;
SinglyLinkedListWithTail<Subspace> m_subspaces;
};
diff --git a/Source/JavaScriptCore/heap/MarkedAllocator.cpp b/Source/JavaScriptCore/heap/BlockDirectory.cpp
similarity index 84%
rename from Source/JavaScriptCore/heap/MarkedAllocator.cpp
rename to Source/JavaScriptCore/heap/BlockDirectory.cpp
index 0b9b4c7..8118468 100644
--- a/Source/JavaScriptCore/heap/MarkedAllocator.cpp
+++ b/Source/JavaScriptCore/heap/BlockDirectory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,14 +24,14 @@
*/
#include "config.h"
-#include "MarkedAllocator.h"
+#include "BlockDirectory.h"
#include "AllocatingScope.h"
+#include "BlockDirectoryInlines.h"
#include "GCActivityCallback.h"
#include "Heap.h"
#include "IncrementalSweeper.h"
#include "JSCInlines.h"
-#include "MarkedAllocatorInlines.h"
#include "MarkedBlockInlines.h"
#include "SuperSampler.h"
#include "VM.h"
@@ -41,7 +41,7 @@
static constexpr bool tradeDestructorBlocks = true;
-MarkedAllocator::MarkedAllocator(Heap* heap, size_t cellSize)
+BlockDirectory::BlockDirectory(Heap* heap, size_t cellSize)
: m_freeList(cellSize)
, m_currentBlock(0)
, m_lastActiveBlock(0)
@@ -50,13 +50,13 @@
{
}
-void MarkedAllocator::setSubspace(Subspace* subspace)
+void BlockDirectory::setSubspace(Subspace* subspace)
{
m_attributes = subspace->attributes();
m_subspace = subspace;
}
-bool MarkedAllocator::isPagedOut(double deadline)
+bool BlockDirectory::isPagedOut(double deadline)
{
unsigned itersSinceLastTimeCheck = 0;
for (auto* block : m_blocks) {
@@ -73,7 +73,7 @@
return false;
}
-MarkedBlock::Handle* MarkedAllocator::findEmptyBlockToSteal()
+MarkedBlock::Handle* BlockDirectory::findEmptyBlockToSteal()
{
m_emptyCursor = m_empty.findBit(m_emptyCursor, true);
if (m_emptyCursor >= m_blocks.size())
@@ -81,7 +81,7 @@
return m_blocks[m_emptyCursor];
}
-void MarkedAllocator::didConsumeFreeList()
+void BlockDirectory::didConsumeFreeList()
{
if (m_currentBlock)
m_currentBlock->didConsumeFreeList();
@@ -90,7 +90,7 @@
m_currentBlock = nullptr;
}
-void* MarkedAllocator::tryAllocateWithoutCollecting()
+void* BlockDirectory::tryAllocateWithoutCollecting()
{
SuperSamplerScope superSamplerScope(false);
@@ -118,7 +118,7 @@
// It's good that this clears canAllocateButNotEmpty as well as all other bits,
// because there is a remote chance that a block may have both canAllocateButNotEmpty
// and empty set at the same time.
- block->removeFromAllocator();
+ block->removeFromDirectory();
addBlock(block);
return allocateIn(block);
}
@@ -127,14 +127,14 @@
return nullptr;
}
-void* MarkedAllocator::allocateIn(MarkedBlock::Handle* block)
+void* BlockDirectory::allocateIn(MarkedBlock::Handle* block)
{
void* result = tryAllocateIn(block);
RELEASE_ASSERT(result);
return result;
}
-void* MarkedAllocator::tryAllocateIn(MarkedBlock::Handle* block)
+void* BlockDirectory::tryAllocateIn(MarkedBlock::Handle* block)
{
ASSERT(block);
ASSERT(!block->isFreeListed());
@@ -155,13 +155,16 @@
m_currentBlock = block;
void* result = m_freeList.allocate(
- [] () -> HeapCell* { RELEASE_ASSERT_NOT_REACHED(); return nullptr; });
+ [] () -> HeapCell* {
+ RELEASE_ASSERT_NOT_REACHED();
+ return nullptr;
+ });
setIsEden(NoLockingNecessary, m_currentBlock, true);
markedSpace().didAllocateInBlock(m_currentBlock);
return result;
}
-ALWAYS_INLINE void MarkedAllocator::doTestCollectionsIfNeeded(GCDeferralContext* deferralContext)
+ALWAYS_INLINE void BlockDirectory::doTestCollectionsIfNeeded(GCDeferralContext* deferralContext)
{
if (!Options::slowPathAllocsBetweenGCs())
return;
@@ -179,7 +182,7 @@
allocationCount = 0;
}
-void* MarkedAllocator::allocateSlowCase(GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
+void* BlockDirectory::allocateSlowCase(GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
{
SuperSamplerScope superSamplerScope(false);
ASSERT(m_heap->vm()->currentThreadIsHoldingAPILock());
@@ -194,7 +197,7 @@
m_heap->collectIfNecessaryOrDefer(deferralContext);
- // Goofy corner case: the GC called a callback and now this allocator has a currentBlock. This only
+ // Goofy corner case: the GC called a callback and now this directory has a currentBlock. This only
// happens when running WebKit tests, which inject a callback into the GC's finalization.
if (UNLIKELY(m_currentBlock))
return allocate(deferralContext, failureMode);
@@ -222,7 +225,7 @@
return WTF::roundUpToMultipleOf<MarkedBlock::atomSize>(sizeof(MarkedBlock));
}
-size_t MarkedAllocator::blockSizeForBytes(size_t bytes)
+size_t BlockDirectory::blockSizeForBytes(size_t bytes)
{
size_t minBlockSize = MarkedBlock::blockSize;
size_t minAllocationSize = blockHeaderSize() + WTF::roundUpToMultipleOf<MarkedBlock::atomSize>(bytes);
@@ -230,7 +233,7 @@
return std::max(minBlockSize, minAllocationSize);
}
-MarkedBlock::Handle* MarkedAllocator::tryAllocateBlock()
+MarkedBlock::Handle* BlockDirectory::tryAllocateBlock()
{
SuperSamplerScope superSamplerScope(false);
@@ -243,7 +246,7 @@
return handle;
}
-void MarkedAllocator::addBlock(MarkedBlock::Handle* block)
+void BlockDirectory::addBlock(MarkedBlock::Handle* block)
{
size_t index;
if (m_freeBlockIndices.isEmpty()) {
@@ -281,15 +284,15 @@
});
// This is the point at which the block learns of its cellSize() and attributes().
- block->didAddToAllocator(this, index);
+ block->didAddToDirectory(this, index);
setIsLive(NoLockingNecessary, index, true);
setIsEmpty(NoLockingNecessary, index, true);
}
-void MarkedAllocator::removeBlock(MarkedBlock::Handle* block)
+void BlockDirectory::removeBlock(MarkedBlock::Handle* block)
{
- ASSERT(block->allocator() == this);
+ ASSERT(block->directory() == this);
ASSERT(m_blocks[block->index()] == block);
subspace()->didRemoveBlock(block->index());
@@ -303,13 +306,13 @@
vector[block->index()] = false;
});
- block->didRemoveFromAllocator();
+ block->didRemoveFromDirectory();
}
-void MarkedAllocator::stopAllocating()
+void BlockDirectory::stopAllocating()
{
if (false)
- dataLog(RawPointer(this), ": MarkedAllocator::stopAllocating!\n");
+ dataLog(RawPointer(this), ": BlockDirectory::stopAllocating!\n");
ASSERT(!m_lastActiveBlock);
if (!m_currentBlock) {
ASSERT(m_freeList.allocationWillFail());
@@ -322,7 +325,7 @@
m_freeList.clear();
}
-void MarkedAllocator::prepareForAllocation()
+void BlockDirectory::prepareForAllocation()
{
m_lastActiveBlock = nullptr;
m_currentBlock = nullptr;
@@ -341,7 +344,7 @@
}
}
-void MarkedAllocator::lastChanceToFinalize()
+void BlockDirectory::lastChanceToFinalize()
{
forEachBlock(
[&] (MarkedBlock::Handle* block) {
@@ -349,7 +352,7 @@
});
}
-void MarkedAllocator::resumeAllocating()
+void BlockDirectory::resumeAllocating()
{
if (!m_lastActiveBlock)
return;
@@ -359,7 +362,7 @@
m_lastActiveBlock = nullptr;
}
-void MarkedAllocator::beginMarkingForFullCollection()
+void BlockDirectory::beginMarkingForFullCollection()
{
// Mark bits are sticky and so is our summary of mark bits. We only clear these during full
// collections, so if you survived the last collection you will survive the next one so long
@@ -368,7 +371,7 @@
m_markingRetired.clearAll();
}
-void MarkedAllocator::endMarking()
+void BlockDirectory::endMarking()
{
m_allocated.clearAll();
@@ -399,17 +402,17 @@
}
}
-void MarkedAllocator::snapshotUnsweptForEdenCollection()
+void BlockDirectory::snapshotUnsweptForEdenCollection()
{
m_unswept |= m_eden;
}
-void MarkedAllocator::snapshotUnsweptForFullCollection()
+void BlockDirectory::snapshotUnsweptForFullCollection()
{
m_unswept = m_live;
}
-MarkedBlock::Handle* MarkedAllocator::findBlockToSweep()
+MarkedBlock::Handle* BlockDirectory::findBlockToSweep()
{
m_unsweptCursor = m_unswept.findBit(m_unsweptCursor, true);
if (m_unsweptCursor >= m_blocks.size())
@@ -417,7 +420,7 @@
return m_blocks[m_unsweptCursor];
}
-void MarkedAllocator::sweep()
+void BlockDirectory::sweep()
{
m_unswept.forEachSetBit(
[&] (size_t index) {
@@ -426,7 +429,7 @@
});
}
-void MarkedAllocator::shrink()
+void BlockDirectory::shrink()
{
(m_empty & ~m_destructible).forEachSetBit(
[&] (size_t index) {
@@ -434,7 +437,7 @@
});
}
-void MarkedAllocator::assertNoUnswept()
+void BlockDirectory::assertNoUnswept()
{
if (ASSERT_DISABLED)
return;
@@ -447,12 +450,12 @@
ASSERT_NOT_REACHED();
}
-RefPtr<SharedTask<MarkedBlock::Handle*()>> MarkedAllocator::parallelNotEmptyBlockSource()
+RefPtr<SharedTask<MarkedBlock::Handle*()>> BlockDirectory::parallelNotEmptyBlockSource()
{
class Task : public SharedTask<MarkedBlock::Handle*()> {
public:
- Task(MarkedAllocator& allocator)
- : m_allocator(allocator)
+ Task(BlockDirectory& directory)
+ : m_directory(directory)
{
}
@@ -461,16 +464,16 @@
if (m_done)
return nullptr;
auto locker = holdLock(m_lock);
- m_index = m_allocator.m_markingNotEmpty.findBit(m_index, true);
- if (m_index >= m_allocator.m_blocks.size()) {
+ m_index = m_directory.m_markingNotEmpty.findBit(m_index, true);
+ if (m_index >= m_directory.m_blocks.size()) {
m_done = true;
return nullptr;
}
- return m_allocator.m_blocks[m_index++];
+ return m_directory.m_blocks[m_index++];
}
private:
- MarkedAllocator& m_allocator;
+ BlockDirectory& m_directory;
size_t m_index { 0 };
Lock m_lock;
bool m_done { false };
@@ -479,12 +482,12 @@
return adoptRef(new Task(*this));
}
-void MarkedAllocator::dump(PrintStream& out) const
+void BlockDirectory::dump(PrintStream& out) const
{
out.print(RawPointer(this), ":", m_cellSize, "/", m_attributes);
}
-void MarkedAllocator::dumpBits(PrintStream& out)
+void BlockDirectory::dumpBits(PrintStream& out)
{
unsigned maxNameLength = 0;
forEachBitVectorWithName(
@@ -504,7 +507,7 @@
});
}
-MarkedSpace& MarkedAllocator::markedSpace() const
+MarkedSpace& BlockDirectory::markedSpace() const
{
return m_subspace->space();
}
diff --git a/Source/JavaScriptCore/heap/MarkedAllocator.h b/Source/JavaScriptCore/heap/BlockDirectory.h
similarity index 77%
rename from Source/JavaScriptCore/heap/MarkedAllocator.h
rename to Source/JavaScriptCore/heap/BlockDirectory.h
index b680a05..cd0d22b 100644
--- a/Source/JavaScriptCore/heap/MarkedAllocator.h
+++ b/Source/JavaScriptCore/heap/BlockDirectory.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,7 +26,7 @@
#pragma once
#include "AllocationFailureMode.h"
-#include "AllocatorAttributes.h"
+#include "CellAttributes.h"
#include "FreeList.h"
#include "MarkedBlock.h"
#include <wtf/DataLog.h>
@@ -42,7 +42,7 @@
class MarkedSpace;
class LLIntOffsetsExtractor;
-#define FOR_EACH_MARKED_ALLOCATOR_BIT(macro) \
+#define FOR_EACH_BLOCK_DIRECTORY_BIT(macro) \
macro(live, Live) /* The set of block indices that have actual blocks. */\
macro(empty, Empty) /* The set of all blocks that have no live objects. */ \
macro(allocated, Allocated) /* The set of all blocks that are full of live objects. */\
@@ -65,12 +65,12 @@
//
// The latter is probably better. I'll leave it to a future bug to fix that, since breathing on
// this code leads to regressions for days, and it's not clear that making this change would
-// improve perf since it would not change the collector's behavior, and either way the allocator
+// improve perf since it would not change the collector's behavior, and either way the directory
// has to look at both bitvectors.
// https://bugs.webkit.org/show_bug.cgi?id=162121
-class MarkedAllocator {
- WTF_MAKE_NONCOPYABLE(MarkedAllocator);
+class BlockDirectory {
+ WTF_MAKE_NONCOPYABLE(BlockDirectory);
WTF_MAKE_FAST_ALLOCATED;
friend class LLIntOffsetsExtractor;
@@ -79,7 +79,7 @@
static ptrdiff_t offsetOfFreeList();
static ptrdiff_t offsetOfCellSize();
- MarkedAllocator(Heap*, size_t cellSize);
+ BlockDirectory(Heap*, size_t cellSize);
void setSubspace(Subspace*);
void lastChanceToFinalize();
void prepareForAllocation();
@@ -93,7 +93,7 @@
void shrink();
void assertNoUnswept();
size_t cellSize() const { return m_cellSize; }
- const AllocatorAttributes& attributes() const { return m_attributes; }
+ const CellAttributes& attributes() const { return m_attributes; }
bool needsDestruction() const { return m_attributes.destruction == NeedsDestruction; }
DestructionMode destruction() const { return m_attributes.destruction; }
HeapCell::Kind cellKind() const { return m_attributes.cellKind; }
@@ -115,40 +115,40 @@
static size_t blockSizeForBytes(size_t);
Lock& bitvectorLock() { return m_bitvectorLock; }
-
-#define MARKED_ALLOCATOR_BIT_ACCESSORS(lowerBitName, capitalBitName) \
+
+#define BLOCK_DIRECTORY_BIT_ACCESSORS(lowerBitName, capitalBitName) \
bool is ## capitalBitName(const AbstractLocker&, size_t index) const { return m_ ## lowerBitName[index]; } \
bool is ## capitalBitName(const AbstractLocker& locker, MarkedBlock::Handle* block) const { return is ## capitalBitName(locker, block->index()); } \
void setIs ## capitalBitName(const AbstractLocker&, size_t index, bool value) { m_ ## lowerBitName[index] = value; } \
void setIs ## capitalBitName(const AbstractLocker& locker, MarkedBlock::Handle* block, bool value) { setIs ## capitalBitName(locker, block->index(), value); }
- FOR_EACH_MARKED_ALLOCATOR_BIT(MARKED_ALLOCATOR_BIT_ACCESSORS)
-#undef MARKED_ALLOCATOR_BIT_ACCESSORS
+ FOR_EACH_BLOCK_DIRECTORY_BIT(BLOCK_DIRECTORY_BIT_ACCESSORS)
+#undef BLOCK_DIRECTORY_BIT_ACCESSORS
template<typename Func>
void forEachBitVector(const AbstractLocker&, const Func& func)
{
-#define MARKED_ALLOCATOR_BIT_CALLBACK(lowerBitName, capitalBitName) \
+#define BLOCK_DIRECTORY_BIT_CALLBACK(lowerBitName, capitalBitName) \
func(m_ ## lowerBitName);
- FOR_EACH_MARKED_ALLOCATOR_BIT(MARKED_ALLOCATOR_BIT_CALLBACK);
-#undef MARKED_ALLOCATOR_BIT_CALLBACK
+ FOR_EACH_BLOCK_DIRECTORY_BIT(BLOCK_DIRECTORY_BIT_CALLBACK);
+#undef BLOCK_DIRECTORY_BIT_CALLBACK
}
template<typename Func>
void forEachBitVectorWithName(const AbstractLocker&, const Func& func)
{
-#define MARKED_ALLOCATOR_BIT_CALLBACK(lowerBitName, capitalBitName) \
+#define BLOCK_DIRECTORY_BIT_CALLBACK(lowerBitName, capitalBitName) \
func(m_ ## lowerBitName, #capitalBitName);
- FOR_EACH_MARKED_ALLOCATOR_BIT(MARKED_ALLOCATOR_BIT_CALLBACK);
-#undef MARKED_ALLOCATOR_BIT_CALLBACK
+ FOR_EACH_BLOCK_DIRECTORY_BIT(BLOCK_DIRECTORY_BIT_CALLBACK);
+#undef BLOCK_DIRECTORY_BIT_CALLBACK
}
- MarkedAllocator* nextAllocator() const { return m_nextAllocator; }
- MarkedAllocator* nextAllocatorInSubspace() const { return m_nextAllocatorInSubspace; }
- MarkedAllocator* nextAllocatorInAlignedMemoryAllocator() const { return m_nextAllocatorInAlignedMemoryAllocator; }
+ BlockDirectory* nextDirectory() const { return m_nextDirectory; }
+ BlockDirectory* nextDirectoryInSubspace() const { return m_nextDirectoryInSubspace; }
+ BlockDirectory* nextDirectoryInAlignedMemoryAllocator() const { return m_nextDirectoryInAlignedMemoryAllocator; }
- void setNextAllocator(MarkedAllocator* allocator) { m_nextAllocator = allocator; }
- void setNextAllocatorInSubspace(MarkedAllocator* allocator) { m_nextAllocatorInSubspace = allocator; }
- void setNextAllocatorInAlignedMemoryAllocator(MarkedAllocator* allocator) { m_nextAllocatorInAlignedMemoryAllocator = allocator; }
+ void setNextDirectory(BlockDirectory* directory) { m_nextDirectory = directory; }
+ void setNextDirectoryInSubspace(BlockDirectory* directory) { m_nextDirectoryInSubspace = directory; }
+ void setNextDirectoryInAlignedMemoryAllocator(BlockDirectory* directory) { m_nextDirectoryInAlignedMemoryAllocator = directory; }
MarkedBlock::Handle* findEmptyBlockToSteal();
@@ -182,10 +182,10 @@
// Mutator uses this to guard resizing the bitvectors. Those things in the GC that may run
// concurrently to the mutator must lock this when accessing the bitvectors.
Lock m_bitvectorLock;
-#define MARKED_ALLOCATOR_BIT_DECLARATION(lowerBitName, capitalBitName) \
+#define BLOCK_DIRECTORY_BIT_DECLARATION(lowerBitName, capitalBitName) \
FastBitVector m_ ## lowerBitName;
- FOR_EACH_MARKED_ALLOCATOR_BIT(MARKED_ALLOCATOR_BIT_DECLARATION)
-#undef MARKED_ALLOCATOR_BIT_DECLARATION
+ FOR_EACH_BLOCK_DIRECTORY_BIT(BLOCK_DIRECTORY_BIT_DECLARATION)
+#undef BLOCK_DIRECTORY_BIT_DECLARATION
// After you do something to a block based on one of these cursors, you clear the bit in the
// corresponding bitvector and leave the cursor where it was.
@@ -198,24 +198,24 @@
Lock m_lock;
unsigned m_cellSize;
- AllocatorAttributes m_attributes;
+ CellAttributes m_attributes;
// FIXME: All of these should probably be references.
// https://bugs.webkit.org/show_bug.cgi?id=166988
Heap* m_heap { nullptr };
Subspace* m_subspace { nullptr };
- MarkedAllocator* m_nextAllocator { nullptr };
- MarkedAllocator* m_nextAllocatorInSubspace { nullptr };
- MarkedAllocator* m_nextAllocatorInAlignedMemoryAllocator { nullptr };
+ BlockDirectory* m_nextDirectory { nullptr };
+ BlockDirectory* m_nextDirectoryInSubspace { nullptr };
+ BlockDirectory* m_nextDirectoryInAlignedMemoryAllocator { nullptr };
};
-inline ptrdiff_t MarkedAllocator::offsetOfFreeList()
+inline ptrdiff_t BlockDirectory::offsetOfFreeList()
{
- return OBJECT_OFFSETOF(MarkedAllocator, m_freeList);
+ return OBJECT_OFFSETOF(BlockDirectory, m_freeList);
}
-inline ptrdiff_t MarkedAllocator::offsetOfCellSize()
+inline ptrdiff_t BlockDirectory::offsetOfCellSize()
{
- return OBJECT_OFFSETOF(MarkedAllocator, m_cellSize);
+ return OBJECT_OFFSETOF(BlockDirectory, m_cellSize);
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/MarkedAllocatorInlines.h b/Source/JavaScriptCore/heap/BlockDirectoryInlines.h
similarity index 80%
rename from Source/JavaScriptCore/heap/MarkedAllocatorInlines.h
rename to Source/JavaScriptCore/heap/BlockDirectoryInlines.h
index f7c9580..5001a42 100644
--- a/Source/JavaScriptCore/heap/MarkedAllocatorInlines.h
+++ b/Source/JavaScriptCore/heap/BlockDirectoryInlines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,18 +25,18 @@
#pragma once
+#include "BlockDirectory.h"
#include "FreeListInlines.h"
-#include "MarkedAllocator.h"
#include "VM.h"
namespace JSC {
-inline bool MarkedAllocator::isFreeListedCell(const void* target) const
+inline bool BlockDirectory::isFreeListedCell(const void* target) const
{
return m_freeList.contains(bitwise_cast<HeapCell*>(target));
}
-ALWAYS_INLINE void* MarkedAllocator::allocate(GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
+ALWAYS_INLINE void* BlockDirectory::allocate(GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
{
return m_freeList.allocate(
[&] () -> HeapCell* {
@@ -45,7 +45,7 @@
});
}
-template <typename Functor> inline void MarkedAllocator::forEachBlock(const Functor& functor)
+template <typename Functor> inline void BlockDirectory::forEachBlock(const Functor& functor)
{
m_live.forEachSetBit(
[&] (size_t index) {
@@ -53,7 +53,7 @@
});
}
-template <typename Functor> inline void MarkedAllocator::forEachNotEmptyBlock(const Functor& functor)
+template <typename Functor> inline void BlockDirectory::forEachNotEmptyBlock(const Functor& functor)
{
m_markingNotEmpty.forEachSetBit(
[&] (size_t index) {
diff --git a/Source/JavaScriptCore/heap/AllocatorAttributes.cpp b/Source/JavaScriptCore/heap/CellAttributes.cpp
similarity index 90%
rename from Source/JavaScriptCore/heap/AllocatorAttributes.cpp
rename to Source/JavaScriptCore/heap/CellAttributes.cpp
index 468f91c..9ce14c0 100644
--- a/Source/JavaScriptCore/heap/AllocatorAttributes.cpp
+++ b/Source/JavaScriptCore/heap/CellAttributes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,13 +24,13 @@
*/
#include "config.h"
-#include "AllocatorAttributes.h"
+#include "CellAttributes.h"
#include <wtf/PrintStream.h>
namespace JSC {
-void AllocatorAttributes::dump(PrintStream& out) const
+void CellAttributes::dump(PrintStream& out) const
{
out.print("{", destruction, ", ", cellKind, "}");
}
diff --git a/Source/JavaScriptCore/heap/AllocatorAttributes.h b/Source/JavaScriptCore/heap/CellAttributes.h
similarity index 89%
rename from Source/JavaScriptCore/heap/AllocatorAttributes.h
rename to Source/JavaScriptCore/heap/CellAttributes.h
index 81b77c6..a024760 100644
--- a/Source/JavaScriptCore/heap/AllocatorAttributes.h
+++ b/Source/JavaScriptCore/heap/CellAttributes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,10 +31,10 @@
namespace JSC {
-struct AllocatorAttributes {
- AllocatorAttributes() { }
+struct CellAttributes {
+ CellAttributes() { }
- AllocatorAttributes(DestructionMode destruction, HeapCell::Kind cellKind)
+ CellAttributes(DestructionMode destruction, HeapCell::Kind cellKind)
: destruction(destruction)
, cellKind(cellKind)
{
diff --git a/Source/JavaScriptCore/heap/CompleteSubspace.cpp b/Source/JavaScriptCore/heap/CompleteSubspace.cpp
index 685ec1d..b35a83b 100644
--- a/Source/JavaScriptCore/heap/CompleteSubspace.cpp
+++ b/Source/JavaScriptCore/heap/CompleteSubspace.cpp
@@ -26,8 +26,8 @@
#include "config.h"
#include "Subspace.h"
+#include "BlockDirectoryInlines.h"
#include "JSCInlines.h"
-#include "MarkedAllocatorInlines.h"
#include "MarkedBlockInlines.h"
#include "PreventCollectionScope.h"
#include "SubspaceInlines.h"
@@ -46,7 +46,7 @@
{
}
-MarkedAllocator* CompleteSubspace::allocatorFor(size_t size, AllocatorForMode mode)
+BlockDirectory* CompleteSubspace::allocatorFor(size_t size, AllocatorForMode mode)
{
return allocatorForNonVirtual(size, mode);
}
@@ -59,14 +59,14 @@
void* CompleteSubspace::allocateNonVirtual(size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
{
void *result;
- if (MarkedAllocator* allocator = allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists))
+ if (BlockDirectory* allocator = allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists))
result = allocator->allocate(deferralContext, failureMode);
else
result = allocateSlow(size, deferralContext, failureMode);
return result;
}
-MarkedAllocator* CompleteSubspace::allocatorForSlow(size_t size)
+BlockDirectory* CompleteSubspace::allocatorForSlow(size_t size)
{
size_t index = MarkedSpace::sizeClassToIndex(size);
size_t sizeClass = MarkedSpace::s_sizeClassForSizeStep[index];
@@ -78,36 +78,36 @@
// just-as-good solution would be to return null if we're in the JIT since the JIT treats null
// allocator as "please always take the slow path". But, that could lead to performance
// surprises and the algorithm here is pretty easy. Only this code has to hold the lock, to
- // prevent simultaneously MarkedAllocator creations from multiple threads. This code ensures
+ // prevent simultaneously BlockDirectory creations from multiple threads. This code ensures
// that any "forEachAllocator" traversals will only see this allocator after it's initialized
// enough: it will have
- auto locker = holdLock(m_space.allocatorLock());
- if (MarkedAllocator* allocator = m_allocatorForSizeStep[index])
+ auto locker = holdLock(m_space.directoryLock());
+ if (BlockDirectory* allocator = m_allocatorForSizeStep[index])
return allocator;
if (false)
dataLog("Creating marked allocator for ", m_name, ", ", m_attributes, ", ", sizeClass, ".\n");
- std::unique_ptr<MarkedAllocator> uniqueAllocator =
- std::make_unique<MarkedAllocator>(m_space.heap(), sizeClass);
- MarkedAllocator* allocator = uniqueAllocator.get();
- m_allocators.append(WTFMove(uniqueAllocator));
- allocator->setSubspace(this);
- m_space.addMarkedAllocator(locker, allocator);
+ std::unique_ptr<BlockDirectory> uniqueDirectory =
+ std::make_unique<BlockDirectory>(m_space.heap(), sizeClass);
+ BlockDirectory* directory = uniqueDirectory.get();
+ m_directories.append(WTFMove(uniqueDirectory));
+ directory->setSubspace(this);
+ m_space.addBlockDirectory(locker, directory);
index = MarkedSpace::sizeClassToIndex(sizeClass);
for (;;) {
if (MarkedSpace::s_sizeClassForSizeStep[index] != sizeClass)
break;
- m_allocatorForSizeStep[index] = allocator;
+ m_allocatorForSizeStep[index] = directory;
if (!index--)
break;
}
- allocator->setNextAllocatorInSubspace(m_firstAllocator);
- m_alignedMemoryAllocator->registerAllocator(allocator);
+ directory->setNextDirectoryInSubspace(m_firstDirectory);
+ m_alignedMemoryAllocator->registerDirectory(directory);
WTF::storeStoreFence();
- m_firstAllocator = allocator;
- return allocator;
+ m_firstDirectory = directory;
+ return directory;
}
void* CompleteSubspace::allocateSlow(size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
@@ -122,7 +122,7 @@
{
sanitizeStackForVM(m_space.heap()->vm());
- if (MarkedAllocator* allocator = allocatorFor(size, AllocatorForMode::EnsureAllocator))
+ if (BlockDirectory* allocator = allocatorFor(size, AllocatorForMode::EnsureAllocator))
return allocator->allocate(deferralContext, AllocationFailureMode::ReturnNull);
if (size <= Options::largeAllocationCutoff()
diff --git a/Source/JavaScriptCore/heap/CompleteSubspace.h b/Source/JavaScriptCore/heap/CompleteSubspace.h
index 942d87f..475d4fa 100644
--- a/Source/JavaScriptCore/heap/CompleteSubspace.h
+++ b/Source/JavaScriptCore/heap/CompleteSubspace.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,31 +37,33 @@
// In some code paths, we need it to be a compile error to call the virtual version of one of
// these functions. That's why we do final methods the old school way.
- MarkedAllocator* allocatorFor(size_t, AllocatorForMode) override;
- MarkedAllocator* allocatorForNonVirtual(size_t, AllocatorForMode);
+ // FIXME: Currently subspaces speak of BlockDirectories as "allocators", but that's temporary.
+ // https://bugs.webkit.org/show_bug.cgi?id=181559
+ BlockDirectory* allocatorFor(size_t, AllocatorForMode) override;
+ BlockDirectory* allocatorForNonVirtual(size_t, AllocatorForMode);
void* allocate(size_t, GCDeferralContext*, AllocationFailureMode) override;
JS_EXPORT_PRIVATE void* allocateNonVirtual(size_t, GCDeferralContext*, AllocationFailureMode);
static ptrdiff_t offsetOfAllocatorForSizeStep() { return OBJECT_OFFSETOF(CompleteSubspace, m_allocatorForSizeStep); }
- MarkedAllocator** allocatorForSizeStep() { return &m_allocatorForSizeStep[0]; }
+ BlockDirectory** allocatorForSizeStep() { return &m_allocatorForSizeStep[0]; }
private:
- MarkedAllocator* allocatorForSlow(size_t);
+ BlockDirectory* allocatorForSlow(size_t);
// These slow paths are concerned with large allocations and allocator creation.
void* allocateSlow(size_t, GCDeferralContext*, AllocationFailureMode);
void* tryAllocateSlow(size_t, GCDeferralContext*);
- std::array<MarkedAllocator*, MarkedSpace::numSizeClasses> m_allocatorForSizeStep;
- Vector<std::unique_ptr<MarkedAllocator>> m_allocators;
+ std::array<BlockDirectory*, MarkedSpace::numSizeClasses> m_allocatorForSizeStep;
+ Vector<std::unique_ptr<BlockDirectory>> m_directories;
};
-ALWAYS_INLINE MarkedAllocator* CompleteSubspace::allocatorForNonVirtual(size_t size, AllocatorForMode mode)
+ALWAYS_INLINE BlockDirectory* CompleteSubspace::allocatorForNonVirtual(size_t size, AllocatorForMode mode)
{
if (size <= MarkedSpace::largeCutoff) {
- MarkedAllocator* result = m_allocatorForSizeStep[MarkedSpace::sizeClassToIndex(size)];
+ BlockDirectory* result = m_allocatorForSizeStep[MarkedSpace::sizeClassToIndex(size)];
switch (mode) {
case AllocatorForMode::MustAlreadyHaveAllocator:
RELEASE_ASSERT(result);
diff --git a/Source/JavaScriptCore/heap/GCDeferralContext.h b/Source/JavaScriptCore/heap/GCDeferralContext.h
index b4d151e..95e710f 100644
--- a/Source/JavaScriptCore/heap/GCDeferralContext.h
+++ b/Source/JavaScriptCore/heap/GCDeferralContext.h
@@ -28,11 +28,11 @@
namespace JSC {
class Heap;
-class MarkedAllocator;
+class BlockDirectory;
class GCDeferralContext {
friend class Heap;
- friend class MarkedAllocator;
+ friend class BlockDirectory;
public:
inline GCDeferralContext(Heap&);
inline ~GCDeferralContext();
diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp
index 7b29f14..b30eb7e 100644
--- a/Source/JavaScriptCore/heap/Heap.cpp
+++ b/Source/JavaScriptCore/heap/Heap.cpp
@@ -21,6 +21,7 @@
#include "config.h"
#include "Heap.h"
+#include "BlockDirectoryInlines.h"
#include "CodeBlock.h"
#include "CodeBlockSetInlines.h"
#include "CollectingScope.h"
@@ -55,7 +56,6 @@
#include "JSWebAssemblyCodeBlock.h"
#include "MachineStackMarker.h"
#include "MarkStackMergingConstraint.h"
-#include "MarkedAllocatorInlines.h"
#include "MarkedSpaceInlines.h"
#include "MarkingConstraintSet.h"
#include "PreventCollectionScope.h"
@@ -2200,7 +2200,7 @@
size_t currentHeapSize = 0;
// For marked space, we use the total number of bytes visited. This matches the logic for
- // MarkedAllocator's calls to didAllocate(), which effectively accounts for the total size of
+ // BlockDirectory's calls to didAllocate(), which effectively accounts for the total size of
// objects allocated rather than blocks used. This will underestimate capacity(), and in case
// of fragmentation, this may be substantial. Fortunately, marked space rarely fragments because
// cells usually have a narrow range of sizes. So, the underestimation is probably OK.
diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h
index 8ececad..8246ae2 100644
--- a/Source/JavaScriptCore/heap/Heap.h
+++ b/Source/JavaScriptCore/heap/Heap.h
@@ -74,7 +74,7 @@
class MachineThreads;
class MarkStackArray;
class MarkStackMergingConstraint;
-class MarkedAllocator;
+class BlockDirectory;
class MarkedArgumentBuffer;
class MarkingConstraint;
class MarkingConstraintSet;
@@ -390,7 +390,7 @@
friend class LLIntOffsetsExtractor;
friend class MarkStackMergingConstraint;
friend class MarkedSpace;
- friend class MarkedAllocator;
+ friend class BlockDirectory;
friend class MarkedBlock;
friend class RunningScope;
friend class SlotVisitor;
diff --git a/Source/JavaScriptCore/heap/HeapCell.h b/Source/JavaScriptCore/heap/HeapCell.h
index 682187e..2080ea8 100644
--- a/Source/JavaScriptCore/heap/HeapCell.h
+++ b/Source/JavaScriptCore/heap/HeapCell.h
@@ -35,7 +35,7 @@
class MarkedBlock;
class Subspace;
class VM;
-struct AllocatorAttributes;
+struct CellAttributes;
class HeapCell {
public:
@@ -66,7 +66,7 @@
VM* vm() const;
size_t cellSize() const;
- AllocatorAttributes allocatorAttributes() const;
+ CellAttributes cellAttributes() const;
DestructionMode destructionMode() const;
Kind cellKind() const;
Subspace* subspace() const;
diff --git a/Source/JavaScriptCore/heap/HeapCellInlines.h b/Source/JavaScriptCore/heap/HeapCellInlines.h
index 563ee01..93fbf1b 100644
--- a/Source/JavaScriptCore/heap/HeapCellInlines.h
+++ b/Source/JavaScriptCore/heap/HeapCellInlines.h
@@ -73,7 +73,7 @@
return markedBlock().cellSize();
}
-ALWAYS_INLINE AllocatorAttributes HeapCell::allocatorAttributes() const
+ALWAYS_INLINE CellAttributes HeapCell::cellAttributes() const
{
if (isLargeAllocation())
return largeAllocation().attributes();
@@ -82,12 +82,12 @@
ALWAYS_INLINE DestructionMode HeapCell::destructionMode() const
{
- return allocatorAttributes().destruction;
+ return cellAttributes().destruction;
}
ALWAYS_INLINE HeapCell::Kind HeapCell::cellKind() const
{
- return allocatorAttributes().cellKind;
+ return cellAttributes().cellKind;
}
ALWAYS_INLINE Subspace* HeapCell::subspace() const
diff --git a/Source/JavaScriptCore/heap/HeapCellType.cpp b/Source/JavaScriptCore/heap/HeapCellType.cpp
index ce35883..cb937c4 100644
--- a/Source/JavaScriptCore/heap/HeapCellType.cpp
+++ b/Source/JavaScriptCore/heap/HeapCellType.cpp
@@ -47,7 +47,7 @@
}
};
-HeapCellType::HeapCellType(AllocatorAttributes attributes)
+HeapCellType::HeapCellType(CellAttributes attributes)
: m_attributes(attributes)
{
}
diff --git a/Source/JavaScriptCore/heap/HeapCellType.h b/Source/JavaScriptCore/heap/HeapCellType.h
index ade4364..7e59586 100644
--- a/Source/JavaScriptCore/heap/HeapCellType.h
+++ b/Source/JavaScriptCore/heap/HeapCellType.h
@@ -33,10 +33,10 @@
WTF_MAKE_NONCOPYABLE(HeapCellType);
WTF_MAKE_FAST_ALLOCATED;
public:
- JS_EXPORT_PRIVATE HeapCellType(AllocatorAttributes);
+ JS_EXPORT_PRIVATE HeapCellType(CellAttributes);
JS_EXPORT_PRIVATE virtual ~HeapCellType();
- const AllocatorAttributes& attributes() const { return m_attributes; }
+ const CellAttributes& attributes() const { return m_attributes; }
// The purpose of overriding this is to specialize the sweep for your destructors. This won't
// be called for no-destructor blocks. This must call MarkedBlock::finishSweepKnowingSubspace.
@@ -46,7 +46,7 @@
virtual void destroy(VM&, JSCell*);
private:
- AllocatorAttributes m_attributes;
+ CellAttributes m_attributes;
};
} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/IncrementalSweeper.cpp b/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
index 52a5d53..9159f2d 100644
--- a/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
+++ b/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
@@ -46,7 +46,7 @@
IncrementalSweeper::IncrementalSweeper(Heap* heap)
: Base(heap->vm())
- , m_currentAllocator(nullptr)
+ , m_currentDirectory(nullptr)
{
}
@@ -79,8 +79,8 @@
MarkedBlock::Handle* block = nullptr;
- for (; m_currentAllocator; m_currentAllocator = m_currentAllocator->nextAllocator()) {
- block = m_currentAllocator->findBlockToSweep();
+ for (; m_currentDirectory; m_currentDirectory = m_currentDirectory->nextDirectory()) {
+ block = m_currentDirectory->findBlockToSweep();
if (block)
break;
}
@@ -98,12 +98,12 @@
void IncrementalSweeper::startSweeping()
{
scheduleTimer();
- m_currentAllocator = m_vm->heap.objectSpace().firstAllocator();
+ m_currentDirectory = m_vm->heap.objectSpace().firstDirectory();
}
void IncrementalSweeper::stopSweeping()
{
- m_currentAllocator = nullptr;
+ m_currentDirectory = nullptr;
if (m_vm)
cancelTimer();
}
diff --git a/Source/JavaScriptCore/heap/IncrementalSweeper.h b/Source/JavaScriptCore/heap/IncrementalSweeper.h
index 0e7603e..abd8e69 100644
--- a/Source/JavaScriptCore/heap/IncrementalSweeper.h
+++ b/Source/JavaScriptCore/heap/IncrementalSweeper.h
@@ -30,7 +30,7 @@
namespace JSC {
class Heap;
-class MarkedAllocator;
+class BlockDirectory;
class IncrementalSweeper : public JSRunLoopTimer {
public:
@@ -48,7 +48,7 @@
void doSweep(MonotonicTime startTime);
void scheduleTimer();
- MarkedAllocator* m_currentAllocator;
+ BlockDirectory* m_currentDirectory;
bool m_shouldFreeFastMallocMemoryAfterSweeping { false };
};
diff --git a/Source/JavaScriptCore/heap/IsoCellSet.cpp b/Source/JavaScriptCore/heap/IsoCellSet.cpp
index f828f6e..184ef0e 100644
--- a/Source/JavaScriptCore/heap/IsoCellSet.cpp
+++ b/Source/JavaScriptCore/heap/IsoCellSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,7 +26,7 @@
#include "config.h"
#include "IsoCellSet.h"
-#include "MarkedAllocatorInlines.h"
+#include "BlockDirectoryInlines.h"
#include "MarkedBlockInlines.h"
namespace JSC {
@@ -34,7 +34,7 @@
IsoCellSet::IsoCellSet(IsoSubspace& subspace)
: m_subspace(subspace)
{
- size_t size = subspace.m_allocator.m_blocks.size();
+ size_t size = subspace.m_directory.m_blocks.size();
m_blocksWithBits.resize(size);
m_bits.grow(size);
subspace.m_cellSets.append(this);
@@ -52,7 +52,7 @@
public:
Task(IsoCellSet& set)
: m_set(set)
- , m_allocator(set.m_subspace.m_allocator)
+ , m_directory(set.m_subspace.m_directory)
{
}
@@ -61,18 +61,18 @@
if (m_done)
return nullptr;
auto locker = holdLock(m_lock);
- auto bits = m_allocator.m_markingNotEmpty & m_set.m_blocksWithBits;
+ auto bits = m_directory.m_markingNotEmpty & m_set.m_blocksWithBits;
m_index = bits.findBit(m_index, true);
- if (m_index >= m_allocator.m_blocks.size()) {
+ if (m_index >= m_directory.m_blocks.size()) {
m_done = true;
return nullptr;
}
- return m_allocator.m_blocks[m_index++];
+ return m_directory.m_blocks[m_index++];
}
private:
IsoCellSet& m_set;
- MarkedAllocator& m_allocator;
+ BlockDirectory& m_directory;
size_t m_index { 0 };
Lock m_lock;
bool m_done { false };
@@ -83,7 +83,7 @@
NEVER_INLINE Bitmap<MarkedBlock::atomsPerBlock>* IsoCellSet::addSlow(size_t blockIndex)
{
- auto locker = holdLock(m_subspace.m_allocator.m_bitvectorLock);
+ auto locker = holdLock(m_subspace.m_directory.m_bitvectorLock);
auto& bitsPtrRef = m_bits[blockIndex];
auto* bits = bitsPtrRef.get();
if (!bits) {
@@ -104,7 +104,7 @@
void IsoCellSet::didRemoveBlock(size_t blockIndex)
{
{
- auto locker = holdLock(m_subspace.m_allocator.m_bitvectorLock);
+ auto locker = holdLock(m_subspace.m_directory.m_bitvectorLock);
m_blocksWithBits[blockIndex] = false;
}
m_bits[blockIndex] = nullptr;
@@ -135,7 +135,7 @@
{
// Holding the bitvector lock happens to be enough because that's what we also hold in
// other places where we manipulate this bitvector.
- auto locker = holdLock(m_subspace.m_allocator.m_bitvectorLock);
+ auto locker = holdLock(m_subspace.m_directory.m_bitvectorLock);
m_blocksWithBits[block->index()] = false;
}
m_bits[block->index()] = nullptr;
diff --git a/Source/JavaScriptCore/heap/IsoCellSetInlines.h b/Source/JavaScriptCore/heap/IsoCellSetInlines.h
index d9434b7..ac412a7 100644
--- a/Source/JavaScriptCore/heap/IsoCellSetInlines.h
+++ b/Source/JavaScriptCore/heap/IsoCellSetInlines.h
@@ -63,10 +63,10 @@
template<typename Func>
void IsoCellSet::forEachMarkedCell(const Func& func)
{
- MarkedAllocator& allocator = m_subspace.m_allocator;
- (allocator.m_markingNotEmpty & m_blocksWithBits).forEachSetBit(
+ BlockDirectory& directory = m_subspace.m_directory;
+ (directory.m_markingNotEmpty & m_blocksWithBits).forEachSetBit(
[&] (size_t blockIndex) {
- MarkedBlock::Handle* block = allocator.m_blocks[blockIndex];
+ MarkedBlock::Handle* block = directory.m_blocks[blockIndex];
auto* bits = m_bits[blockIndex].get();
block->forEachMarkedCell(
@@ -117,10 +117,10 @@
template<typename Func>
void IsoCellSet::forEachLiveCell(const Func& func)
{
- MarkedAllocator& allocator = m_subspace.m_allocator;
+ BlockDirectory& directory = m_subspace.m_directory;
m_blocksWithBits.forEachSetBit(
[&] (size_t blockIndex) {
- MarkedBlock::Handle* block = allocator.m_blocks[blockIndex];
+ MarkedBlock::Handle* block = directory.m_blocks[blockIndex];
// FIXME: We could optimize this by checking our bits before querying isLive.
// OOPS! (need bug URL)
diff --git a/Source/JavaScriptCore/heap/IsoSubspace.cpp b/Source/JavaScriptCore/heap/IsoSubspace.cpp
index 58cd5e9..194936f 100644
--- a/Source/JavaScriptCore/heap/IsoSubspace.cpp
+++ b/Source/JavaScriptCore/heap/IsoSubspace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,31 +26,31 @@
#include "config.h"
#include "IsoSubspace.h"
+#include "BlockDirectoryInlines.h"
#include "IsoAlignedMemoryAllocator.h"
-#include "MarkedAllocatorInlines.h"
namespace JSC {
IsoSubspace::IsoSubspace(CString name, Heap& heap, HeapCellType* heapCellType, size_t size)
: Subspace(name, heap)
, m_size(size)
- , m_allocator(&heap, WTF::roundUpToMultipleOf<MarkedBlock::atomSize>(size))
+ , m_directory(&heap, WTF::roundUpToMultipleOf<MarkedBlock::atomSize>(size))
, m_isoAlignedMemoryAllocator(std::make_unique<IsoAlignedMemoryAllocator>())
{
initialize(heapCellType, m_isoAlignedMemoryAllocator.get());
- auto locker = holdLock(m_space.allocatorLock());
- m_allocator.setSubspace(this);
- m_space.addMarkedAllocator(locker, &m_allocator);
- m_alignedMemoryAllocator->registerAllocator(&m_allocator);
- m_firstAllocator = &m_allocator;
+ auto locker = holdLock(m_space.directoryLock());
+ m_directory.setSubspace(this);
+ m_space.addBlockDirectory(locker, &m_directory);
+ m_alignedMemoryAllocator->registerDirectory(&m_directory);
+ m_firstDirectory = &m_directory;
}
IsoSubspace::~IsoSubspace()
{
}
-MarkedAllocator* IsoSubspace::allocatorFor(size_t size, AllocatorForMode mode)
+BlockDirectory* IsoSubspace::allocatorFor(size_t size, AllocatorForMode mode)
{
return allocatorForNonVirtual(size, mode);
}
@@ -63,7 +63,7 @@
void* IsoSubspace::allocateNonVirtual(size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
{
RELEASE_ASSERT(size == this->size());
- void* result = m_allocator.allocate(deferralContext, failureMode);
+ void* result = m_directory.allocate(deferralContext, failureMode);
return result;
}
diff --git a/Source/JavaScriptCore/heap/IsoSubspace.h b/Source/JavaScriptCore/heap/IsoSubspace.h
index c8a0aa1..374f31d 100644
--- a/Source/JavaScriptCore/heap/IsoSubspace.h
+++ b/Source/JavaScriptCore/heap/IsoSubspace.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,7 +25,7 @@
#pragma once
-#include "MarkedAllocator.h"
+#include "BlockDirectory.h"
#include "Subspace.h"
#include <wtf/SinglyLinkedListWithTail.h>
@@ -41,11 +41,11 @@
size_t size() const { return m_size; }
- MarkedAllocator* allocatorFor(size_t, AllocatorForMode) override;
- MarkedAllocator* allocatorForNonVirtual(size_t size, AllocatorForMode);
+ BlockDirectory* allocatorFor(size_t, AllocatorForMode) override;
+ BlockDirectory* allocatorForNonVirtual(size_t, AllocatorForMode);
void* allocate(size_t, GCDeferralContext*, AllocationFailureMode) override;
- JS_EXPORT_PRIVATE void* allocateNonVirtual(size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode);
+ JS_EXPORT_PRIVATE void* allocateNonVirtual(size_t, GCDeferralContext*, AllocationFailureMode);
private:
friend class IsoCellSet;
@@ -55,15 +55,15 @@
void didBeginSweepingToFreeList(MarkedBlock::Handle*) override;
size_t m_size;
- MarkedAllocator m_allocator;
+ BlockDirectory m_directory;
std::unique_ptr<IsoAlignedMemoryAllocator> m_isoAlignedMemoryAllocator;
SentinelLinkedList<IsoCellSet, BasicRawSentinelNode<IsoCellSet>> m_cellSets;
};
-inline MarkedAllocator* IsoSubspace::allocatorForNonVirtual(size_t size, AllocatorForMode)
+inline BlockDirectory* IsoSubspace::allocatorForNonVirtual(size_t size, AllocatorForMode)
{
RELEASE_ASSERT(size == this->size());
- return &m_allocator;
+ return &m_directory;
}
#define ISO_SUBSPACE_INIT(heap, heapCellType, type) ("Isolated " #type " Space", (heap), (heapCellType), sizeof(type))
diff --git a/Source/JavaScriptCore/heap/LargeAllocation.h b/Source/JavaScriptCore/heap/LargeAllocation.h
index 313f3cd..fe943f9 100644
--- a/Source/JavaScriptCore/heap/LargeAllocation.h
+++ b/Source/JavaScriptCore/heap/LargeAllocation.h
@@ -110,7 +110,7 @@
return aboveLowerBound(rawPtr) && belowUpperBound(rawPtr);
}
- const AllocatorAttributes& attributes() const { return m_attributes; }
+ const CellAttributes& attributes() const { return m_attributes; }
Dependency aboutToMark(HeapVersion) { return Dependency(); }
@@ -152,7 +152,7 @@
bool m_isNewlyAllocated;
bool m_hasValidCell;
Atomic<bool> m_isMarked;
- AllocatorAttributes m_attributes;
+ CellAttributes m_attributes;
Subspace* m_subspace;
WeakSet m_weakSet;
};
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.cpp b/Source/JavaScriptCore/heap/MarkedBlock.cpp
index 3eb9ec2..34a40b5 100644
--- a/Source/JavaScriptCore/heap/MarkedBlock.cpp
+++ b/Source/JavaScriptCore/heap/MarkedBlock.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
#include "MarkedBlock.h"
#include "AlignedMemoryAllocator.h"
+#include "BlockDirectoryInlines.h"
#include "FreeListInlines.h"
#include "JSCell.h"
#include "JSDestructibleObject.h"
#include "JSCInlines.h"
-#include "MarkedAllocatorInlines.h"
#include "MarkedBlockInlines.h"
#include "SuperSampler.h"
#include "SweepingScope.h"
@@ -79,7 +79,7 @@
if (!(balance % 10))
dataLog("MarkedBlock Balance: ", balance, "\n");
}
- removeFromAllocator();
+ removeFromDirectory();
m_block->~MarkedBlock();
m_alignedMemoryAllocator->freeAlignedMemory(m_block);
heap.didFreeBlock(blockSize);
@@ -102,7 +102,7 @@
void MarkedBlock::Handle::setIsFreeListed()
{
- m_allocator->setIsEmpty(NoLockingNecessary, this, false);
+ m_directory->setIsEmpty(NoLockingNecessary, this, false);
m_isFreeListed = true;
}
@@ -112,7 +112,7 @@
if (false)
dataLog(RawPointer(this), ": MarkedBlock::Handle::stopAllocating!\n");
- ASSERT(!allocator()->isAllocated(NoLockingNecessary, this));
+ ASSERT(!directory()->isAllocated(NoLockingNecessary, this));
if (!isFreeListed()) {
if (false)
@@ -153,8 +153,8 @@
void MarkedBlock::Handle::lastChanceToFinalize()
{
- allocator()->setIsAllocated(NoLockingNecessary, this, false);
- allocator()->setIsDestructible(NoLockingNecessary, this, true);
+ directory()->setIsAllocated(NoLockingNecessary, this, false);
+ directory()->setIsDestructible(NoLockingNecessary, this, true);
m_block->m_marks.clearAll();
m_block->clearHasAnyMarked();
m_block->m_markingVersion = heap()->objectSpace().markingVersion();
@@ -171,7 +171,7 @@
if (false)
dataLog(RawPointer(this), ": MarkedBlock::Handle::resumeAllocating!\n");
- ASSERT(!allocator()->isAllocated(NoLockingNecessary, this));
+ ASSERT(!directory()->isAllocated(NoLockingNecessary, this));
ASSERT(!isFreeListed());
if (!hasAnyNewlyAllocated()) {
@@ -205,9 +205,9 @@
if (!areMarksStale(markingVersion))
return;
- MarkedAllocator* allocator = handle().allocator();
+ BlockDirectory* directory = handle().directory();
- if (handle().allocator()->isAllocated(holdLock(allocator->bitvectorLock()), &handle())
+ if (handle().directory()->isAllocated(holdLock(directory->bitvectorLock()), &handle())
|| !marksConveyLivenessDuringMarking(markingVersion)) {
if (false)
dataLog(RawPointer(this), ": Clearing marks without doing anything else.\n");
@@ -242,7 +242,7 @@
m_markingVersion = markingVersion;
// This means we're the first ones to mark any object in this block.
- allocator->setIsMarkingNotEmpty(holdLock(allocator->bitvectorLock()), &handle(), true);
+ directory->setIsMarkingNotEmpty(holdLock(directory->bitvectorLock()), &handle(), true);
}
void MarkedBlock::Handle::resetAllocated()
@@ -293,7 +293,7 @@
dataLog(RawPointer(this), ": MarkedBlock::Handle::didConsumeFreeList!\n");
ASSERT(isFreeListed());
m_isFreeListed = false;
- allocator()->setIsAllocated(NoLockingNecessary, this, true);
+ directory()->setIsAllocated(NoLockingNecessary, this, true);
}
size_t MarkedBlock::markCount()
@@ -308,34 +308,34 @@
void MarkedBlock::noteMarkedSlow()
{
- MarkedAllocator* allocator = handle().allocator();
- allocator->setIsMarkingRetired(holdLock(allocator->bitvectorLock()), &handle(), true);
+ BlockDirectory* directory = handle().directory();
+ directory->setIsMarkingRetired(holdLock(directory->bitvectorLock()), &handle(), true);
}
-void MarkedBlock::Handle::removeFromAllocator()
+void MarkedBlock::Handle::removeFromDirectory()
{
- if (!m_allocator)
+ if (!m_directory)
return;
- m_allocator->removeBlock(this);
+ m_directory->removeBlock(this);
}
-void MarkedBlock::Handle::didAddToAllocator(MarkedAllocator* allocator, size_t index)
+void MarkedBlock::Handle::didAddToDirectory(BlockDirectory* directory, size_t index)
{
ASSERT(m_index == std::numeric_limits<size_t>::max());
- ASSERT(!m_allocator);
+ ASSERT(!m_directory);
- RELEASE_ASSERT(allocator->subspace()->alignedMemoryAllocator() == m_alignedMemoryAllocator);
+ RELEASE_ASSERT(directory->subspace()->alignedMemoryAllocator() == m_alignedMemoryAllocator);
m_index = index;
- m_allocator = allocator;
- m_block->m_subspace = allocator->subspace();
+ m_directory = directory;
+ m_block->m_subspace = directory->subspace();
- size_t cellSize = allocator->cellSize();
+ size_t cellSize = directory->cellSize();
m_atomsPerCell = (cellSize + atomSize - 1) / atomSize;
m_endAtom = atomsPerBlock - m_atomsPerCell + 1;
- m_attributes = allocator->attributes();
+ m_attributes = directory->attributes();
if (m_attributes.cellKind != HeapCell::JSCell)
RELEASE_ASSERT(m_attributes.destruction == DoesNotNeedDestruction);
@@ -350,13 +350,13 @@
block().m_biasedMarkCount = block().m_markCountBias = static_cast<int16_t>(markCountBias);
}
-void MarkedBlock::Handle::didRemoveFromAllocator()
+void MarkedBlock::Handle::didRemoveFromDirectory()
{
ASSERT(m_index != std::numeric_limits<size_t>::max());
- ASSERT(m_allocator);
+ ASSERT(m_directory);
m_index = std::numeric_limits<size_t>::max();
- m_allocator = nullptr;
+ m_directory = nullptr;
m_block->m_subspace = nullptr;
}
@@ -371,8 +371,8 @@
void MarkedBlock::Handle::dumpState(PrintStream& out)
{
CommaPrinter comma;
- allocator()->forEachBitVectorWithName(
- holdLock(allocator()->bitvectorLock()),
+ directory()->forEachBitVectorWithName(
+ holdLock(directory()->bitvectorLock()),
[&] (FastBitVector& bitvector, const char* name) {
out.print(comma, name, ":", bitvector[index()] ? "YES" : "no");
});
@@ -380,7 +380,7 @@
Subspace* MarkedBlock::Handle::subspace() const
{
- return allocator()->subspace();
+ return directory()->subspace();
}
void MarkedBlock::Handle::sweep(FreeList* freeList)
@@ -389,12 +389,12 @@
SweepMode sweepMode = freeList ? SweepToFreeList : SweepOnly;
- m_allocator->setIsUnswept(NoLockingNecessary, this, false);
+ m_directory->setIsUnswept(NoLockingNecessary, this, false);
m_weakSet.sweep();
bool needsDestruction = m_attributes.destruction == NeedsDestruction
- && m_allocator->isDestructible(NoLockingNecessary, this);
+ && m_directory->isDestructible(NoLockingNecessary, this);
if (sweepMode == SweepOnly && !needsDestruction)
return;
@@ -464,7 +464,7 @@
bool MarkedBlock::Handle::isFreeListedCell(const void* target) const
{
ASSERT(isFreeListed());
- return m_allocator->isFreeListedCell(target);
+ return m_directory->isFreeListedCell(target);
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.h b/Source/JavaScriptCore/heap/MarkedBlock.h
index 11b72c7..905b9d4 100644
--- a/Source/JavaScriptCore/heap/MarkedBlock.h
+++ b/Source/JavaScriptCore/heap/MarkedBlock.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2018 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,7 +21,7 @@
#pragma once
-#include "AllocatorAttributes.h"
+#include "CellAttributes.h"
#include "DestructionMode.h"
#include "HeapCell.h"
#include "IterationStatus.h"
@@ -38,7 +38,7 @@
class FreeList;
class Heap;
class JSCell;
-class MarkedAllocator;
+class BlockDirectory;
class MarkedSpace;
class SlotVisitor;
class Subspace;
@@ -110,7 +110,7 @@
void lastChanceToFinalize();
- MarkedAllocator* allocator() const;
+ BlockDirectory* directory() const;
Subspace* subspace() const;
AlignedMemoryAllocator* alignedMemoryAllocator() const;
Heap* heap() const;
@@ -154,7 +154,7 @@
size_t cellSize();
inline unsigned cellsPerBlock();
- const AllocatorAttributes& attributes() const;
+ const CellAttributes& attributes() const;
DestructionMode destruction() const;
bool needsDestruction() const;
HeapCell::Kind cellKind() const;
@@ -197,10 +197,10 @@
size_t index() const { return m_index; }
- void removeFromAllocator();
+ void removeFromDirectory();
- void didAddToAllocator(MarkedAllocator*, size_t index);
- void didRemoveFromAllocator();
+ void didAddToDirectory(BlockDirectory*, size_t index);
+ void didRemoveFromDirectory();
void dumpState(PrintStream&);
@@ -232,11 +232,11 @@
Bitmap<atomsPerBlock> m_newlyAllocated;
- AllocatorAttributes m_attributes;
+ CellAttributes m_attributes;
bool m_isFreeListed { false };
AlignedMemoryAllocator* m_alignedMemoryAllocator { nullptr };
- MarkedAllocator* m_allocator { nullptr };
+ BlockDirectory* m_directory { nullptr };
size_t m_index { std::numeric_limits<size_t>::max() };
WeakSet m_weakSet;
@@ -269,7 +269,7 @@
void clearMarked(const void*);
size_t cellSize();
- const AllocatorAttributes& attributes() const;
+ const CellAttributes& attributes() const;
bool hasAnyMarked() const;
void noteMarked();
@@ -397,9 +397,9 @@
return reinterpret_cast<MarkedBlock*>(reinterpret_cast<Bits>(p) & blockMask);
}
-inline MarkedAllocator* MarkedBlock::Handle::allocator() const
+inline BlockDirectory* MarkedBlock::Handle::directory() const
{
- return m_allocator;
+ return m_directory;
}
inline AlignedMemoryAllocator* MarkedBlock::Handle::alignedMemoryAllocator() const
@@ -457,12 +457,12 @@
return m_handle.cellSize();
}
-inline const AllocatorAttributes& MarkedBlock::Handle::attributes() const
+inline const CellAttributes& MarkedBlock::Handle::attributes() const
{
return m_attributes;
}
-inline const AllocatorAttributes& MarkedBlock::attributes() const
+inline const CellAttributes& MarkedBlock::attributes() const
{
return m_handle.attributes();
}
diff --git a/Source/JavaScriptCore/heap/MarkedBlockInlines.h b/Source/JavaScriptCore/heap/MarkedBlockInlines.h
index ca735bf..2f7a44b 100644
--- a/Source/JavaScriptCore/heap/MarkedBlockInlines.h
+++ b/Source/JavaScriptCore/heap/MarkedBlockInlines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,8 +25,8 @@
#pragma once
+#include "BlockDirectory.h"
#include "JSCell.h"
-#include "MarkedAllocator.h"
#include "MarkedBlock.h"
#include "MarkedSpace.h"
#include "Operations.h"
@@ -93,12 +93,12 @@
inline bool MarkedBlock::Handle::isAllocated()
{
- return m_allocator->isAllocated(NoLockingNecessary, this);
+ return m_directory->isAllocated(NoLockingNecessary, this);
}
ALWAYS_INLINE bool MarkedBlock::Handle::isLive(HeapVersion markingVersion, HeapVersion newlyAllocatedVersion, bool isMarking, const HeapCell* cell)
{
- if (allocator()->isAllocated(NoLockingNecessary, this))
+ if (directory()->isAllocated(NoLockingNecessary, this))
return true;
// We need to do this while holding the lock because marks might be stale. In that case, newly
@@ -255,7 +255,7 @@
}
};
- m_allocator->setIsDestructible(NoLockingNecessary, this, false);
+ m_directory->setIsDestructible(NoLockingNecessary, this, false);
if (Options::useBumpAllocator()
&& emptyMode == IsEmpty
@@ -351,7 +351,7 @@
freeList->initializeList(head, secret, count * cellSize);
setIsFreeListed();
} else if (isEmpty)
- m_allocator->setIsEmpty(NoLockingNecessary, this, true);
+ m_directory->setIsEmpty(NoLockingNecessary, this, true);
if (false)
dataLog("Slowly swept block ", RawPointer(&block), " with cell size ", cellSize, " and attributes ", m_attributes, ": ", pointerDump(freeList), "\n");
}
@@ -441,7 +441,7 @@
inline bool MarkedBlock::Handle::isEmpty()
{
- return m_allocator->isEmpty(NoLockingNecessary, this);
+ return m_directory->isEmpty(NoLockingNecessary, this);
}
inline MarkedBlock::Handle::EmptyMode MarkedBlock::Handle::emptyMode()
diff --git a/Source/JavaScriptCore/heap/MarkedSpace.cpp b/Source/JavaScriptCore/heap/MarkedSpace.cpp
index 9e2f8d2..56da3be 100644
--- a/Source/JavaScriptCore/heap/MarkedSpace.cpp
+++ b/Source/JavaScriptCore/heap/MarkedSpace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2018 Apple Inc. All rights reserved.
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
*
* This library is free software; you can redistribute it and/or
@@ -21,11 +21,11 @@
#include "config.h"
#include "MarkedSpace.h"
+#include "BlockDirectoryInlines.h"
#include "FunctionCodeBlock.h"
#include "IncrementalSweeper.h"
#include "JSObject.h"
#include "JSCInlines.h"
-#include "MarkedAllocatorInlines.h"
#include "MarkedBlockInlines.h"
#include <wtf/ListDump.h>
@@ -216,9 +216,9 @@
void MarkedSpace::lastChanceToFinalize()
{
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.lastChanceToFinalize();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.lastChanceToFinalize();
return IterationStatus::Continue;
});
for (LargeAllocation* allocation : m_largeAllocations)
@@ -228,9 +228,9 @@
void MarkedSpace::sweep()
{
m_heap->sweeper().stopSweeping();
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.sweep();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.sweep();
return IterationStatus::Continue;
});
}
@@ -295,9 +295,9 @@
void MarkedSpace::stopAllocating()
{
ASSERT(!isIterating());
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.stopAllocating();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.stopAllocating();
return IterationStatus::Continue;
});
}
@@ -326,9 +326,9 @@
void MarkedSpace::resumeAllocating()
{
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.resumeAllocating();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.resumeAllocating();
return IterationStatus::Continue;
});
// Nothing to do for LargeAllocations.
@@ -337,9 +337,9 @@
bool MarkedSpace::isPagedOut(double deadline)
{
bool result = false;
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- if (allocator.isPagedOut(deadline)) {
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ if (directory.isPagedOut(deadline)) {
result = true;
return IterationStatus::Done;
}
@@ -351,7 +351,7 @@
void MarkedSpace::freeBlock(MarkedBlock::Handle* block)
{
- block->allocator()->removeBlock(block);
+ block->directory()->removeBlock(block);
m_capacity -= MarkedBlock::blockSize;
m_blocks.remove(&block->block());
delete block;
@@ -369,9 +369,9 @@
void MarkedSpace::shrink()
{
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.shrink();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.shrink();
return IterationStatus::Continue;
});
}
@@ -379,9 +379,9 @@
void MarkedSpace::beginMarking()
{
if (m_heap->collectionScope() == CollectionScope::Full) {
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.beginMarkingForFullCollection();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.beginMarkingForFullCollection();
return IterationStatus::Continue;
});
@@ -429,9 +429,9 @@
ASSERT_UNUSED(allocation, !allocation->isNewlyAllocated());
}
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.endMarking();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.endMarking();
return IterationStatus::Continue;
});
@@ -514,15 +514,15 @@
void MarkedSpace::snapshotUnswept()
{
if (m_heap->collectionScope() == CollectionScope::Eden) {
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.snapshotUnsweptForEdenCollection();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.snapshotUnsweptForEdenCollection();
return IterationStatus::Continue;
});
} else {
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.snapshotUnsweptForFullCollection();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.snapshotUnsweptForFullCollection();
return IterationStatus::Continue;
});
}
@@ -532,30 +532,30 @@
{
if (ASSERT_DISABLED)
return;
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.assertNoUnswept();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.assertNoUnswept();
return IterationStatus::Continue;
});
}
void MarkedSpace::dumpBits(PrintStream& out)
{
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- out.print("Bits for ", allocator, ":\n");
- allocator.dumpBits(out);
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ out.print("Bits for ", directory, ":\n");
+ directory.dumpBits(out);
return IterationStatus::Continue;
});
}
-void MarkedSpace::addMarkedAllocator(const AbstractLocker&, MarkedAllocator* allocator)
+void MarkedSpace::addBlockDirectory(const AbstractLocker&, BlockDirectory* directory)
{
- allocator->setNextAllocator(nullptr);
+ directory->setNextDirectory(nullptr);
WTF::storeStoreFence();
- m_allocators.append(std::mem_fn(&MarkedAllocator::setNextAllocator), allocator);
+ m_directories.append(std::mem_fn(&BlockDirectory::setNextDirectory), directory);
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/MarkedSpace.h b/Source/JavaScriptCore/heap/MarkedSpace.h
index 8eb0b32..2d5be24 100644
--- a/Source/JavaScriptCore/heap/MarkedSpace.h
+++ b/Source/JavaScriptCore/heap/MarkedSpace.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2018 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,9 +21,9 @@
#pragma once
+#include "BlockDirectory.h"
#include "IterationStatus.h"
#include "LargeAllocation.h"
-#include "MarkedAllocator.h"
#include "MarkedBlock.h"
#include "MarkedBlockSet.h"
#include <array>
@@ -157,10 +157,10 @@
LargeAllocation** largeAllocationsForThisCollectionEnd() const { return m_largeAllocationsForThisCollectionEnd; }
unsigned largeAllocationsForThisCollectionSize() const { return m_largeAllocationsForThisCollectionSize; }
- MarkedAllocator* firstAllocator() const { return m_allocators.first(); }
+ BlockDirectory* firstDirectory() const { return m_directories.first(); }
- Lock& allocatorLock() { return m_allocatorLock; }
- void addMarkedAllocator(const AbstractLocker&, MarkedAllocator*);
+ Lock& directoryLock() { return m_directoryLock; }
+ void addBlockDirectory(const AbstractLocker&, BlockDirectory*);
// When this is true it means that we have flipped but the mark bits haven't converged yet.
bool isMarking() const { return m_isMarking; }
@@ -181,7 +181,7 @@
friend class WeakSet;
friend class Subspace;
- // Use this version when calling from within the GC where we know that the allocators
+ // Use this version when calling from within the GC where we know that the directories
// have already been stopped.
template<typename Functor> void forEachLiveCell(const Functor&);
@@ -189,7 +189,7 @@
void initializeSubspace(Subspace&);
- template<typename Functor> inline void forEachAllocator(const Functor&);
+ template<typename Functor> inline void forEachDirectory(const Functor&);
void addActiveWeakSet(WeakSet*);
@@ -214,26 +214,26 @@
SentinelLinkedList<WeakSet, BasicRawSentinelNode<WeakSet>> m_activeWeakSets;
SentinelLinkedList<WeakSet, BasicRawSentinelNode<WeakSet>> m_newActiveWeakSets;
- Lock m_allocatorLock;
- SinglyLinkedListWithTail<MarkedAllocator> m_allocators;
+ Lock m_directoryLock;
+ SinglyLinkedListWithTail<BlockDirectory> m_directories;
friend class HeapVerifier;
};
template <typename Functor> inline void MarkedSpace::forEachBlock(const Functor& functor)
{
- forEachAllocator(
- [&] (MarkedAllocator& allocator) -> IterationStatus {
- allocator.forEachBlock(functor);
+ forEachDirectory(
+ [&] (BlockDirectory& directory) -> IterationStatus {
+ directory.forEachBlock(functor);
return IterationStatus::Continue;
});
}
template <typename Functor>
-void MarkedSpace::forEachAllocator(const Functor& functor)
+void MarkedSpace::forEachDirectory(const Functor& functor)
{
- for (MarkedAllocator* allocator = m_allocators.first(); allocator; allocator = allocator->nextAllocator()) {
- if (functor(*allocator) == IterationStatus::Done)
+ for (BlockDirectory* directory = m_directories.first(); directory; directory = directory->nextDirectory()) {
+ if (functor(*directory) == IterationStatus::Done)
return;
}
}
diff --git a/Source/JavaScriptCore/heap/MarkedSpaceInlines.h b/Source/JavaScriptCore/heap/MarkedSpaceInlines.h
index 4c6b119..755ab31 100644
--- a/Source/JavaScriptCore/heap/MarkedSpaceInlines.h
+++ b/Source/JavaScriptCore/heap/MarkedSpaceInlines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/Source/JavaScriptCore/heap/Subspace.cpp b/Source/JavaScriptCore/heap/Subspace.cpp
index 2d4c023..d377f9a 100644
--- a/Source/JavaScriptCore/heap/Subspace.cpp
+++ b/Source/JavaScriptCore/heap/Subspace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,9 +27,9 @@
#include "Subspace.h"
#include "AlignedMemoryAllocator.h"
+#include "BlockDirectoryInlines.h"
#include "HeapCellType.h"
#include "JSCInlines.h"
-#include "MarkedAllocatorInlines.h"
#include "MarkedBlockInlines.h"
#include "ParallelSourceAdapter.h"
#include "PreventCollectionScope.h"
@@ -48,7 +48,7 @@
m_attributes = heapCellType->attributes();
m_heapCellType = heapCellType;
m_alignedMemoryAllocator = alignedMemoryAllocator;
- m_allocatorForEmptyAllocation = m_alignedMemoryAllocator->firstAllocator();
+ m_directoryForEmptyAllocation = m_alignedMemoryAllocator->firstDirectory();
Heap& heap = *m_space.heap();
PreventCollectionScope preventCollectionScope(heap);
@@ -72,65 +72,65 @@
void Subspace::prepareForAllocation()
{
- forEachAllocator(
- [&] (MarkedAllocator& allocator) {
- allocator.prepareForAllocation();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) {
+ directory.prepareForAllocation();
});
- m_allocatorForEmptyAllocation = m_alignedMemoryAllocator->firstAllocator();
+ m_directoryForEmptyAllocation = m_alignedMemoryAllocator->firstDirectory();
}
MarkedBlock::Handle* Subspace::findEmptyBlockToSteal()
{
- for (; m_allocatorForEmptyAllocation; m_allocatorForEmptyAllocation = m_allocatorForEmptyAllocation->nextAllocatorInAlignedMemoryAllocator()) {
- if (MarkedBlock::Handle* block = m_allocatorForEmptyAllocation->findEmptyBlockToSteal())
+ for (; m_directoryForEmptyAllocation; m_directoryForEmptyAllocation = m_directoryForEmptyAllocation->nextDirectoryInAlignedMemoryAllocator()) {
+ if (MarkedBlock::Handle* block = m_directoryForEmptyAllocation->findEmptyBlockToSteal())
return block;
}
return nullptr;
}
-RefPtr<SharedTask<MarkedAllocator*()>> Subspace::parallelAllocatorSource()
+RefPtr<SharedTask<BlockDirectory*()>> Subspace::parallelDirectorySource()
{
- class Task : public SharedTask<MarkedAllocator*()> {
+ class Task : public SharedTask<BlockDirectory*()> {
public:
- Task(MarkedAllocator* allocator)
- : m_allocator(allocator)
+ Task(BlockDirectory* directory)
+ : m_directory(directory)
{
}
- MarkedAllocator* run() override
+ BlockDirectory* run() override
{
auto locker = holdLock(m_lock);
- MarkedAllocator* result = m_allocator;
+ BlockDirectory* result = m_directory;
if (result)
- m_allocator = result->nextAllocatorInSubspace();
+ m_directory = result->nextDirectoryInSubspace();
return result;
}
private:
- MarkedAllocator* m_allocator;
+ BlockDirectory* m_directory;
Lock m_lock;
};
- return adoptRef(new Task(m_firstAllocator));
+ return adoptRef(new Task(m_firstDirectory));
}
RefPtr<SharedTask<MarkedBlock::Handle*()>> Subspace::parallelNotEmptyMarkedBlockSource()
{
- return createParallelSourceAdapter<MarkedAllocator*, MarkedBlock::Handle*>(
- parallelAllocatorSource(),
- [] (MarkedAllocator* allocator) -> RefPtr<SharedTask<MarkedBlock::Handle*()>> {
- if (!allocator)
+ return createParallelSourceAdapter<BlockDirectory*, MarkedBlock::Handle*>(
+ parallelDirectorySource(),
+ [] (BlockDirectory* directory) -> RefPtr<SharedTask<MarkedBlock::Handle*()>> {
+ if (!directory)
return nullptr;
- return allocator->parallelNotEmptyBlockSource();
+ return directory->parallelNotEmptyBlockSource();
});
}
void Subspace::sweep()
{
- forEachAllocator(
- [&] (MarkedAllocator& allocator) {
- allocator.sweep();
+ forEachDirectory(
+ [&] (BlockDirectory& directory) {
+ directory.sweep();
});
}
diff --git a/Source/JavaScriptCore/heap/Subspace.h b/Source/JavaScriptCore/heap/Subspace.h
index e9e463e..17cc4fe 100644
--- a/Source/JavaScriptCore/heap/Subspace.h
+++ b/Source/JavaScriptCore/heap/Subspace.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -49,27 +49,27 @@
const char* name() const { return m_name.data(); }
MarkedSpace& space() const { return m_space; }
- const AllocatorAttributes& attributes() const { return m_attributes; }
+ const CellAttributes& attributes() const { return m_attributes; }
HeapCellType* heapCellType() const { return m_heapCellType; }
AlignedMemoryAllocator* alignedMemoryAllocator() const { return m_alignedMemoryAllocator; }
void finishSweep(MarkedBlock::Handle&, FreeList*);
void destroy(VM&, JSCell*);
- virtual MarkedAllocator* allocatorFor(size_t, AllocatorForMode) = 0;
+ virtual BlockDirectory* allocatorFor(size_t, AllocatorForMode) = 0;
virtual void* allocate(size_t, GCDeferralContext*, AllocationFailureMode) = 0;
void prepareForAllocation();
- void didCreateFirstAllocator(MarkedAllocator* allocator) { m_allocatorForEmptyAllocation = allocator; }
+ void didCreateFirstDirectory(BlockDirectory* directory) { m_directoryForEmptyAllocation = directory; }
// Finds an empty block from any Subspace that agrees to trade blocks with us.
MarkedBlock::Handle* findEmptyBlockToSteal();
template<typename Func>
- void forEachAllocator(const Func&);
+ void forEachDirectory(const Func&);
- RefPtr<SharedTask<MarkedAllocator*()>> parallelAllocatorSource();
+ RefPtr<SharedTask<BlockDirectory*()>> parallelDirectorySource();
template<typename Func>
void forEachMarkedBlock(const Func&);
@@ -106,13 +106,13 @@
MarkedSpace& m_space;
CString m_name;
- AllocatorAttributes m_attributes;
+ CellAttributes m_attributes;
HeapCellType* m_heapCellType { nullptr };
AlignedMemoryAllocator* m_alignedMemoryAllocator { nullptr };
- MarkedAllocator* m_firstAllocator { nullptr };
- MarkedAllocator* m_allocatorForEmptyAllocation { nullptr }; // Uses the MarkedSpace linked list of blocks.
+ BlockDirectory* m_firstDirectory { nullptr };
+ BlockDirectory* m_directoryForEmptyAllocation { nullptr }; // Uses the MarkedSpace linked list of blocks.
SentinelLinkedList<LargeAllocation, BasicRawSentinelNode<LargeAllocation>> m_largeAllocations;
Subspace* m_nextSubspaceInAlignedMemoryAllocator { nullptr };
};
diff --git a/Source/JavaScriptCore/heap/SubspaceInlines.h b/Source/JavaScriptCore/heap/SubspaceInlines.h
index b80a6e3..e7ed218 100644
--- a/Source/JavaScriptCore/heap/SubspaceInlines.h
+++ b/Source/JavaScriptCore/heap/SubspaceInlines.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,8 +25,8 @@
#pragma once
+#include "BlockDirectoryInlines.h"
#include "JSCell.h"
-#include "MarkedAllocatorInlines.h"
#include "MarkedBlock.h"
#include "MarkedSpace.h"
#include "Subspace.h"
@@ -34,27 +34,27 @@
namespace JSC {
template<typename Func>
-void Subspace::forEachAllocator(const Func& func)
+void Subspace::forEachDirectory(const Func& func)
{
- for (MarkedAllocator* allocator = m_firstAllocator; allocator; allocator = allocator->nextAllocatorInSubspace())
- func(*allocator);
+ for (BlockDirectory* directory = m_firstDirectory; directory; directory = directory->nextDirectoryInSubspace())
+ func(*directory);
}
template<typename Func>
void Subspace::forEachMarkedBlock(const Func& func)
{
- forEachAllocator(
- [&] (MarkedAllocator& allocator) {
- allocator.forEachBlock(func);
+ forEachDirectory(
+ [&] (BlockDirectory& directory) {
+ directory.forEachBlock(func);
});
}
template<typename Func>
void Subspace::forEachNotEmptyMarkedBlock(const Func& func)
{
- forEachAllocator(
- [&] (MarkedAllocator& allocator) {
- allocator.forEachNotEmptyBlock(func);
+ forEachDirectory(
+ [&] (BlockDirectory& directory) {
+ directory.forEachNotEmptyBlock(func);
});
}
diff --git a/Source/JavaScriptCore/jit/AssemblyHelpers.h b/Source/JavaScriptCore/jit/AssemblyHelpers.h
index 7308d9e..ee5732a 100644
--- a/Source/JavaScriptCore/jit/AssemblyHelpers.h
+++ b/Source/JavaScriptCore/jit/AssemblyHelpers.h
@@ -1492,7 +1492,7 @@
// Call this if you know that the value held in allocatorGPR is non-null. This DOES NOT mean
// that allocator is non-null; allocator can be null as a signal that we don't know what the
// value of allocatorGPR is.
- void emitAllocateWithNonNullAllocator(GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, GPRReg scratchGPR, JumpList& slowPath)
+ void emitAllocateWithNonNullAllocator(GPRReg resultGPR, BlockDirectory* allocator, GPRReg allocatorGPR, GPRReg scratchGPR, JumpList& slowPath)
{
// NOTE: This is carefully written so that we can call it while we disallow scratch
// register usage.
@@ -1505,22 +1505,22 @@
Jump popPath;
Jump done;
- load32(Address(allocatorGPR, MarkedAllocator::offsetOfFreeList() + FreeList::offsetOfRemaining()), resultGPR);
+ load32(Address(allocatorGPR, BlockDirectory::offsetOfFreeList() + FreeList::offsetOfRemaining()), resultGPR);
popPath = branchTest32(Zero, resultGPR);
if (allocator)
add32(TrustedImm32(-allocator->cellSize()), resultGPR, scratchGPR);
else {
if (isX86()) {
move(resultGPR, scratchGPR);
- sub32(Address(allocatorGPR, MarkedAllocator::offsetOfCellSize()), scratchGPR);
+ sub32(Address(allocatorGPR, BlockDirectory::offsetOfCellSize()), scratchGPR);
} else {
- load32(Address(allocatorGPR, MarkedAllocator::offsetOfCellSize()), scratchGPR);
+ load32(Address(allocatorGPR, BlockDirectory::offsetOfCellSize()), scratchGPR);
sub32(resultGPR, scratchGPR, scratchGPR);
}
}
negPtr(resultGPR);
- store32(scratchGPR, Address(allocatorGPR, MarkedAllocator::offsetOfFreeList() + FreeList::offsetOfRemaining()));
- Address payloadEndAddr = Address(allocatorGPR, MarkedAllocator::offsetOfFreeList() + FreeList::offsetOfPayloadEnd());
+ store32(scratchGPR, Address(allocatorGPR, BlockDirectory::offsetOfFreeList() + FreeList::offsetOfRemaining()));
+ Address payloadEndAddr = Address(allocatorGPR, BlockDirectory::offsetOfFreeList() + FreeList::offsetOfPayloadEnd());
if (isX86())
addPtr(payloadEndAddr, resultGPR);
else {
@@ -1532,11 +1532,11 @@
popPath.link(this);
- loadPtr(Address(allocatorGPR, MarkedAllocator::offsetOfFreeList() + FreeList::offsetOfScrambledHead()), resultGPR);
+ loadPtr(Address(allocatorGPR, BlockDirectory::offsetOfFreeList() + FreeList::offsetOfScrambledHead()), resultGPR);
if (isX86())
- xorPtr(Address(allocatorGPR, MarkedAllocator::offsetOfFreeList() + FreeList::offsetOfSecret()), resultGPR);
+ xorPtr(Address(allocatorGPR, BlockDirectory::offsetOfFreeList() + FreeList::offsetOfSecret()), resultGPR);
else {
- loadPtr(Address(allocatorGPR, MarkedAllocator::offsetOfFreeList() + FreeList::offsetOfSecret()), scratchGPR);
+ loadPtr(Address(allocatorGPR, BlockDirectory::offsetOfFreeList() + FreeList::offsetOfSecret()), scratchGPR);
xorPtr(scratchGPR, resultGPR);
}
slowPath.append(branchTestPtr(Zero, resultGPR));
@@ -1544,12 +1544,12 @@
// The object is half-allocated: we have what we know is a fresh object, but
// it's still on the GC's free list.
loadPtr(Address(resultGPR), scratchGPR);
- storePtr(scratchGPR, Address(allocatorGPR, MarkedAllocator::offsetOfFreeList() + FreeList::offsetOfScrambledHead()));
+ storePtr(scratchGPR, Address(allocatorGPR, BlockDirectory::offsetOfFreeList() + FreeList::offsetOfScrambledHead()));
done.link(this);
}
- void emitAllocate(GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, GPRReg scratchGPR, JumpList& slowPath)
+ void emitAllocate(GPRReg resultGPR, BlockDirectory* allocator, GPRReg allocatorGPR, GPRReg scratchGPR, JumpList& slowPath)
{
if (!allocator)
slowPath.append(branchTestPtr(Zero, allocatorGPR));
@@ -1557,14 +1557,14 @@
}
template<typename StructureType>
- void emitAllocateJSCell(GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, StructureType structure, GPRReg scratchGPR, JumpList& slowPath)
+ void emitAllocateJSCell(GPRReg resultGPR, BlockDirectory* allocator, GPRReg allocatorGPR, StructureType structure, GPRReg scratchGPR, JumpList& slowPath)
{
emitAllocate(resultGPR, allocator, allocatorGPR, scratchGPR, slowPath);
emitStoreStructureWithTypeInfo(structure, resultGPR, scratchGPR);
}
template<typename StructureType, typename StorageType, typename MaskType>
- void emitAllocateJSObject(GPRReg resultGPR, MarkedAllocator* allocator, GPRReg allocatorGPR, StructureType structure, StorageType storage, MaskType mask, GPRReg scratchGPR, JumpList& slowPath)
+ void emitAllocateJSObject(GPRReg resultGPR, BlockDirectory* allocator, GPRReg allocatorGPR, StructureType structure, StorageType storage, MaskType mask, GPRReg scratchGPR, JumpList& slowPath)
{
emitAllocateJSCell(resultGPR, allocator, allocatorGPR, structure, scratchGPR, slowPath);
storePtr(storage, Address(resultGPR, JSObject::butterflyOffset()));
@@ -1576,7 +1576,7 @@
VM& vm, GPRReg resultGPR, StructureType structure, StorageType storage, MaskType mask, GPRReg scratchGPR1,
GPRReg scratchGPR2, JumpList& slowPath, size_t size)
{
- MarkedAllocator* allocator = subspaceFor<ClassType>(vm)->allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = subspaceFor<ClassType>(vm)->allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists);
if (!allocator) {
slowPath.append(jump());
return;
diff --git a/Source/JavaScriptCore/jit/JIT.h b/Source/JavaScriptCore/jit/JIT.h
index aae254f..b61874e 100644
--- a/Source/JavaScriptCore/jit/JIT.h
+++ b/Source/JavaScriptCore/jit/JIT.h
@@ -57,7 +57,7 @@
class JIT;
class Identifier;
class Interpreter;
- class MarkedAllocator;
+ class BlockDirectory;
class Register;
class StructureChain;
class StructureStubInfo;
diff --git a/Source/JavaScriptCore/jit/JITOpcodes.cpp b/Source/JavaScriptCore/jit/JITOpcodes.cpp
index 43e3b1e..a2b6f6d 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes.cpp
@@ -81,7 +81,7 @@
{
Structure* structure = currentInstruction[3].u.objectAllocationProfile->structure();
size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
- MarkedAllocator* allocator = subspaceFor<JSFinalObject>(*m_vm)->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = subspaceFor<JSFinalObject>(*m_vm)->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
RegisterID resultReg = regT0;
RegisterID allocatorReg = regT1;
diff --git a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
index c90b5fa..1438e10 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
@@ -79,7 +79,7 @@
{
Structure* structure = currentInstruction[3].u.objectAllocationProfile->structure();
size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
- MarkedAllocator* allocator = subspaceFor<JSFinalObject>(*m_vm)->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
+ BlockDirectory* allocator = subspaceFor<JSFinalObject>(*m_vm)->allocatorForNonVirtual(allocationSize, AllocatorForMode::AllocatorIfExists);
RegisterID resultReg = returnValueGPR;
RegisterID allocatorReg = regT1;
diff --git a/Source/JavaScriptCore/runtime/JSDestructibleObjectHeapCellType.cpp b/Source/JavaScriptCore/runtime/JSDestructibleObjectHeapCellType.cpp
index 34e6c88..d0407ac 100644
--- a/Source/JavaScriptCore/runtime/JSDestructibleObjectHeapCellType.cpp
+++ b/Source/JavaScriptCore/runtime/JSDestructibleObjectHeapCellType.cpp
@@ -39,7 +39,7 @@
};
JSDestructibleObjectHeapCellType::JSDestructibleObjectHeapCellType()
- : HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
+ : HeapCellType(CellAttributes(NeedsDestruction, HeapCell::JSCell))
{
}
diff --git a/Source/JavaScriptCore/runtime/JSSegmentedVariableObjectHeapCellType.cpp b/Source/JavaScriptCore/runtime/JSSegmentedVariableObjectHeapCellType.cpp
index 1828d95..686244f 100644
--- a/Source/JavaScriptCore/runtime/JSSegmentedVariableObjectHeapCellType.cpp
+++ b/Source/JavaScriptCore/runtime/JSSegmentedVariableObjectHeapCellType.cpp
@@ -39,7 +39,7 @@
};
JSSegmentedVariableObjectHeapCellType::JSSegmentedVariableObjectHeapCellType()
- : HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
+ : HeapCellType(CellAttributes(NeedsDestruction, HeapCell::JSCell))
{
}
diff --git a/Source/JavaScriptCore/runtime/JSStringHeapCellType.cpp b/Source/JavaScriptCore/runtime/JSStringHeapCellType.cpp
index c4bc439..33420db 100644
--- a/Source/JavaScriptCore/runtime/JSStringHeapCellType.cpp
+++ b/Source/JavaScriptCore/runtime/JSStringHeapCellType.cpp
@@ -39,7 +39,7 @@
};
JSStringHeapCellType::JSStringHeapCellType()
- : HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
+ : HeapCellType(CellAttributes(NeedsDestruction, HeapCell::JSCell))
{
}
diff --git a/Source/JavaScriptCore/runtime/VM.cpp b/Source/JavaScriptCore/runtime/VM.cpp
index 45d083c..d131dc6 100644
--- a/Source/JavaScriptCore/runtime/VM.cpp
+++ b/Source/JavaScriptCore/runtime/VM.cpp
@@ -228,9 +228,9 @@
, fastMallocAllocator(std::make_unique<FastMallocAlignedMemoryAllocator>())
, primitiveGigacageAllocator(std::make_unique<GigacageAlignedMemoryAllocator>(Gigacage::Primitive))
, jsValueGigacageAllocator(std::make_unique<GigacageAlignedMemoryAllocator>(Gigacage::JSValue))
- , auxiliaryHeapCellType(std::make_unique<HeapCellType>(AllocatorAttributes(DoesNotNeedDestruction, HeapCell::Auxiliary)))
- , cellHeapCellType(std::make_unique<HeapCellType>(AllocatorAttributes(DoesNotNeedDestruction, HeapCell::JSCell)))
- , destructibleCellHeapCellType(std::make_unique<HeapCellType>(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell)))
+ , auxiliaryHeapCellType(std::make_unique<HeapCellType>(CellAttributes(DoesNotNeedDestruction, HeapCell::Auxiliary)))
+ , cellHeapCellType(std::make_unique<HeapCellType>(CellAttributes(DoesNotNeedDestruction, HeapCell::JSCell)))
+ , destructibleCellHeapCellType(std::make_unique<HeapCellType>(CellAttributes(NeedsDestruction, HeapCell::JSCell)))
, stringHeapCellType(std::make_unique<JSStringHeapCellType>())
, destructibleObjectHeapCellType(std::make_unique<JSDestructibleObjectHeapCellType>())
, segmentedVariableObjectHeapCellType(std::make_unique<JSSegmentedVariableObjectHeapCellType>())
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp b/Source/JavaScriptCore/wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp
index 54ce60f..cf8198d 100644
--- a/Source/JavaScriptCore/wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp
+++ b/Source/JavaScriptCore/wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp
@@ -43,7 +43,7 @@
};
JSWebAssemblyCodeBlockHeapCellType::JSWebAssemblyCodeBlockHeapCellType()
- : HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
+ : HeapCellType(CellAttributes(NeedsDestruction, HeapCell::JSCell))
{
}
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index d305d57..d6b7c60 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2018-01-11 Filip Pizlo <fpizlo@apple.com>
+
+ Rename MarkedAllocator to BlockDirectory and AllocatorAttributes to CellAttributes
+ https://bugs.webkit.org/show_bug.cgi?id=181543
+
+ Rubber stamped by Michael Saboff.
+
+ No new tests because I'm just renaming things.
+
+ * ForwardingHeaders/heap/BlockDirectoryInlines.h: Copied from Source/WebCore/ForwardingHeaders/heap/MarkedAllocatorInlines.h.
+ * ForwardingHeaders/heap/MarkedAllocatorInlines.h: Removed.
+ * bindings/js/DOMGCOutputConstraint.cpp:
+
2018-01-11 Alex Christensen <achristensen@webkit.org>
REGRESSION(r225003): Loading hangs in environments where dispatch_async does not work
diff --git a/Source/WebCore/ForwardingHeaders/heap/BlockDirectoryInlines.h b/Source/WebCore/ForwardingHeaders/heap/BlockDirectoryInlines.h
new file mode 100644
index 0000000..852980f
--- /dev/null
+++ b/Source/WebCore/ForwardingHeaders/heap/BlockDirectoryInlines.h
@@ -0,0 +1,2 @@
+#pragma once
+#include <JavaScriptCore/BlockDirectoryInlines.h>
diff --git a/Source/WebCore/ForwardingHeaders/heap/MarkedAllocatorInlines.h b/Source/WebCore/ForwardingHeaders/heap/MarkedAllocatorInlines.h
deleted file mode 100644
index 02abc96..0000000
--- a/Source/WebCore/ForwardingHeaders/heap/MarkedAllocatorInlines.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#pragma once
-#include <JavaScriptCore/MarkedAllocatorInlines.h>
diff --git a/Source/WebCore/bindings/js/DOMGCOutputConstraint.cpp b/Source/WebCore/bindings/js/DOMGCOutputConstraint.cpp
index 90aa336..4d08d05 100644
--- a/Source/WebCore/bindings/js/DOMGCOutputConstraint.cpp
+++ b/Source/WebCore/bindings/js/DOMGCOutputConstraint.cpp
@@ -27,8 +27,8 @@
#include "DOMGCOutputConstraint.h"
#include "WebCoreJSClientData.h"
+#include <heap/BlockDirectoryInlines.h>
#include <heap/HeapInlines.h>
-#include <heap/MarkedAllocatorInlines.h>
#include <heap/MarkedBlockInlines.h>
#include <heap/SubspaceInlines.h>
#include <runtime/VM.h>