Changeset 252302 in webkit
- Timestamp:
- Nov 8, 2019 7:45:18 PM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 34 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r252032 r252302 617 617 heap/IsoSubspaceInlines.h 618 618 heap/IsoSubspacePerVM.h 619 heap/LargeAllocation.h620 619 heap/LocalAllocator.h 621 620 heap/LocalAllocatorInlines.h … … 630 629 heap/MutatorState.h 631 630 heap/PackedCellPtr.h 631 heap/PreciseAllocation.h 632 632 heap/RegisterState.h 633 633 heap/RunningScope.h -
trunk/Source/JavaScriptCore/ChangeLog
r252298 r252302 1 2019-11-08 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Rename LargeAllocation to PreciseAllocation 4 https://bugs.webkit.org/show_bug.cgi?id=204040 5 6 Reviewed by Keith Miller. 7 8 After r252298, LargeAllocation is also used for small allocations. 9 This patch renames from LargeAllocation to PreciseAllocation since it reflects the behavior. 10 11 * CMakeLists.txt: 12 * JavaScriptCore.xcodeproj/project.pbxproj: 13 * Sources.txt: 14 * heap/CellContainer.cpp: 15 (JSC::CellContainer::isNewlyAllocated const): 16 * heap/CellContainer.h: 17 (JSC::CellContainer::CellContainer): 18 (JSC::CellContainer::isMarkedBlock const): 19 (JSC::CellContainer::isPreciseAllocation const): 20 (JSC::CellContainer::preciseAllocation const): 21 (JSC::CellContainer::isLargeAllocation const): Deleted. 22 (JSC::CellContainer::largeAllocation const): Deleted. 23 * heap/CellContainerInlines.h: 24 (JSC::CellContainer::vm const): 25 (JSC::CellContainer::isMarked const): 26 (JSC::CellContainer::noteMarked): 27 (JSC::CellContainer::assertValidCell const): 28 (JSC::CellContainer::cellSize const): 29 (JSC::CellContainer::weakSet const): 30 (JSC::CellContainer::aboutToMark): 31 (JSC::CellContainer::areMarksStale const): 32 * heap/CompleteSubspace.cpp: 33 (JSC::CompleteSubspace::tryAllocateSlow): 34 (JSC::CompleteSubspace::reallocatePreciseAllocationNonVirtual): 35 (JSC::CompleteSubspace::reallocateLargeAllocationNonVirtual): Deleted. 36 * heap/CompleteSubspace.h: 37 * heap/Heap.cpp: 38 (JSC::Heap::sweepInFinalize): 39 * heap/HeapCell.cpp: 40 (JSC::HeapCell::isLive): 41 * heap/HeapCell.h: 42 * heap/HeapCellInlines.h: 43 (JSC::HeapCell::isPreciseAllocation const): 44 (JSC::HeapCell::cellContainer const): 45 (JSC::HeapCell::preciseAllocation const): 46 (JSC::HeapCell::vm const): 47 (JSC::HeapCell::cellSize const): 48 (JSC::HeapCell::cellAttributes const): 49 (JSC::HeapCell::subspace const): 50 (JSC::HeapCell::isLargeAllocation const): Deleted. 51 (JSC::HeapCell::largeAllocation const): Deleted. 52 * heap/HeapInlines.h: 53 (JSC::Heap::isMarked): 54 (JSC::Heap::testAndSetMarked): 55 * heap/HeapUtil.h: 56 (JSC::HeapUtil::findGCObjectPointersForMarking): 57 (JSC::HeapUtil::isPointerGCObjectJSCell): 58 (JSC::HeapUtil::isValueGCObject): 59 * heap/IsoAlignedMemoryAllocator.cpp: 60 (JSC::IsoAlignedMemoryAllocator::tryReallocateMemory): 61 * heap/IsoCellSetInlines.h: 62 (JSC::IsoCellSet::add): 63 (JSC::IsoCellSet::remove): 64 (JSC::IsoCellSet::contains const): 65 (JSC::IsoCellSet::forEachMarkedCell): 66 (JSC::IsoCellSet::forEachMarkedCellInParallel): 67 (JSC::IsoCellSet::forEachLiveCell): 68 * heap/IsoSubspace.cpp: 69 (JSC::IsoSubspace::tryAllocateFromLowerTier): 70 (JSC::IsoSubspace::sweepLowerTierCell): 71 (JSC::IsoSubspace::destroyLowerTierFreeList): 72 * heap/IsoSubspace.h: 73 * heap/MarkedSpace.cpp: 74 (JSC::MarkedSpace::freeMemory): 75 (JSC::MarkedSpace::lastChanceToFinalize): 76 (JSC::MarkedSpace::sweepPreciseAllocations): 77 (JSC::MarkedSpace::prepareForAllocation): 78 (JSC::MarkedSpace::enablePreciseAllocationTracking): 79 (JSC::MarkedSpace::prepareForConservativeScan): 80 (JSC::MarkedSpace::prepareForMarking): 81 (JSC::MarkedSpace::resumeAllocating): 82 (JSC::MarkedSpace::isPagedOut): 83 (JSC::MarkedSpace::beginMarking): 84 (JSC::MarkedSpace::endMarking): 85 (JSC::MarkedSpace::objectCount): 86 (JSC::MarkedSpace::size): 87 (JSC::MarkedSpace::sweepLargeAllocations): Deleted. 88 (JSC::MarkedSpace::enableLargeAllocationTracking): Deleted. 89 * heap/MarkedSpace.h: 90 (JSC::MarkedSpace:: const): 91 (JSC::MarkedSpace::preciseAllocationsNurseryOffset const): 92 (JSC::MarkedSpace::preciseAllocationsOffsetForThisCollection const): 93 (JSC::MarkedSpace::preciseAllocationsForThisCollectionBegin const): 94 (JSC::MarkedSpace::preciseAllocationsForThisCollectionEnd const): 95 (JSC::MarkedSpace::preciseAllocationsForThisCollectionSize const): 96 (JSC::MarkedSpace::largeAllocationsNurseryOffset const): Deleted. 97 (JSC::MarkedSpace::largeAllocationsOffsetForThisCollection const): Deleted. 98 (JSC::MarkedSpace::largeAllocationsForThisCollectionBegin const): Deleted. 99 (JSC::MarkedSpace::largeAllocationsForThisCollectionEnd const): Deleted. 100 (JSC::MarkedSpace::largeAllocationsForThisCollectionSize const): Deleted. 101 * heap/MarkedSpaceInlines.h: 102 (JSC::MarkedSpace::forEachLiveCell): 103 (JSC::MarkedSpace::forEachDeadCell): 104 * heap/PreciseAllocation.cpp: Renamed from Source/JavaScriptCore/heap/LargeAllocation.cpp. 105 (JSC::isAlignedForPreciseAllocation): 106 (JSC::PreciseAllocation::tryCreate): 107 (JSC::PreciseAllocation::tryReallocate): 108 (JSC::PreciseAllocation::createForLowerTier): 109 (JSC::PreciseAllocation::reuseForLowerTier): 110 (JSC::PreciseAllocation::PreciseAllocation): 111 (JSC::PreciseAllocation::~PreciseAllocation): 112 (JSC::PreciseAllocation::lastChanceToFinalize): 113 (JSC::PreciseAllocation::shrink): 114 (JSC::PreciseAllocation::visitWeakSet): 115 (JSC::PreciseAllocation::reapWeakSet): 116 (JSC::PreciseAllocation::flip): 117 (JSC::PreciseAllocation::isEmpty): 118 (JSC::PreciseAllocation::sweep): 119 (JSC::PreciseAllocation::destroy): 120 (JSC::PreciseAllocation::dump const): 121 (JSC::PreciseAllocation::assertValidCell const): 122 * heap/PreciseAllocation.h: Renamed from Source/JavaScriptCore/heap/LargeAllocation.h. 123 (JSC::PreciseAllocation::fromCell): 124 (JSC::PreciseAllocation::isPreciseAllocation): 125 (JSC::PreciseAllocation::headerSize): 126 (JSC::PreciseAllocation::basePointer const): 127 * heap/SlotVisitor.cpp: 128 (JSC::SlotVisitor::appendHiddenSlowImpl): 129 (JSC::SlotVisitor::appendToMarkStack): 130 * heap/SlotVisitorInlines.h: 131 (JSC::SlotVisitor::appendUnbarriered): 132 (JSC::SlotVisitor::appendHiddenUnbarriered): 133 * heap/Subspace.h: 134 * heap/SubspaceInlines.h: 135 (JSC::Subspace::forEachPreciseAllocation): 136 (JSC::Subspace::forEachMarkedCell): 137 (JSC::Subspace::forEachMarkedCellInParallel): 138 (JSC::Subspace::forEachLiveCell): 139 (JSC::Subspace::forEachLargeAllocation): Deleted. 140 * heap/WeakBlock.cpp: 141 (JSC::WeakBlock::visit): 142 * heap/WeakSet.cpp: 143 (JSC::WeakSet::sweep): 144 * llint/LowLevelInterpreter.asm: 145 * runtime/ButterflyInlines.h: 146 (JSC::Butterfly::reallocArrayRightIfPossible): 147 * runtime/OptionsList.h: 148 * runtime/SamplingProfiler.cpp: 149 (JSC::SamplingProfiler::SamplingProfiler): 150 * tools/VMInspector.cpp: 151 (JSC::VMInspector::isInHeap): 152 * tools/VMInspectorInlines.h: 153 (JSC::VMInspector::verifyCell): 154 1 155 2019-11-08 Yusuke Suzuki <ysuzuki@apple.com> 2 156 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r252032 r252302 135 135 0F070A481D543A90006E7232 /* CellContainerInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F070A431D543A89006E7232 /* CellContainerInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 136 136 0F070A491D543A93006E7232 /* HeapCellInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F070A441D543A89006E7232 /* HeapCellInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 137 0F070A4B1D543A98006E7232 /* LargeAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F070A461D543A89006E7232 /* LargeAllocation.h */; settings = {ATTRIBUTES = (Private, ); }; };137 0F070A4B1D543A98006E7232 /* PreciseAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F070A461D543A89006E7232 /* PreciseAllocation.h */; settings = {ATTRIBUTES = (Private, ); }; }; 138 138 0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0776BD14FF002800102332 /* JITCompilationEffort.h */; settings = {ATTRIBUTES = (Private, ); }; }; 139 139 0F0B286B1EB8E6CF000EB5D2 /* JSWeakPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B286A1EB8E6CD000EB5D2 /* JSWeakPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 2222 2222 0F070A431D543A89006E7232 /* CellContainerInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CellContainerInlines.h; sourceTree = "<group>"; }; 2223 2223 0F070A441D543A89006E7232 /* HeapCellInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapCellInlines.h; sourceTree = "<group>"; }; 2224 0F070A451D543A89006E7232 /* LargeAllocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LargeAllocation.cpp; sourceTree = "<group>"; };2225 0F070A461D543A89006E7232 /* LargeAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LargeAllocation.h; sourceTree = "<group>"; };2224 0F070A451D543A89006E7232 /* PreciseAllocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreciseAllocation.cpp; sourceTree = "<group>"; }; 2225 0F070A461D543A89006E7232 /* PreciseAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreciseAllocation.h; sourceTree = "<group>"; }; 2226 2226 0F0776BD14FF002800102332 /* JITCompilationEffort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITCompilationEffort.h; sourceTree = "<group>"; }; 2227 2227 0F0B28671EB8E6CD000EB5D2 /* JSMarkingConstraintPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMarkingConstraintPrivate.cpp; sourceTree = "<group>"; }; … … 6202 6202 0F766D2915A8CC34008F363E /* JITStubRoutineSet.cpp */, 6203 6203 0F766D2A15A8CC34008F363E /* JITStubRoutineSet.h */, 6204 0F070A451D543A89006E7232 /* LargeAllocation.cpp */,6205 0F070A461D543A89006E7232 /* LargeAllocation.h */,6206 6204 0F75A059200D25F00038E2CF /* LocalAllocator.cpp */, 6207 6205 0F75A057200D25F00038E2CF /* LocalAllocator.h */, … … 6233 6231 E356987122841183008CDCCB /* PackedCellPtr.h */, 6234 6232 0F9DAA081FD1C3C80079C5B2 /* ParallelSourceAdapter.h */, 6233 0F070A451D543A89006E7232 /* PreciseAllocation.cpp */, 6234 0F070A461D543A89006E7232 /* PreciseAllocation.h */, 6235 6235 0FBB73B61DEF3AAC002C009E /* PreventCollectionScope.h */, 6236 6236 0FD0E5EF1E46BF230006AB08 /* RegisterState.h */, … … 8931 8931 3395C70722555F6D00BDBFAD /* B3EliminateDeadCode.h in Headers */, 8932 8932 0F5BF1711F23A5A10029D91D /* B3EnsureLoopPreHeaders.h in Headers */, 8933 522927D5235FD0B9005CB169 /* GCMemoryOperations.h in Headers */,8934 8933 5318045C22EAAC4B004A7342 /* B3ExtractValue.h in Headers */, 8935 8934 0F6971EA1D92F42400BA02A5 /* B3FenceValue.h in Headers */, … … 9453 9452 0F2B66AF17B6B54500A7AE3F /* GCIncomingRefCountedSetInlines.h in Headers */, 9454 9453 2AABCDE718EF294200002096 /* GCLogging.h in Headers */, 9454 522927D5235FD0B9005CB169 /* GCMemoryOperations.h in Headers */, 9455 9455 0F9715311EB28BEE00A1645D /* GCRequest.h in Headers */, 9456 9456 A54E8EB018BFFBBB00556D28 /* GCSegmentedArray.h in Headers */, … … 9837 9837 969A072A0ED1CE6900F1F681 /* Label.h in Headers */, 9838 9838 960097A60EBABB58007A7297 /* LabelScope.h in Headers */, 9839 0F070A4B1D543A98006E7232 /* LargeAllocation.h in Headers */,9840 9839 DCF3D56A1CD29470003D5C65 /* LazyClassStructure.h in Headers */, 9841 9840 DCF3D56B1CD29472003D5C65 /* LazyClassStructureInlines.h in Headers */, … … 9965 9964 0FE834181A6EF97B00D04847 /* PolymorphicCallStubRoutine.h in Headers */, 9966 9965 521131F71F82BF14007CCEEE /* PolyProtoAccessChain.h in Headers */, 9966 0F070A4B1D543A98006E7232 /* PreciseAllocation.h in Headers */, 9967 9967 0F98206116BFE38300240D02 /* PreciseJumpTargets.h in Headers */, 9968 9968 E3A421431D6F58930007C617 /* PreciseJumpTargetsInlines.h in Headers */, -
trunk/Source/JavaScriptCore/Sources.txt
r252032 r252302 525 525 heap/IsoSubspacePerVM.cpp 526 526 heap/JITStubRoutineSet.cpp 527 heap/ LargeAllocation.cpp527 heap/PreciseAllocation.cpp 528 528 heap/LocalAllocator.cpp 529 529 heap/MachineStackMarker.cpp -
trunk/Source/JavaScriptCore/heap/CellContainer.cpp
r227718 r252302 33 33 bool CellContainer::isNewlyAllocated(HeapCell* cell) const 34 34 { 35 if (is LargeAllocation())36 return largeAllocation().isNewlyAllocated();35 if (isPreciseAllocation()) 36 return preciseAllocation().isNewlyAllocated(); 37 37 MarkedBlock& block = markedBlock(); 38 38 return !block.isNewlyAllocatedStale() -
trunk/Source/JavaScriptCore/heap/CellContainer.h
r250005 r252302 32 32 class Heap; 33 33 class HeapCell; 34 class LargeAllocation;34 class PreciseAllocation; 35 35 class MarkedBlock; 36 36 class WeakSet; … … 39 39 typedef uint32_t HeapVersion; 40 40 41 // This is how we abstract over either MarkedBlock& or LargeAllocation&. Put things in here as you41 // This is how we abstract over either MarkedBlock& or PreciseAllocation&. Put things in here as you 42 42 // find need for them. 43 43 … … 54 54 } 55 55 56 CellContainer( LargeAllocation& largeAllocation)57 : m_encodedPointer(bitwise_cast<uintptr_t>(& largeAllocation) | isLargeAllocationBit)56 CellContainer(PreciseAllocation& preciseAllocation) 57 : m_encodedPointer(bitwise_cast<uintptr_t>(&preciseAllocation) | isPreciseAllocationBit) 58 58 { 59 59 } … … 64 64 explicit operator bool() const { return !!m_encodedPointer; } 65 65 66 bool isMarkedBlock() const { return m_encodedPointer && !(m_encodedPointer & is LargeAllocationBit); }67 bool is LargeAllocation() const { return m_encodedPointer & isLargeAllocationBit; }66 bool isMarkedBlock() const { return m_encodedPointer && !(m_encodedPointer & isPreciseAllocationBit); } 67 bool isPreciseAllocation() const { return m_encodedPointer & isPreciseAllocationBit; } 68 68 69 69 MarkedBlock& markedBlock() const … … 73 73 } 74 74 75 LargeAllocation& largeAllocation() const75 PreciseAllocation& preciseAllocation() const 76 76 { 77 ASSERT(is LargeAllocation());78 return *bitwise_cast< LargeAllocation*>(m_encodedPointer - isLargeAllocationBit);77 ASSERT(isPreciseAllocation()); 78 return *bitwise_cast<PreciseAllocation*>(m_encodedPointer - isPreciseAllocationBit); 79 79 } 80 80 … … 95 95 96 96 private: 97 static constexpr uintptr_t is LargeAllocationBit = 1;97 static constexpr uintptr_t isPreciseAllocationBit = 1; 98 98 uintptr_t m_encodedPointer; 99 99 }; -
trunk/Source/JavaScriptCore/heap/CellContainerInlines.h
r249175 r252302 28 28 #include "CellContainer.h" 29 29 #include "JSCast.h" 30 #include "LargeAllocation.h"31 30 #include "MarkedBlock.h" 31 #include "PreciseAllocation.h" 32 32 #include "VM.h" 33 33 … … 36 36 inline VM& CellContainer::vm() const 37 37 { 38 if (is LargeAllocation())39 return largeAllocation().vm();38 if (isPreciseAllocation()) 39 return preciseAllocation().vm(); 40 40 return markedBlock().vm(); 41 41 } … … 48 48 inline bool CellContainer::isMarked(HeapCell* cell) const 49 49 { 50 if (is LargeAllocation())51 return largeAllocation().isMarked();50 if (isPreciseAllocation()) 51 return preciseAllocation().isMarked(); 52 52 return markedBlock().isMarked(cell); 53 53 } … … 55 55 inline bool CellContainer::isMarked(HeapVersion markingVersion, HeapCell* cell) const 56 56 { 57 if (is LargeAllocation())58 return largeAllocation().isMarked();57 if (isPreciseAllocation()) 58 return preciseAllocation().isMarked(); 59 59 return markedBlock().isMarked(markingVersion, cell); 60 60 } … … 62 62 inline void CellContainer::noteMarked() 63 63 { 64 if (!is LargeAllocation())64 if (!isPreciseAllocation()) 65 65 markedBlock().noteMarked(); 66 66 } … … 68 68 inline void CellContainer::assertValidCell(VM& vm, HeapCell* cell) const 69 69 { 70 if (is LargeAllocation())71 largeAllocation().assertValidCell(vm, cell);70 if (isPreciseAllocation()) 71 preciseAllocation().assertValidCell(vm, cell); 72 72 else 73 73 markedBlock().assertValidCell(vm, cell); … … 76 76 inline size_t CellContainer::cellSize() const 77 77 { 78 if (is LargeAllocation())79 return largeAllocation().cellSize();78 if (isPreciseAllocation()) 79 return preciseAllocation().cellSize(); 80 80 return markedBlock().cellSize(); 81 81 } … … 83 83 inline WeakSet& CellContainer::weakSet() const 84 84 { 85 if (is LargeAllocation())86 return largeAllocation().weakSet();85 if (isPreciseAllocation()) 86 return preciseAllocation().weakSet(); 87 87 return markedBlock().weakSet(); 88 88 } … … 90 90 inline void CellContainer::aboutToMark(HeapVersion markingVersion) 91 91 { 92 if (!is LargeAllocation())92 if (!isPreciseAllocation()) 93 93 markedBlock().aboutToMark(markingVersion); 94 94 } … … 96 96 inline bool CellContainer::areMarksStale() const 97 97 { 98 if (is LargeAllocation())98 if (isPreciseAllocation()) 99 99 return false; 100 100 return markedBlock().areMarksStale(); -
trunk/Source/JavaScriptCore/heap/CompleteSubspace.cpp
r252298 r252302 130 130 return allocator.allocate(deferralContext, AllocationFailureMode::ReturnNull); 131 131 132 if (size <= Options:: largeAllocationCutoff()132 if (size <= Options::preciseAllocationCutoff() 133 133 && size <= MarkedSpace::largeCutoff) { 134 134 dataLog("FATAL: attampting to allocate small object using large allocation.\n"); … … 140 140 141 141 size = WTF::roundUpToMultipleOf<MarkedSpace::sizeStep>(size); 142 LargeAllocation* allocation = LargeAllocation::tryCreate(vm.heap, size, this, m_space.m_largeAllocations.size());142 PreciseAllocation* allocation = PreciseAllocation::tryCreate(vm.heap, size, this, m_space.m_preciseAllocations.size()); 143 143 if (!allocation) 144 144 return nullptr; 145 145 146 m_space.m_ largeAllocations.append(allocation);147 if (auto* set = m_space. largeAllocationSet())146 m_space.m_preciseAllocations.append(allocation); 147 if (auto* set = m_space.preciseAllocationSet()) 148 148 set->add(allocation->cell()); 149 ASSERT(allocation->indexInSpace() == m_space.m_ largeAllocations.size() - 1);149 ASSERT(allocation->indexInSpace() == m_space.m_preciseAllocations.size() - 1); 150 150 vm.heap.didAllocate(size); 151 151 m_space.m_capacity += size; 152 152 153 m_ largeAllocations.append(allocation);153 m_preciseAllocations.append(allocation); 154 154 155 155 return allocation->cell(); 156 156 } 157 157 158 void* CompleteSubspace::reallocate LargeAllocationNonVirtual(VM& vm, HeapCell* oldCell, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)158 void* CompleteSubspace::reallocatePreciseAllocationNonVirtual(VM& vm, HeapCell* oldCell, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode) 159 159 { 160 160 if (validateDFGDoesGC) … … 162 162 163 163 // The following conditions are met in Butterfly for example. 164 ASSERT(oldCell->is LargeAllocation());165 166 LargeAllocation* oldAllocation = &oldCell->largeAllocation();164 ASSERT(oldCell->isPreciseAllocation()); 165 166 PreciseAllocation* oldAllocation = &oldCell->preciseAllocation(); 167 167 ASSERT(oldAllocation->cellSize() <= size); 168 168 ASSERT(oldAllocation->weakSet().isTriviallyDestructible()); … … 173 173 sanitizeStackForVM(vm); 174 174 175 if (size <= Options:: largeAllocationCutoff()175 if (size <= Options::preciseAllocationCutoff() 176 176 && size <= MarkedSpace::largeCutoff) { 177 177 dataLog("FATAL: attampting to allocate small object using large allocation.\n"); … … 188 188 oldAllocation->remove(); 189 189 190 LargeAllocation* allocation = oldAllocation->tryReallocate(size, this);190 PreciseAllocation* allocation = oldAllocation->tryReallocate(size, this); 191 191 if (!allocation) { 192 192 RELEASE_ASSERT(failureMode != AllocationFailureMode::Assert); 193 m_ largeAllocations.append(oldAllocation);193 m_preciseAllocations.append(oldAllocation); 194 194 return nullptr; 195 195 } … … 198 198 // If reallocation changes the address, we should update HashSet. 199 199 if (oldAllocation != allocation) { 200 if (auto* set = m_space. largeAllocationSet()) {200 if (auto* set = m_space.preciseAllocationSet()) { 201 201 set->remove(oldAllocation->cell()); 202 202 set->add(allocation->cell()); … … 204 204 } 205 205 206 m_space.m_ largeAllocations[oldIndexInSpace] = allocation;206 m_space.m_preciseAllocations[oldIndexInSpace] = allocation; 207 207 vm.heap.didAllocate(difference); 208 208 m_space.m_capacity += difference; 209 209 210 m_ largeAllocations.append(allocation);210 m_preciseAllocations.append(allocation); 211 211 212 212 return allocation->cell(); -
trunk/Source/JavaScriptCore/heap/CompleteSubspace.h
r243688 r252302 45 45 void* allocate(VM&, size_t, GCDeferralContext*, AllocationFailureMode) override; 46 46 void* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode); 47 void* reallocate LargeAllocationNonVirtual(VM&, HeapCell*, size_t, GCDeferralContext*, AllocationFailureMode);47 void* reallocatePreciseAllocationNonVirtual(VM&, HeapCell*, size_t, GCDeferralContext*, AllocationFailureMode); 48 48 49 49 static ptrdiff_t offsetOfAllocatorForSizeStep() { return OBJECT_OFFSETOF(CompleteSubspace, m_allocatorForSizeStep); } -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r252298 r252302 2154 2154 void Heap::sweepInFinalize() 2155 2155 { 2156 m_objectSpace.sweep LargeAllocations();2156 m_objectSpace.sweepPreciseAllocations(); 2157 2157 vm().eagerlySweptDestructibleObjectSpace.sweep(); 2158 2158 } -
trunk/Source/JavaScriptCore/heap/HeapCell.cpp
r236450 r252302 35 35 bool HeapCell::isLive() 36 36 { 37 if (is LargeAllocation())38 return largeAllocation().isLive();37 if (isPreciseAllocation()) 38 return preciseAllocation().isLive(); 39 39 auto& markedBlockHandle = markedBlock().handle(); 40 40 if (markedBlockHandle.isFreeListed()) -
trunk/Source/JavaScriptCore/heap/HeapCell.h
r251425 r252302 32 32 class CellContainer; 33 33 class Heap; 34 class LargeAllocation;34 class PreciseAllocation; 35 35 class MarkedBlock; 36 36 class Subspace; … … 62 62 bool isLive(); 63 63 64 bool is LargeAllocation() const;64 bool isPreciseAllocation() const; 65 65 CellContainer cellContainer() const; 66 66 MarkedBlock& markedBlock() const; 67 LargeAllocation& largeAllocation() const;67 PreciseAllocation& preciseAllocation() const; 68 68 69 69 // If you want performance and you know that your cell is small, you can do this instead: 70 // ASSERT(!cell->is LargeAllocation());70 // ASSERT(!cell->isPreciseAllocation()); 71 71 // cell->markedBlock().vm() 72 72 // We currently only use this hack for callees to make CallFrame::vm() fast. It's not -
trunk/Source/JavaScriptCore/heap/HeapCellInlines.h
r249175 r252302 28 28 #include "CellContainer.h" 29 29 #include "HeapCell.h" 30 #include " LargeAllocation.h"30 #include "PreciseAllocation.h" 31 31 #include "VM.h" 32 32 33 33 namespace JSC { 34 34 35 ALWAYS_INLINE bool HeapCell::is LargeAllocation() const35 ALWAYS_INLINE bool HeapCell::isPreciseAllocation() const 36 36 { 37 return LargeAllocation::isLargeAllocation(const_cast<HeapCell*>(this));37 return PreciseAllocation::isPreciseAllocation(const_cast<HeapCell*>(this)); 38 38 } 39 39 40 40 ALWAYS_INLINE CellContainer HeapCell::cellContainer() const 41 41 { 42 if (is LargeAllocation())43 return largeAllocation();42 if (isPreciseAllocation()) 43 return preciseAllocation(); 44 44 return markedBlock(); 45 45 } … … 50 50 } 51 51 52 ALWAYS_INLINE LargeAllocation& HeapCell::largeAllocation() const52 ALWAYS_INLINE PreciseAllocation& HeapCell::preciseAllocation() const 53 53 { 54 return * LargeAllocation::fromCell(const_cast<HeapCell*>(this));54 return *PreciseAllocation::fromCell(const_cast<HeapCell*>(this)); 55 55 } 56 56 … … 62 62 ALWAYS_INLINE VM& HeapCell::vm() const 63 63 { 64 if (is LargeAllocation())65 return largeAllocation().vm();64 if (isPreciseAllocation()) 65 return preciseAllocation().vm(); 66 66 return markedBlock().vm(); 67 67 } … … 69 69 ALWAYS_INLINE size_t HeapCell::cellSize() const 70 70 { 71 if (is LargeAllocation())72 return largeAllocation().cellSize();71 if (isPreciseAllocation()) 72 return preciseAllocation().cellSize(); 73 73 return markedBlock().cellSize(); 74 74 } … … 76 76 ALWAYS_INLINE CellAttributes HeapCell::cellAttributes() const 77 77 { 78 if (is LargeAllocation())79 return largeAllocation().attributes();78 if (isPreciseAllocation()) 79 return preciseAllocation().attributes(); 80 80 return markedBlock().attributes(); 81 81 } … … 93 93 ALWAYS_INLINE Subspace* HeapCell::subspace() const 94 94 { 95 if (is LargeAllocation())96 return largeAllocation().subspace();95 if (isPreciseAllocation()) 96 return preciseAllocation().subspace(); 97 97 return markedBlock().subspace(); 98 98 } -
trunk/Source/JavaScriptCore/heap/HeapInlines.h
r249175 r252302 71 71 { 72 72 HeapCell* cell = bitwise_cast<HeapCell*>(rawCell); 73 if (cell->is LargeAllocation())74 return cell-> largeAllocation().isMarked();73 if (cell->isPreciseAllocation()) 74 return cell->preciseAllocation().isMarked(); 75 75 MarkedBlock& block = cell->markedBlock(); 76 76 return block.isMarked(m_objectSpace.markingVersion(), cell); … … 80 80 { 81 81 HeapCell* cell = bitwise_cast<HeapCell*>(rawCell); 82 if (cell->is LargeAllocation())83 return cell-> largeAllocation().testAndSetMarked();82 if (cell->isPreciseAllocation()) 83 return cell->preciseAllocation().testAndSetMarked(); 84 84 MarkedBlock& block = cell->markedBlock(); 85 85 Dependency dependency = block.aboutToMark(markingVersion); -
trunk/Source/JavaScriptCore/heap/HeapUtil.h
r252298 r252302 58 58 59 59 // It could point to a large allocation. 60 if (heap.objectSpace(). largeAllocationsForThisCollectionSize()) {61 if (heap.objectSpace(). largeAllocationsForThisCollectionBegin()[0]->aboveLowerBound(pointer)62 && heap.objectSpace(). largeAllocationsForThisCollectionEnd()[-1]->belowUpperBound(pointer)) {63 LargeAllocation** result = approximateBinarySearch<LargeAllocation*>(64 heap.objectSpace(). largeAllocationsForThisCollectionBegin(),65 heap.objectSpace(). largeAllocationsForThisCollectionSize(),66 LargeAllocation::fromCell(pointer),67 [] ( LargeAllocation** ptr) -> LargeAllocation* { return *ptr; });60 if (heap.objectSpace().preciseAllocationsForThisCollectionSize()) { 61 if (heap.objectSpace().preciseAllocationsForThisCollectionBegin()[0]->aboveLowerBound(pointer) 62 && heap.objectSpace().preciseAllocationsForThisCollectionEnd()[-1]->belowUpperBound(pointer)) { 63 PreciseAllocation** result = approximateBinarySearch<PreciseAllocation*>( 64 heap.objectSpace().preciseAllocationsForThisCollectionBegin(), 65 heap.objectSpace().preciseAllocationsForThisCollectionSize(), 66 PreciseAllocation::fromCell(pointer), 67 [] (PreciseAllocation** ptr) -> PreciseAllocation* { return *ptr; }); 68 68 if (result) { 69 auto attemptLarge = [&] ( LargeAllocation* allocation) {69 auto attemptLarge = [&] (PreciseAllocation* allocation) { 70 70 if (allocation->contains(pointer)) 71 71 func(allocation->cell(), allocation->attributes().cellKind); 72 72 }; 73 73 74 if (result > heap.objectSpace(). largeAllocationsForThisCollectionBegin())74 if (result > heap.objectSpace().preciseAllocationsForThisCollectionBegin()) 75 75 attemptLarge(result[-1]); 76 76 attemptLarge(result[0]); 77 if (result + 1 < heap.objectSpace(). largeAllocationsForThisCollectionEnd())77 if (result + 1 < heap.objectSpace().preciseAllocationsForThisCollectionEnd()) 78 78 attemptLarge(result[1]); 79 79 } … … 132 132 { 133 133 // It could point to a large allocation. 134 if (pointer->is LargeAllocation()) {135 auto* set = heap.objectSpace(). largeAllocationSet();134 if (pointer->isPreciseAllocation()) { 135 auto* set = heap.objectSpace().preciseAllocationSet(); 136 136 ASSERT(set); 137 137 if (set->isEmpty()) … … 167 167 Heap& heap, TinyBloomFilter filter, JSValue value) 168 168 { 169 ASSERT(heap.objectSpace(). largeAllocationSet());169 ASSERT(heap.objectSpace().preciseAllocationSet()); 170 170 if (!value.isCell()) 171 171 return false; -
trunk/Source/JavaScriptCore/heap/IsoAlignedMemoryAllocator.cpp
r252298 r252302 102 102 void* IsoAlignedMemoryAllocator::tryReallocateMemory(void*, size_t) 103 103 { 104 // In IsoSubspace-managed LargeAllocation, we must not perform realloc.104 // In IsoSubspace-managed PreciseAllocation, we must not perform realloc. 105 105 RELEASE_ASSERT_NOT_REACHED(); 106 106 } -
trunk/Source/JavaScriptCore/heap/IsoCellSetInlines.h
r252298 r252302 34 34 inline bool IsoCellSet::add(HeapCell* cell) 35 35 { 36 if (cell->is LargeAllocation())37 return !m_lowerTierBits.concurrentTestAndSet(cell-> largeAllocation().lowerTierIndex());36 if (cell->isPreciseAllocation()) 37 return !m_lowerTierBits.concurrentTestAndSet(cell->preciseAllocation().lowerTierIndex()); 38 38 AtomIndices atomIndices(cell); 39 39 auto& bitsPtrRef = m_bits[atomIndices.blockIndex]; … … 46 46 inline bool IsoCellSet::remove(HeapCell* cell) 47 47 { 48 if (cell->is LargeAllocation())49 return !m_lowerTierBits.concurrentTestAndClear(cell-> largeAllocation().lowerTierIndex());48 if (cell->isPreciseAllocation()) 49 return !m_lowerTierBits.concurrentTestAndClear(cell->preciseAllocation().lowerTierIndex()); 50 50 AtomIndices atomIndices(cell); 51 51 auto& bitsPtrRef = m_bits[atomIndices.blockIndex]; … … 58 58 inline bool IsoCellSet::contains(HeapCell* cell) const 59 59 { 60 if (cell->is LargeAllocation())61 return !m_lowerTierBits.get(cell-> largeAllocation().lowerTierIndex());60 if (cell->isPreciseAllocation()) 61 return !m_lowerTierBits.get(cell->preciseAllocation().lowerTierIndex()); 62 62 AtomIndices atomIndices(cell); 63 63 auto* bits = m_bits[atomIndices.blockIndex].get(); … … 85 85 86 86 CellAttributes attributes = m_subspace.attributes(); 87 m_subspace.forEach LargeAllocation(88 [&] ( LargeAllocation* allocation) {87 m_subspace.forEachPreciseAllocation( 88 [&] (PreciseAllocation* allocation) { 89 89 if (m_lowerTierBits.get(allocation->lowerTierIndex()) && allocation->isMarked()) 90 90 func(allocation->cell(), attributes.cellKind); … … 119 119 { 120 120 auto locker = holdLock(m_lock); 121 if (!m_needToVisit LargeAllocations)121 if (!m_needToVisitPreciseAllocations) 122 122 return; 123 m_needToVisit LargeAllocations = false;123 m_needToVisitPreciseAllocations = false; 124 124 } 125 125 126 126 CellAttributes attributes = m_set.m_subspace.attributes(); 127 m_set.m_subspace.forEach LargeAllocation(128 [&] ( LargeAllocation* allocation) {127 m_set.m_subspace.forEachPreciseAllocation( 128 [&] (PreciseAllocation* allocation) { 129 129 if (m_set.m_lowerTierBits.get(allocation->lowerTierIndex()) && allocation->isMarked()) 130 130 m_func(visitor, allocation->cell(), attributes.cellKind); … … 137 137 Func m_func; 138 138 Lock m_lock; 139 bool m_needToVisit LargeAllocations { true };139 bool m_needToVisitPreciseAllocations { true }; 140 140 }; 141 141 … … 161 161 162 162 CellAttributes attributes = m_subspace.attributes(); 163 m_subspace.forEach LargeAllocation(164 [&] ( LargeAllocation* allocation) {163 m_subspace.forEachPreciseAllocation( 164 [&] (PreciseAllocation* allocation) { 165 165 if (m_lowerTierBits.get(allocation->lowerTierIndex()) && allocation->isLive()) 166 166 func(allocation->cell(), attributes.cellKind); -
trunk/Source/JavaScriptCore/heap/IsoSubspace.cpp
r252298 r252302 93 93 void* IsoSubspace::tryAllocateFromLowerTier() 94 94 { 95 auto revive = [&] ( LargeAllocation* allocation) {96 allocation->setIndexInSpace(m_space.m_ largeAllocations.size());95 auto revive = [&] (PreciseAllocation* allocation) { 96 allocation->setIndexInSpace(m_space.m_preciseAllocations.size()); 97 97 allocation->m_hasValidCell = true; 98 m_space.m_ largeAllocations.append(allocation);99 if (auto* set = m_space. largeAllocationSet())98 m_space.m_preciseAllocations.append(allocation); 99 if (auto* set = m_space.preciseAllocationSet()) 100 100 set->add(allocation->cell()); 101 ASSERT(allocation->indexInSpace() == m_space.m_ largeAllocations.size() - 1);102 m_ largeAllocations.append(allocation);101 ASSERT(allocation->indexInSpace() == m_space.m_preciseAllocations.size() - 1); 102 m_preciseAllocations.append(allocation); 103 103 return allocation->cell(); 104 104 }; 105 105 106 106 if (!m_lowerTierFreeList.isEmpty()) { 107 LargeAllocation* allocation = m_lowerTierFreeList.begin();107 PreciseAllocation* allocation = m_lowerTierFreeList.begin(); 108 108 allocation->remove(); 109 109 return revive(allocation); … … 111 111 if (m_lowerTierCellCount != MarkedBlock::numberOfLowerTierCells) { 112 112 size_t size = WTF::roundUpToMultipleOf<MarkedSpace::sizeStep>(m_size); 113 LargeAllocation* allocation = LargeAllocation::createForLowerTier(*m_space.heap(), size, this, m_lowerTierCellCount++);113 PreciseAllocation* allocation = PreciseAllocation::createForLowerTier(*m_space.heap(), size, this, m_lowerTierCellCount++); 114 114 return revive(allocation); 115 115 } … … 117 117 } 118 118 119 void IsoSubspace::sweepLowerTierCell( LargeAllocation* largeAllocation)119 void IsoSubspace::sweepLowerTierCell(PreciseAllocation* preciseAllocation) 120 120 { 121 unsigned lowerTierIndex = largeAllocation->lowerTierIndex();122 largeAllocation = largeAllocation->reuseForLowerTier();123 m_lowerTierFreeList.append( largeAllocation);121 unsigned lowerTierIndex = preciseAllocation->lowerTierIndex(); 122 preciseAllocation = preciseAllocation->reuseForLowerTier(); 123 m_lowerTierFreeList.append(preciseAllocation); 124 124 m_cellSets.forEach( 125 125 [&] (IsoCellSet* set) { … … 130 130 void IsoSubspace::destroyLowerTierFreeList() 131 131 { 132 m_lowerTierFreeList.forEach([&]( LargeAllocation* allocation) {132 m_lowerTierFreeList.forEach([&](PreciseAllocation* allocation) { 133 133 allocation->destroy(); 134 134 }); -
trunk/Source/JavaScriptCore/heap/IsoSubspace.h
r252298 r252302 49 49 void* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode); 50 50 51 void sweepLowerTierCell( LargeAllocation*);51 void sweepLowerTierCell(PreciseAllocation*); 52 52 53 53 void* tryAllocateFromLowerTier(); … … 65 65 LocalAllocator m_localAllocator; 66 66 std::unique_ptr<IsoAlignedMemoryAllocator> m_isoAlignedMemoryAllocator; 67 SentinelLinkedList< LargeAllocation, PackedRawSentinelNode<LargeAllocation>> m_lowerTierFreeList;67 SentinelLinkedList<PreciseAllocation, PackedRawSentinelNode<PreciseAllocation>> m_lowerTierFreeList; 68 68 SentinelLinkedList<IsoCellSet, PackedRawSentinelNode<IsoCellSet>> m_cellSets; 69 69 uint8_t m_lowerTierCellCount { 0 }; -
trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp
r252298 r252302 131 131 // This is usually how we get out of the loop. 132 132 if (betterSizeClass > MarkedSpace::largeCutoff 133 || betterSizeClass > Options:: largeAllocationCutoff())133 || betterSizeClass > Options::preciseAllocationCutoff()) 134 134 break; 135 135 … … 212 212 freeBlock(block); 213 213 }); 214 for ( LargeAllocation* allocation : m_largeAllocations)214 for (PreciseAllocation* allocation : m_preciseAllocations) 215 215 allocation->destroy(); 216 216 forEachSubspace([&](Subspace& subspace) { … … 228 228 return IterationStatus::Continue; 229 229 }); 230 for ( LargeAllocation* allocation : m_largeAllocations)230 for (PreciseAllocation* allocation : m_preciseAllocations) 231 231 allocation->lastChanceToFinalize(); 232 232 // We do not call lastChanceToFinalize for lower-tier swept cells since we need nothing to do. … … 243 243 } 244 244 245 void MarkedSpace::sweep LargeAllocations()246 { 247 RELEASE_ASSERT(m_ largeAllocationsNurseryOffset == m_largeAllocations.size());248 unsigned srcIndex = m_ largeAllocationsNurseryOffsetForSweep;245 void MarkedSpace::sweepPreciseAllocations() 246 { 247 RELEASE_ASSERT(m_preciseAllocationsNurseryOffset == m_preciseAllocations.size()); 248 unsigned srcIndex = m_preciseAllocationsNurseryOffsetForSweep; 249 249 unsigned dstIndex = srcIndex; 250 while (srcIndex < m_ largeAllocations.size()) {251 LargeAllocation* allocation = m_largeAllocations[srcIndex++];250 while (srcIndex < m_preciseAllocations.size()) { 251 PreciseAllocation* allocation = m_preciseAllocations[srcIndex++]; 252 252 allocation->sweep(); 253 253 if (allocation->isEmpty()) { 254 if (auto* set = largeAllocationSet())254 if (auto* set = preciseAllocationSet()) 255 255 set->remove(allocation->cell()); 256 256 if (allocation->isLowerTier()) … … 263 263 } 264 264 allocation->setIndexInSpace(dstIndex); 265 m_ largeAllocations[dstIndex++] = allocation;266 } 267 m_ largeAllocations.shrink(dstIndex);268 m_ largeAllocationsNurseryOffset = m_largeAllocations.size();265 m_preciseAllocations[dstIndex++] = allocation; 266 } 267 m_preciseAllocations.shrink(dstIndex); 268 m_preciseAllocationsNurseryOffset = m_preciseAllocations.size(); 269 269 } 270 270 … … 278 278 279 279 if (m_heap->collectionScope() == CollectionScope::Eden) 280 m_ largeAllocationsNurseryOffsetForSweep = m_largeAllocationsNurseryOffset;280 m_preciseAllocationsNurseryOffsetForSweep = m_preciseAllocationsNurseryOffset; 281 281 else 282 m_ largeAllocationsNurseryOffsetForSweep = 0;283 m_ largeAllocationsNurseryOffset = m_largeAllocations.size();284 } 285 286 void MarkedSpace::enable LargeAllocationTracking()287 { 288 m_ largeAllocationSet = makeUnique<HashSet<HeapCell*>>();289 for (auto* allocation : m_ largeAllocations)290 m_ largeAllocationSet->add(allocation->cell());282 m_preciseAllocationsNurseryOffsetForSweep = 0; 283 m_preciseAllocationsNurseryOffset = m_preciseAllocations.size(); 284 } 285 286 void MarkedSpace::enablePreciseAllocationTracking() 287 { 288 m_preciseAllocationSet = makeUnique<HashSet<HeapCell*>>(); 289 for (auto* allocation : m_preciseAllocations) 290 m_preciseAllocationSet->add(allocation->cell()); 291 291 } 292 292 … … 337 337 void MarkedSpace::prepareForConservativeScan() 338 338 { 339 m_ largeAllocationsForThisCollectionBegin = m_largeAllocations.begin() + m_largeAllocationsOffsetForThisCollection;340 m_ largeAllocationsForThisCollectionSize = m_largeAllocations.size() - m_largeAllocationsOffsetForThisCollection;341 m_ largeAllocationsForThisCollectionEnd = m_largeAllocations.end();342 RELEASE_ASSERT(m_ largeAllocationsForThisCollectionEnd == m_largeAllocationsForThisCollectionBegin + m_largeAllocationsForThisCollectionSize);339 m_preciseAllocationsForThisCollectionBegin = m_preciseAllocations.begin() + m_preciseAllocationsOffsetForThisCollection; 340 m_preciseAllocationsForThisCollectionSize = m_preciseAllocations.size() - m_preciseAllocationsOffsetForThisCollection; 341 m_preciseAllocationsForThisCollectionEnd = m_preciseAllocations.end(); 342 RELEASE_ASSERT(m_preciseAllocationsForThisCollectionEnd == m_preciseAllocationsForThisCollectionBegin + m_preciseAllocationsForThisCollectionSize); 343 343 344 344 std::sort( 345 m_ largeAllocationsForThisCollectionBegin, m_largeAllocationsForThisCollectionEnd,346 [&] ( LargeAllocation* a, LargeAllocation* b) {345 m_preciseAllocationsForThisCollectionBegin, m_preciseAllocationsForThisCollectionEnd, 346 [&] (PreciseAllocation* a, PreciseAllocation* b) { 347 347 return a < b; 348 348 }); 349 unsigned index = m_ largeAllocationsOffsetForThisCollection;350 for (auto* start = m_ largeAllocationsForThisCollectionBegin; start != m_largeAllocationsForThisCollectionEnd; ++start, ++index) {349 unsigned index = m_preciseAllocationsOffsetForThisCollection; 350 for (auto* start = m_preciseAllocationsForThisCollectionBegin; start != m_preciseAllocationsForThisCollectionEnd; ++start, ++index) { 351 351 (*start)->setIndexInSpace(index); 352 ASSERT(m_ largeAllocations[index] == *start);353 ASSERT(m_ largeAllocations[index]->indexInSpace() == index);352 ASSERT(m_preciseAllocations[index] == *start); 353 ASSERT(m_preciseAllocations[index]->indexInSpace() == index); 354 354 } 355 355 } … … 358 358 { 359 359 if (m_heap->collectionScope() == CollectionScope::Eden) 360 m_ largeAllocationsOffsetForThisCollection = m_largeAllocationsNurseryOffset;360 m_preciseAllocationsOffsetForThisCollection = m_preciseAllocationsNurseryOffset; 361 361 else 362 m_ largeAllocationsOffsetForThisCollection = 0;362 m_preciseAllocationsOffsetForThisCollection = 0; 363 363 } 364 364 … … 370 370 return IterationStatus::Continue; 371 371 }); 372 // Nothing to do for LargeAllocations.372 // Nothing to do for PreciseAllocations. 373 373 } 374 374 … … 384 384 return IterationStatus::Continue; 385 385 }); 386 // FIXME: Consider taking LargeAllocations into account here.386 // FIXME: Consider taking PreciseAllocations into account here. 387 387 return result; 388 388 } … … 433 433 m_markingVersion = nextVersion(m_markingVersion); 434 434 435 for ( LargeAllocation* allocation : m_largeAllocations)435 for (PreciseAllocation* allocation : m_preciseAllocations) 436 436 allocation->flip(); 437 437 } … … 460 460 m_newlyAllocatedVersion = nextVersion(m_newlyAllocatedVersion); 461 461 462 for (unsigned i = m_ largeAllocationsOffsetForThisCollection; i < m_largeAllocations.size(); ++i)463 m_ largeAllocations[i]->clearNewlyAllocated();462 for (unsigned i = m_preciseAllocationsOffsetForThisCollection; i < m_preciseAllocations.size(); ++i) 463 m_preciseAllocations[i]->clearNewlyAllocated(); 464 464 465 465 if (!ASSERT_DISABLED) { 466 for ( LargeAllocation* allocation : m_largeAllocations)466 for (PreciseAllocation* allocation : m_preciseAllocations) 467 467 ASSERT_UNUSED(allocation, !allocation->isNewlyAllocated()); 468 468 } … … 498 498 result += block->markCount(); 499 499 }); 500 for ( LargeAllocation* allocation : m_largeAllocations) {500 for (PreciseAllocation* allocation : m_preciseAllocations) { 501 501 if (allocation->isMarked()) 502 502 result++; … … 512 512 result += block->markCount() * block->cellSize(); 513 513 }); 514 for ( LargeAllocation* allocation : m_largeAllocations) {514 for (PreciseAllocation* allocation : m_preciseAllocations) { 515 515 if (allocation->isMarked()) 516 516 result += allocation->cellSize(); -
trunk/Source/JavaScriptCore/heap/MarkedSpace.h
r252298 r252302 24 24 #include "BlockDirectory.h" 25 25 #include "IterationStatus.h" 26 #include "LargeAllocation.h"27 26 #include "MarkedBlock.h" 28 27 #include "MarkedBlockSet.h" 28 #include "PreciseAllocation.h" 29 29 #include <array> 30 30 #include <wtf/Bag.h> … … 142 142 void clearNewlyAllocated(); 143 143 void sweep(); 144 void sweep LargeAllocations();144 void sweepPreciseAllocations(); 145 145 void assertNoUnswept(); 146 146 size_t objectCount(); … … 153 153 HeapVersion newlyAllocatedVersion() const { return m_newlyAllocatedVersion; } 154 154 155 const Vector< LargeAllocation*>& largeAllocations() const { return m_largeAllocations; }156 unsigned largeAllocationsNurseryOffset() const { return m_largeAllocationsNurseryOffset; }157 unsigned largeAllocationsOffsetForThisCollection() const { return m_largeAllocationsOffsetForThisCollection; }158 HashSet<HeapCell*>* largeAllocationSet() const { return m_largeAllocationSet.get(); }159 160 void enable LargeAllocationTracking();155 const Vector<PreciseAllocation*>& preciseAllocations() const { return m_preciseAllocations; } 156 unsigned preciseAllocationsNurseryOffset() const { return m_preciseAllocationsNurseryOffset; } 157 unsigned preciseAllocationsOffsetForThisCollection() const { return m_preciseAllocationsOffsetForThisCollection; } 158 HashSet<HeapCell*>* preciseAllocationSet() const { return m_preciseAllocationSet.get(); } 159 160 void enablePreciseAllocationTracking(); 161 161 162 162 // These are cached pointers and offsets for quickly searching the large allocations that are 163 163 // relevant to this collection. 164 LargeAllocation** largeAllocationsForThisCollectionBegin() const { return m_largeAllocationsForThisCollectionBegin; }165 LargeAllocation** largeAllocationsForThisCollectionEnd() const { return m_largeAllocationsForThisCollectionEnd; }166 unsigned largeAllocationsForThisCollectionSize() const { return m_largeAllocationsForThisCollectionSize; }164 PreciseAllocation** preciseAllocationsForThisCollectionBegin() const { return m_preciseAllocationsForThisCollectionBegin; } 165 PreciseAllocation** preciseAllocationsForThisCollectionEnd() const { return m_preciseAllocationsForThisCollectionEnd; } 166 unsigned preciseAllocationsForThisCollectionSize() const { return m_preciseAllocationsForThisCollectionSize; } 167 167 168 168 BlockDirectory* firstDirectory() const { return m_directories.first(); } … … 205 205 Vector<Subspace*> m_subspaces; 206 206 207 std::unique_ptr<HashSet<HeapCell*>> m_ largeAllocationSet;208 Vector< LargeAllocation*> m_largeAllocations;209 unsigned m_ largeAllocationsNurseryOffset { 0 };210 unsigned m_ largeAllocationsOffsetForThisCollection { 0 };211 unsigned m_ largeAllocationsNurseryOffsetForSweep { 0 };212 unsigned m_ largeAllocationsForThisCollectionSize { 0 };213 LargeAllocation** m_largeAllocationsForThisCollectionBegin { nullptr };214 LargeAllocation** m_largeAllocationsForThisCollectionEnd { nullptr };207 std::unique_ptr<HashSet<HeapCell*>> m_preciseAllocationSet; 208 Vector<PreciseAllocation*> m_preciseAllocations; 209 unsigned m_preciseAllocationsNurseryOffset { 0 }; 210 unsigned m_preciseAllocationsOffsetForThisCollection { 0 }; 211 unsigned m_preciseAllocationsNurseryOffsetForSweep { 0 }; 212 unsigned m_preciseAllocationsForThisCollectionSize { 0 }; 213 PreciseAllocation** m_preciseAllocationsForThisCollectionBegin { nullptr }; 214 PreciseAllocation** m_preciseAllocationsForThisCollectionEnd { nullptr }; 215 215 216 216 Heap* m_heap; -
trunk/Source/JavaScriptCore/heap/MarkedSpaceInlines.h
r226822 r252302 48 48 return; 49 49 } 50 for ( LargeAllocation* allocation : m_largeAllocations) {50 for (PreciseAllocation* allocation : m_preciseAllocations) { 51 51 if (allocation->isLive()) { 52 52 if (functor(allocation->cell(), allocation->attributes().cellKind) == IterationStatus::Done) … … 64 64 return; 65 65 } 66 for ( LargeAllocation* allocation : m_largeAllocations) {66 for (PreciseAllocation* allocation : m_preciseAllocations) { 67 67 if (!allocation->isLive()) { 68 68 if (functor(allocation->cell(), allocation->attributes().cellKind) == IterationStatus::Done) -
trunk/Source/JavaScriptCore/heap/PreciseAllocation.cpp
r252301 r252302 25 25 26 26 #include "config.h" 27 #include " LargeAllocation.h"27 #include "PreciseAllocation.h" 28 28 29 29 #include "AlignedMemoryAllocator.h" … … 35 35 namespace JSC { 36 36 37 static inline bool isAlignedFor LargeAllocation(void* memory)37 static inline bool isAlignedForPreciseAllocation(void* memory) 38 38 { 39 39 uintptr_t allocatedPointer = bitwise_cast<uintptr_t>(memory); 40 return !(allocatedPointer & ( LargeAllocation::alignment - 1));41 } 42 43 LargeAllocation* LargeAllocation::tryCreate(Heap& heap, size_t size, Subspace* subspace, unsigned indexInSpace)40 return !(allocatedPointer & (PreciseAllocation::alignment - 1)); 41 } 42 43 PreciseAllocation* PreciseAllocation::tryCreate(Heap& heap, size_t size, Subspace* subspace, unsigned indexInSpace) 44 44 { 45 45 if (validateDFGDoesGC) … … 55 55 56 56 bool adjustedAlignment = false; 57 if (!isAlignedFor LargeAllocation(space)) {57 if (!isAlignedForPreciseAllocation(space)) { 58 58 space = bitwise_cast<void*>(bitwise_cast<uintptr_t>(space) + halfAlignment); 59 59 adjustedAlignment = true; 60 ASSERT(isAlignedFor LargeAllocation(space));60 ASSERT(isAlignedForPreciseAllocation(space)); 61 61 } 62 62 63 63 if (scribbleFreeCells()) 64 64 scribble(space, size); 65 return new (NotNull, space) LargeAllocation(heap, size, subspace, indexInSpace, adjustedAlignment);66 } 67 68 LargeAllocation* LargeAllocation::tryReallocate(size_t size, Subspace* subspace)65 return new (NotNull, space) PreciseAllocation(heap, size, subspace, indexInSpace, adjustedAlignment); 66 } 67 68 PreciseAllocation* PreciseAllocation::tryReallocate(size_t size, Subspace* subspace) 69 69 { 70 70 ASSERT(!isLowerTier()); … … 82 82 return nullptr; 83 83 84 LargeAllocation* newAllocation = bitwise_cast<LargeAllocation*>(newBasePointer);84 PreciseAllocation* newAllocation = bitwise_cast<PreciseAllocation*>(newBasePointer); 85 85 bool newAdjustedAlignment = false; 86 if (!isAlignedFor LargeAllocation(newBasePointer)) {86 if (!isAlignedForPreciseAllocation(newBasePointer)) { 87 87 newAdjustedAlignment = true; 88 newAllocation = bitwise_cast< LargeAllocation*>(bitwise_cast<uintptr_t>(newBasePointer) + halfAlignment);89 ASSERT(isAlignedFor LargeAllocation(static_cast<void*>(newAllocation)));88 newAllocation = bitwise_cast<PreciseAllocation*>(bitwise_cast<uintptr_t>(newBasePointer) + halfAlignment); 89 ASSERT(isAlignedForPreciseAllocation(static_cast<void*>(newAllocation))); 90 90 } 91 91 … … 103 103 // Now [ ][ content ] 104 104 // New [ content ]... 105 memmove(newBasePointer, bitwise_cast<char*>(newBasePointer) + halfAlignment, oldCellSize + LargeAllocation::headerSize());105 memmove(newBasePointer, bitwise_cast<char*>(newBasePointer) + halfAlignment, oldCellSize + PreciseAllocation::headerSize()); 106 106 } else { 107 107 ASSERT(newAdjustedAlignment); … … 111 111 // Now [ content ][ ] 112 112 // New [ 8 ][ content ] 113 memmove(bitwise_cast<char*>(newBasePointer) + halfAlignment, newBasePointer, oldCellSize + LargeAllocation::headerSize());113 memmove(bitwise_cast<char*>(newBasePointer) + halfAlignment, newBasePointer, oldCellSize + PreciseAllocation::headerSize()); 114 114 } 115 115 } … … 121 121 122 122 123 LargeAllocation* LargeAllocation::createForLowerTier(Heap& heap, size_t size, Subspace* subspace, uint8_t lowerTierIndex)123 PreciseAllocation* PreciseAllocation::createForLowerTier(Heap& heap, size_t size, Subspace* subspace, uint8_t lowerTierIndex) 124 124 { 125 125 if (validateDFGDoesGC) … … 133 133 134 134 bool adjustedAlignment = false; 135 if (!isAlignedFor LargeAllocation(space)) {135 if (!isAlignedForPreciseAllocation(space)) { 136 136 space = bitwise_cast<void*>(bitwise_cast<uintptr_t>(space) + halfAlignment); 137 137 adjustedAlignment = true; 138 ASSERT(isAlignedFor LargeAllocation(space));138 ASSERT(isAlignedForPreciseAllocation(space)); 139 139 } 140 140 141 141 if (scribbleFreeCells()) 142 142 scribble(space, size); 143 LargeAllocation* largeAllocation = new (NotNull, space) LargeAllocation(heap, size, subspace, 0, adjustedAlignment);144 largeAllocation->m_lowerTierIndex = lowerTierIndex;145 return largeAllocation;146 } 147 148 LargeAllocation* LargeAllocation::reuseForLowerTier()143 PreciseAllocation* preciseAllocation = new (NotNull, space) PreciseAllocation(heap, size, subspace, 0, adjustedAlignment); 144 preciseAllocation->m_lowerTierIndex = lowerTierIndex; 145 return preciseAllocation; 146 } 147 148 PreciseAllocation* PreciseAllocation::reuseForLowerTier() 149 149 { 150 150 Heap& heap = *this->heap(); … … 155 155 156 156 void* space = this->basePointer(); 157 this->~ LargeAllocation();158 159 LargeAllocation* largeAllocation = new (NotNull, space) LargeAllocation(heap, size, subspace, 0, adjustedAlignment);160 largeAllocation->m_lowerTierIndex = lowerTierIndex;161 largeAllocation->m_hasValidCell = false;162 return largeAllocation;163 } 164 165 LargeAllocation::LargeAllocation(Heap& heap, size_t size, Subspace* subspace, unsigned indexInSpace, bool adjustedAlignment)157 this->~PreciseAllocation(); 158 159 PreciseAllocation* preciseAllocation = new (NotNull, space) PreciseAllocation(heap, size, subspace, 0, adjustedAlignment); 160 preciseAllocation->m_lowerTierIndex = lowerTierIndex; 161 preciseAllocation->m_hasValidCell = false; 162 return preciseAllocation; 163 } 164 165 PreciseAllocation::PreciseAllocation(Heap& heap, size_t size, Subspace* subspace, unsigned indexInSpace, bool adjustedAlignment) 166 166 : m_indexInSpace(indexInSpace) 167 167 , m_cellSize(size) … … 176 176 } 177 177 178 LargeAllocation::~LargeAllocation()178 PreciseAllocation::~PreciseAllocation() 179 179 { 180 180 if (isOnList()) … … 182 182 } 183 183 184 void LargeAllocation::lastChanceToFinalize()184 void PreciseAllocation::lastChanceToFinalize() 185 185 { 186 186 m_weakSet.lastChanceToFinalize(); … … 190 190 } 191 191 192 void LargeAllocation::shrink()192 void PreciseAllocation::shrink() 193 193 { 194 194 m_weakSet.shrink(); 195 195 } 196 196 197 void LargeAllocation::visitWeakSet(SlotVisitor& visitor)197 void PreciseAllocation::visitWeakSet(SlotVisitor& visitor) 198 198 { 199 199 m_weakSet.visit(visitor); 200 200 } 201 201 202 void LargeAllocation::reapWeakSet()202 void PreciseAllocation::reapWeakSet() 203 203 { 204 204 return m_weakSet.reap(); 205 205 } 206 206 207 void LargeAllocation::flip()207 void PreciseAllocation::flip() 208 208 { 209 209 ASSERT(heap()->collectionScope() == CollectionScope::Full); … … 211 211 } 212 212 213 bool LargeAllocation::isEmpty()213 bool PreciseAllocation::isEmpty() 214 214 { 215 215 return !isMarked() && m_weakSet.isEmpty() && !isNewlyAllocated(); 216 216 } 217 217 218 void LargeAllocation::sweep()218 void PreciseAllocation::sweep() 219 219 { 220 220 m_weakSet.sweep(); … … 227 227 } 228 228 229 void LargeAllocation::destroy()229 void PreciseAllocation::destroy() 230 230 { 231 231 AlignedMemoryAllocator* allocator = m_subspace->alignedMemoryAllocator(); 232 232 void* basePointer = this->basePointer(); 233 this->~ LargeAllocation();233 this->~PreciseAllocation(); 234 234 allocator->freeMemory(basePointer); 235 235 } 236 236 237 void LargeAllocation::dump(PrintStream& out) const237 void PreciseAllocation::dump(PrintStream& out) const 238 238 { 239 239 out.print(RawPointer(this), ":(cell at ", RawPointer(cell()), " with size ", m_cellSize, " and attributes ", m_attributes, ")"); … … 241 241 242 242 #if !ASSERT_DISABLED 243 void LargeAllocation::assertValidCell(VM& vm, HeapCell* cell) const243 void PreciseAllocation::assertValidCell(VM& vm, HeapCell* cell) const 244 244 { 245 245 ASSERT(&vm == &this->vm()); -
trunk/Source/JavaScriptCore/heap/PreciseAllocation.h
r252301 r252302 35 35 36 36 // WebKit has a good malloc that already knows what to do for large allocations. The GC shouldn't 37 // have to think about such things. That's where LargeAllocation comes in. We will allocate large38 // objects directly using malloc, and put the LargeAllocation header just before them. We can detect39 // when a HeapCell* is a LargeAllocation because it will have the MarkedBlock::atomSize / 2 bit set.37 // have to think about such things. That's where PreciseAllocation comes in. We will allocate large 38 // objects directly using malloc, and put the PreciseAllocation header just before them. We can detect 39 // when a HeapCell* is a PreciseAllocation because it will have the MarkedBlock::atomSize / 2 bit set. 40 40 41 class LargeAllocation : public PackedRawSentinelNode<LargeAllocation> {41 class PreciseAllocation : public PackedRawSentinelNode<PreciseAllocation> { 42 42 public: 43 43 friend class LLIntOffsetsExtractor; 44 44 friend class IsoSubspace; 45 45 46 static LargeAllocation* tryCreate(Heap&, size_t, Subspace*, unsigned indexInSpace);46 static PreciseAllocation* tryCreate(Heap&, size_t, Subspace*, unsigned indexInSpace); 47 47 48 static LargeAllocation* createForLowerTier(Heap&, size_t, Subspace*, uint8_t lowerTierIndex);49 LargeAllocation* reuseForLowerTier();48 static PreciseAllocation* createForLowerTier(Heap&, size_t, Subspace*, uint8_t lowerTierIndex); 49 PreciseAllocation* reuseForLowerTier(); 50 50 51 LargeAllocation* tryReallocate(size_t, Subspace*);51 PreciseAllocation* tryReallocate(size_t, Subspace*); 52 52 53 ~ LargeAllocation();53 ~PreciseAllocation(); 54 54 55 static LargeAllocation* fromCell(const void* cell)55 static PreciseAllocation* fromCell(const void* cell) 56 56 { 57 return bitwise_cast< LargeAllocation*>(bitwise_cast<char*>(cell) - headerSize());57 return bitwise_cast<PreciseAllocation*>(bitwise_cast<char*>(cell) - headerSize()); 58 58 } 59 59 … … 63 63 } 64 64 65 static bool is LargeAllocation(HeapCell* cell)65 static bool isPreciseAllocation(HeapCell* cell) 66 66 { 67 67 return bitwise_cast<uintptr_t>(cell) & halfAlignment; … … 159 159 static constexpr unsigned alignment = MarkedBlock::atomSize; 160 160 static constexpr unsigned halfAlignment = alignment / 2; 161 static constexpr unsigned headerSize() { return ((sizeof( LargeAllocation) + halfAlignment - 1) & ~(halfAlignment - 1)) | halfAlignment; }161 static constexpr unsigned headerSize() { return ((sizeof(PreciseAllocation) + halfAlignment - 1) & ~(halfAlignment - 1)) | halfAlignment; } 162 162 163 163 private: 164 LargeAllocation(Heap&, size_t, Subspace*, unsigned indexInSpace, bool adjustedAlignment);164 PreciseAllocation(Heap&, size_t, Subspace*, unsigned indexInSpace, bool adjustedAlignment); 165 165 166 166 void* basePointer() const; … … 178 178 }; 179 179 180 inline void* LargeAllocation::basePointer() const180 inline void* PreciseAllocation::basePointer() const 181 181 { 182 182 if (m_adjustedAlignment) -
trunk/Source/JavaScriptCore/heap/SlotVisitor.cpp
r250285 r252302 258 258 #endif 259 259 260 if (cell->is LargeAllocation())261 setMarkedAndAppendToMarkStack(cell-> largeAllocation(), cell, dependency);260 if (cell->isPreciseAllocation()) 261 setMarkedAndAppendToMarkStack(cell->preciseAllocation(), cell, dependency); 262 262 else 263 263 setMarkedAndAppendToMarkStack(cell->markedBlock(), cell, dependency); … … 282 282 void SlotVisitor::appendToMarkStack(JSCell* cell) 283 283 { 284 if (cell->is LargeAllocation())285 appendToMarkStack(cell-> largeAllocation(), cell);284 if (cell->isPreciseAllocation()) 285 appendToMarkStack(cell->preciseAllocation(), cell); 286 286 else 287 287 appendToMarkStack(cell->markedBlock(), cell); -
trunk/Source/JavaScriptCore/heap/SlotVisitorInlines.h
r249175 r252302 47 47 48 48 Dependency dependency; 49 if (UNLIKELY(cell->is LargeAllocation())) {50 if (LIKELY(cell-> largeAllocation().isMarked())) {49 if (UNLIKELY(cell->isPreciseAllocation())) { 50 if (LIKELY(cell->preciseAllocation().isMarked())) { 51 51 if (LIKELY(!m_heapAnalyzer)) 52 52 return; … … 85 85 86 86 Dependency dependency; 87 if (UNLIKELY(cell->is LargeAllocation())) {88 if (LIKELY(cell-> largeAllocation().isMarked()))87 if (UNLIKELY(cell->isPreciseAllocation())) { 88 if (LIKELY(cell->preciseAllocation().isMarked())) 89 89 return; 90 90 } else { -
trunk/Source/JavaScriptCore/heap/Subspace.h
r252298 r252302 82 82 83 83 template<typename Func> 84 void forEach LargeAllocation(const Func&);84 void forEachPreciseAllocation(const Func&); 85 85 86 86 template<typename Func> … … 114 114 BlockDirectory* m_firstDirectory { nullptr }; 115 115 BlockDirectory* m_directoryForEmptyAllocation { nullptr }; // Uses the MarkedSpace linked list of blocks. 116 SentinelLinkedList< LargeAllocation, PackedRawSentinelNode<LargeAllocation>> m_largeAllocations;116 SentinelLinkedList<PreciseAllocation, PackedRawSentinelNode<PreciseAllocation>> m_preciseAllocations; 117 117 Subspace* m_nextSubspaceInAlignedMemoryAllocator { nullptr }; 118 118 -
trunk/Source/JavaScriptCore/heap/SubspaceInlines.h
r240216 r252302 61 61 62 62 template<typename Func> 63 void Subspace::forEach LargeAllocation(const Func& func)63 void Subspace::forEachPreciseAllocation(const Func& func) 64 64 { 65 for ( LargeAllocation* allocation = m_largeAllocations.begin(); allocation != m_largeAllocations.end(); allocation = allocation->next())65 for (PreciseAllocation* allocation = m_preciseAllocations.begin(); allocation != m_preciseAllocations.end(); allocation = allocation->next()) 66 66 func(allocation); 67 67 } … … 79 79 }); 80 80 CellAttributes attributes = this->attributes(); 81 forEach LargeAllocation(82 [&] ( LargeAllocation* allocation) {81 forEachPreciseAllocation( 82 [&] (PreciseAllocation* allocation) { 83 83 if (allocation->isMarked()) 84 84 func(allocation->cell(), attributes.cellKind); … … 110 110 { 111 111 auto locker = holdLock(m_lock); 112 if (!m_needToVisit LargeAllocations)112 if (!m_needToVisitPreciseAllocations) 113 113 return; 114 m_needToVisit LargeAllocations = false;114 m_needToVisitPreciseAllocations = false; 115 115 } 116 116 117 117 CellAttributes attributes = m_subspace.attributes(); 118 m_subspace.forEach LargeAllocation(119 [&] ( LargeAllocation* allocation) {118 m_subspace.forEachPreciseAllocation( 119 [&] (PreciseAllocation* allocation) { 120 120 if (allocation->isMarked()) 121 121 m_func(visitor, allocation->cell(), attributes.cellKind); … … 128 128 Func m_func; 129 129 Lock m_lock; 130 bool m_needToVisit LargeAllocations { true };130 bool m_needToVisitPreciseAllocations { true }; 131 131 }; 132 132 … … 146 146 }); 147 147 CellAttributes attributes = this->attributes(); 148 forEach LargeAllocation(149 [&] ( LargeAllocation* allocation) {148 forEachPreciseAllocation( 149 [&] (PreciseAllocation* allocation) { 150 150 if (allocation->isLive()) 151 151 func(allocation->cell(), attributes.cellKind); -
trunk/Source/JavaScriptCore/heap/WeakBlock.cpp
r248925 r252302 142 142 ASSERT(m_container); 143 143 144 if (m_container.is LargeAllocation())145 specializedVisit(m_container. largeAllocation(), visitor);144 if (m_container.isPreciseAllocation()) 145 specializedVisit(m_container.preciseAllocation(), visitor); 146 146 else 147 147 specializedVisit(m_container.markedBlock(), visitor); -
trunk/Source/JavaScriptCore/heap/WeakSet.cpp
r252298 r252302 57 57 // If this WeakBlock is logically empty, but still has Weaks pointing into it, 58 58 // we can't destroy it just yet. Detach it from the WeakSet and hand ownership 59 // to the Heap so we don't pin down the entire MarkedBlock or LargeAllocation.59 // to the Heap so we don't pin down the entire MarkedBlock or PreciseAllocation. 60 60 m_blocks.remove(block); 61 61 heap()->addLogicallyEmptyWeakBlock(block); -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r252273 r252302 558 558 const MarkedBlockMask = ~(MarkedBlockSize - 1) 559 559 const MarkedBlockFooterOffset = constexpr MarkedBlock::offsetOfFooter 560 const LargeAllocationHeaderSize = constexpr (LargeAllocation::headerSize())561 const LargeAllocationVMOffset = (LargeAllocation::m_weakSet + WeakSet::m_vm - LargeAllocationHeaderSize)560 const PreciseAllocationHeaderSize = constexpr (PreciseAllocation::headerSize()) 561 const PreciseAllocationVMOffset = (PreciseAllocation::m_weakSet + WeakSet::m_vm - PreciseAllocationHeaderSize) 562 562 563 563 const BlackThreshold = constexpr blackThreshold … … 1166 1166 1167 1167 macro convertCalleeToVM(callee) 1168 btpnz callee, (constexpr LargeAllocation::halfAlignment), .largeAllocation1168 btpnz callee, (constexpr PreciseAllocation::halfAlignment), .preciseAllocation 1169 1169 andp MarkedBlockMask, callee 1170 1170 loadp MarkedBlockFooterOffset + MarkedBlock::Footer::m_vm[callee], callee 1171 1171 jmp .done 1172 . largeAllocation:1173 loadp LargeAllocationVMOffset[callee], callee1172 .preciseAllocation: 1173 loadp PreciseAllocationVMOffset[callee], callee 1174 1174 .done: 1175 1175 end -
trunk/Source/JavaScriptCore/runtime/ButterflyInlines.h
r252024 r252302 207 207 ASSERT(newSize >= oldSize); 208 208 209 // We can eagerly destroy butterfly backed by LargeAllocation if (1) concurrent collector is not active and (2) the butterfly does not contain any property storage.209 // We can eagerly destroy butterfly backed by PreciseAllocation if (1) concurrent collector is not active and (2) the butterfly does not contain any property storage. 210 210 // This is because during deallocation concurrent collector can access butterfly and DFG concurrent compilers accesses properties. 211 211 // Objects with no properties are common in arrays, and we are focusing on very large array crafted by repeating Array#push, so... that's fine! 212 bool canRealloc = !propertyCapacity && !vm.heap.mutatorShouldBeFenced() && bitwise_cast<HeapCell*>(theBase)->is LargeAllocation();212 bool canRealloc = !propertyCapacity && !vm.heap.mutatorShouldBeFenced() && bitwise_cast<HeapCell*>(theBase)->isPreciseAllocation(); 213 213 if (canRealloc) { 214 void* newBase = vm.jsValueGigacageAuxiliarySpace.reallocate LargeAllocationNonVirtual(vm, bitwise_cast<HeapCell*>(theBase), newSize, &deferralContext, AllocationFailureMode::ReturnNull);214 void* newBase = vm.jsValueGigacageAuxiliarySpace.reallocatePreciseAllocationNonVirtual(vm, bitwise_cast<HeapCell*>(theBase), newSize, &deferralContext, AllocationFailureMode::ReturnNull); 215 215 if (!newBase) 216 216 return nullptr; -
trunk/Source/JavaScriptCore/runtime/OptionsList.h
r252115 r252302 184 184 v(Bool, scribbleFreeCells, false, Normal, nullptr) \ 185 185 v(Double, sizeClassProgression, 1.4, Normal, nullptr) \ 186 v(Unsigned, largeAllocationCutoff, 100000, Normal, nullptr) \186 v(Unsigned, preciseAllocationCutoff, 100000, Normal, nullptr) \ 187 187 v(Bool, dumpSizeClasses, false, Normal, nullptr) \ 188 188 v(Bool, useBumpAllocator, true, Normal, nullptr) \ -
trunk/Source/JavaScriptCore/runtime/SamplingProfiler.cpp
r252298 r252302 308 308 309 309 m_currentFrames.grow(256); 310 vm.heap.objectSpace().enable LargeAllocationTracking();310 vm.heap.objectSpace().enablePreciseAllocationTracking(); 311 311 } 312 312 -
trunk/Source/JavaScriptCore/tools/VMInspector.cpp
r251475 r252302 232 232 if (heap->objectSpace().blocks().set().contains(candidate)) 233 233 return true; 234 for ( LargeAllocation* allocation : heap->objectSpace().largeAllocations()) {234 for (PreciseAllocation* allocation : heap->objectSpace().preciseAllocations()) { 235 235 if (allocation->contains(ptr)) 236 236 return true; -
trunk/Source/JavaScriptCore/tools/VMInspectorInlines.h
r250289 r252302 60 60 { 61 61 size_t allocatorCellSize = 0; 62 if (cell->is LargeAllocation()) {63 LargeAllocation& largeAllocation = cell->largeAllocation();64 AUDIT_VERIFY(action, verifier, & largeAllocation.vm() == &vm, cell, cell->type(), &largeAllocation.vm(), &vm);62 if (cell->isPreciseAllocation()) { 63 PreciseAllocation& preciseAllocation = cell->preciseAllocation(); 64 AUDIT_VERIFY(action, verifier, &preciseAllocation.vm() == &vm, cell, cell->type(), &preciseAllocation.vm(), &vm); 65 65 66 bool isValid LargeAllocation = false;67 for (auto* i : vm.heap.objectSpace(). largeAllocations()) {68 if (i == & largeAllocation) {69 isValid LargeAllocation = true;66 bool isValidPreciseAllocation = false; 67 for (auto* i : vm.heap.objectSpace().preciseAllocations()) { 68 if (i == &preciseAllocation) { 69 isValidPreciseAllocation = true; 70 70 break; 71 71 } 72 72 } 73 AUDIT_VERIFY(action, verifier, isValid LargeAllocation, cell, cell->type());73 AUDIT_VERIFY(action, verifier, isValidPreciseAllocation, cell, cell->type()); 74 74 75 allocatorCellSize = largeAllocation.cellSize();75 allocatorCellSize = preciseAllocation.cellSize(); 76 76 } else { 77 77 MarkedBlock& block = cell->markedBlock();
Note: See TracChangeset
for help on using the changeset viewer.