Changeset 252302 in webkit


Ignore:
Timestamp:
Nov 8, 2019 7:45:18 PM (4 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Rename LargeAllocation to PreciseAllocation
https://bugs.webkit.org/show_bug.cgi?id=204040

Reviewed by Keith Miller.

After r252298, LargeAllocation is also used for small allocations.
This patch renames from LargeAllocation to PreciseAllocation since it reflects the behavior.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • heap/CellContainer.cpp:

(JSC::CellContainer::isNewlyAllocated const):

  • heap/CellContainer.h:

(JSC::CellContainer::CellContainer):
(JSC::CellContainer::isMarkedBlock const):
(JSC::CellContainer::isPreciseAllocation const):
(JSC::CellContainer::preciseAllocation const):
(JSC::CellContainer::isLargeAllocation const): Deleted.
(JSC::CellContainer::largeAllocation const): Deleted.

  • heap/CellContainerInlines.h:

(JSC::CellContainer::vm const):
(JSC::CellContainer::isMarked const):
(JSC::CellContainer::noteMarked):
(JSC::CellContainer::assertValidCell const):
(JSC::CellContainer::cellSize const):
(JSC::CellContainer::weakSet const):
(JSC::CellContainer::aboutToMark):
(JSC::CellContainer::areMarksStale const):

  • heap/CompleteSubspace.cpp:

(JSC::CompleteSubspace::tryAllocateSlow):
(JSC::CompleteSubspace::reallocatePreciseAllocationNonVirtual):
(JSC::CompleteSubspace::reallocateLargeAllocationNonVirtual): Deleted.

  • heap/CompleteSubspace.h:
  • heap/Heap.cpp:

(JSC::Heap::sweepInFinalize):

  • heap/HeapCell.cpp:

(JSC::HeapCell::isLive):

  • heap/HeapCell.h:
  • heap/HeapCellInlines.h:

(JSC::HeapCell::isPreciseAllocation const):
(JSC::HeapCell::cellContainer const):
(JSC::HeapCell::preciseAllocation const):
(JSC::HeapCell::vm const):
(JSC::HeapCell::cellSize const):
(JSC::HeapCell::cellAttributes const):
(JSC::HeapCell::subspace const):
(JSC::HeapCell::isLargeAllocation const): Deleted.
(JSC::HeapCell::largeAllocation const): Deleted.

  • heap/HeapInlines.h:

(JSC::Heap::isMarked):
(JSC::Heap::testAndSetMarked):

  • heap/HeapUtil.h:

(JSC::HeapUtil::findGCObjectPointersForMarking):
(JSC::HeapUtil::isPointerGCObjectJSCell):
(JSC::HeapUtil::isValueGCObject):

  • heap/IsoAlignedMemoryAllocator.cpp:

(JSC::IsoAlignedMemoryAllocator::tryReallocateMemory):

  • heap/IsoCellSetInlines.h:

(JSC::IsoCellSet::add):
(JSC::IsoCellSet::remove):
(JSC::IsoCellSet::contains const):
(JSC::IsoCellSet::forEachMarkedCell):
(JSC::IsoCellSet::forEachMarkedCellInParallel):
(JSC::IsoCellSet::forEachLiveCell):

  • heap/IsoSubspace.cpp:

(JSC::IsoSubspace::tryAllocateFromLowerTier):
(JSC::IsoSubspace::sweepLowerTierCell):
(JSC::IsoSubspace::destroyLowerTierFreeList):

  • heap/IsoSubspace.h:
  • heap/MarkedSpace.cpp:

(JSC::MarkedSpace::freeMemory):
(JSC::MarkedSpace::lastChanceToFinalize):
(JSC::MarkedSpace::sweepPreciseAllocations):
(JSC::MarkedSpace::prepareForAllocation):
(JSC::MarkedSpace::enablePreciseAllocationTracking):
(JSC::MarkedSpace::prepareForConservativeScan):
(JSC::MarkedSpace::prepareForMarking):
(JSC::MarkedSpace::resumeAllocating):
(JSC::MarkedSpace::isPagedOut):
(JSC::MarkedSpace::beginMarking):
(JSC::MarkedSpace::endMarking):
(JSC::MarkedSpace::objectCount):
(JSC::MarkedSpace::size):
(JSC::MarkedSpace::sweepLargeAllocations): Deleted.
(JSC::MarkedSpace::enableLargeAllocationTracking): Deleted.

  • heap/MarkedSpace.h:

(JSC::MarkedSpace:: const):
(JSC::MarkedSpace::preciseAllocationsNurseryOffset const):
(JSC::MarkedSpace::preciseAllocationsOffsetForThisCollection const):
(JSC::MarkedSpace::preciseAllocationsForThisCollectionBegin const):
(JSC::MarkedSpace::preciseAllocationsForThisCollectionEnd const):
(JSC::MarkedSpace::preciseAllocationsForThisCollectionSize const):
(JSC::MarkedSpace::largeAllocationsNurseryOffset const): Deleted.
(JSC::MarkedSpace::largeAllocationsOffsetForThisCollection const): Deleted.
(JSC::MarkedSpace::largeAllocationsForThisCollectionBegin const): Deleted.
(JSC::MarkedSpace::largeAllocationsForThisCollectionEnd const): Deleted.
(JSC::MarkedSpace::largeAllocationsForThisCollectionSize const): Deleted.

  • heap/MarkedSpaceInlines.h:

(JSC::MarkedSpace::forEachLiveCell):
(JSC::MarkedSpace::forEachDeadCell):

  • heap/PreciseAllocation.cpp: Renamed from Source/JavaScriptCore/heap/LargeAllocation.cpp.

(JSC::isAlignedForPreciseAllocation):
(JSC::PreciseAllocation::tryCreate):
(JSC::PreciseAllocation::tryReallocate):
(JSC::PreciseAllocation::createForLowerTier):
(JSC::PreciseAllocation::reuseForLowerTier):
(JSC::PreciseAllocation::PreciseAllocation):
(JSC::PreciseAllocation::~PreciseAllocation):
(JSC::PreciseAllocation::lastChanceToFinalize):
(JSC::PreciseAllocation::shrink):
(JSC::PreciseAllocation::visitWeakSet):
(JSC::PreciseAllocation::reapWeakSet):
(JSC::PreciseAllocation::flip):
(JSC::PreciseAllocation::isEmpty):
(JSC::PreciseAllocation::sweep):
(JSC::PreciseAllocation::destroy):
(JSC::PreciseAllocation::dump const):
(JSC::PreciseAllocation::assertValidCell const):

  • heap/PreciseAllocation.h: Renamed from Source/JavaScriptCore/heap/LargeAllocation.h.

(JSC::PreciseAllocation::fromCell):
(JSC::PreciseAllocation::isPreciseAllocation):
(JSC::PreciseAllocation::headerSize):
(JSC::PreciseAllocation::basePointer const):

  • heap/SlotVisitor.cpp:

(JSC::SlotVisitor::appendHiddenSlowImpl):
(JSC::SlotVisitor::appendToMarkStack):

  • heap/SlotVisitorInlines.h:

(JSC::SlotVisitor::appendUnbarriered):
(JSC::SlotVisitor::appendHiddenUnbarriered):

  • heap/Subspace.h:
  • heap/SubspaceInlines.h:

(JSC::Subspace::forEachPreciseAllocation):
(JSC::Subspace::forEachMarkedCell):
(JSC::Subspace::forEachMarkedCellInParallel):
(JSC::Subspace::forEachLiveCell):
(JSC::Subspace::forEachLargeAllocation): Deleted.

  • heap/WeakBlock.cpp:

(JSC::WeakBlock::visit):

  • heap/WeakSet.cpp:

(JSC::WeakSet::sweep):

  • llint/LowLevelInterpreter.asm:
  • runtime/ButterflyInlines.h:

(JSC::Butterfly::reallocArrayRightIfPossible):

  • runtime/OptionsList.h:
  • runtime/SamplingProfiler.cpp:

(JSC::SamplingProfiler::SamplingProfiler):

  • tools/VMInspector.cpp:

(JSC::VMInspector::isInHeap):

  • tools/VMInspectorInlines.h:

(JSC::VMInspector::verifyCell):

Location:
trunk/Source/JavaScriptCore
Files:
34 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r252032 r252302  
    617617    heap/IsoSubspaceInlines.h
    618618    heap/IsoSubspacePerVM.h
    619     heap/LargeAllocation.h
    620619    heap/LocalAllocator.h
    621620    heap/LocalAllocatorInlines.h
     
    630629    heap/MutatorState.h
    631630    heap/PackedCellPtr.h
     631    heap/PreciseAllocation.h
    632632    heap/RegisterState.h
    633633    heap/RunningScope.h
  • trunk/Source/JavaScriptCore/ChangeLog

    r252298 r252302  
     12019-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
    11552019-11-08  Yusuke Suzuki  <ysuzuki@apple.com>
    2156
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r252032 r252302  
    135135                0F070A481D543A90006E7232 /* CellContainerInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F070A431D543A89006E7232 /* CellContainerInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
    136136                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, ); }; };
    138138                0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0776BD14FF002800102332 /* JITCompilationEffort.h */; settings = {ATTRIBUTES = (Private, ); }; };
    139139                0F0B286B1EB8E6CF000EB5D2 /* JSWeakPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B286A1EB8E6CD000EB5D2 /* JSWeakPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    22222222                0F070A431D543A89006E7232 /* CellContainerInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CellContainerInlines.h; sourceTree = "<group>"; };
    22232223                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>"; };
    22262226                0F0776BD14FF002800102332 /* JITCompilationEffort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITCompilationEffort.h; sourceTree = "<group>"; };
    22272227                0F0B28671EB8E6CD000EB5D2 /* JSMarkingConstraintPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMarkingConstraintPrivate.cpp; sourceTree = "<group>"; };
     
    62026202                                0F766D2915A8CC34008F363E /* JITStubRoutineSet.cpp */,
    62036203                                0F766D2A15A8CC34008F363E /* JITStubRoutineSet.h */,
    6204                                 0F070A451D543A89006E7232 /* LargeAllocation.cpp */,
    6205                                 0F070A461D543A89006E7232 /* LargeAllocation.h */,
    62066204                                0F75A059200D25F00038E2CF /* LocalAllocator.cpp */,
    62076205                                0F75A057200D25F00038E2CF /* LocalAllocator.h */,
     
    62336231                                E356987122841183008CDCCB /* PackedCellPtr.h */,
    62346232                                0F9DAA081FD1C3C80079C5B2 /* ParallelSourceAdapter.h */,
     6233                                0F070A451D543A89006E7232 /* PreciseAllocation.cpp */,
     6234                                0F070A461D543A89006E7232 /* PreciseAllocation.h */,
    62356235                                0FBB73B61DEF3AAC002C009E /* PreventCollectionScope.h */,
    62366236                                0FD0E5EF1E46BF230006AB08 /* RegisterState.h */,
     
    89318931                                3395C70722555F6D00BDBFAD /* B3EliminateDeadCode.h in Headers */,
    89328932                                0F5BF1711F23A5A10029D91D /* B3EnsureLoopPreHeaders.h in Headers */,
    8933                                 522927D5235FD0B9005CB169 /* GCMemoryOperations.h in Headers */,
    89348933                                5318045C22EAAC4B004A7342 /* B3ExtractValue.h in Headers */,
    89358934                                0F6971EA1D92F42400BA02A5 /* B3FenceValue.h in Headers */,
     
    94539452                                0F2B66AF17B6B54500A7AE3F /* GCIncomingRefCountedSetInlines.h in Headers */,
    94549453                                2AABCDE718EF294200002096 /* GCLogging.h in Headers */,
     9454                                522927D5235FD0B9005CB169 /* GCMemoryOperations.h in Headers */,
    94559455                                0F9715311EB28BEE00A1645D /* GCRequest.h in Headers */,
    94569456                                A54E8EB018BFFBBB00556D28 /* GCSegmentedArray.h in Headers */,
     
    98379837                                969A072A0ED1CE6900F1F681 /* Label.h in Headers */,
    98389838                                960097A60EBABB58007A7297 /* LabelScope.h in Headers */,
    9839                                 0F070A4B1D543A98006E7232 /* LargeAllocation.h in Headers */,
    98409839                                DCF3D56A1CD29470003D5C65 /* LazyClassStructure.h in Headers */,
    98419840                                DCF3D56B1CD29472003D5C65 /* LazyClassStructureInlines.h in Headers */,
     
    99659964                                0FE834181A6EF97B00D04847 /* PolymorphicCallStubRoutine.h in Headers */,
    99669965                                521131F71F82BF14007CCEEE /* PolyProtoAccessChain.h in Headers */,
     9966                                0F070A4B1D543A98006E7232 /* PreciseAllocation.h in Headers */,
    99679967                                0F98206116BFE38300240D02 /* PreciseJumpTargets.h in Headers */,
    99689968                                E3A421431D6F58930007C617 /* PreciseJumpTargetsInlines.h in Headers */,
  • trunk/Source/JavaScriptCore/Sources.txt

    r252032 r252302  
    525525heap/IsoSubspacePerVM.cpp
    526526heap/JITStubRoutineSet.cpp
    527 heap/LargeAllocation.cpp
     527heap/PreciseAllocation.cpp
    528528heap/LocalAllocator.cpp
    529529heap/MachineStackMarker.cpp
  • trunk/Source/JavaScriptCore/heap/CellContainer.cpp

    r227718 r252302  
    3333bool CellContainer::isNewlyAllocated(HeapCell* cell) const
    3434{
    35     if (isLargeAllocation())
    36         return largeAllocation().isNewlyAllocated();
     35    if (isPreciseAllocation())
     36        return preciseAllocation().isNewlyAllocated();
    3737    MarkedBlock& block = markedBlock();
    3838    return !block.isNewlyAllocatedStale()
  • trunk/Source/JavaScriptCore/heap/CellContainer.h

    r250005 r252302  
    3232class Heap;
    3333class HeapCell;
    34 class LargeAllocation;
     34class PreciseAllocation;
    3535class MarkedBlock;
    3636class WeakSet;
     
    3939typedef uint32_t HeapVersion;
    4040
    41 // This is how we abstract over either MarkedBlock& or LargeAllocation&. Put things in here as you
     41// This is how we abstract over either MarkedBlock& or PreciseAllocation&. Put things in here as you
    4242// find need for them.
    4343
     
    5454    }
    5555   
    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)
    5858    {
    5959    }
     
    6464    explicit operator bool() const { return !!m_encodedPointer; }
    6565   
    66     bool isMarkedBlock() const { return m_encodedPointer && !(m_encodedPointer & isLargeAllocationBit); }
    67     bool isLargeAllocation() const { return m_encodedPointer & isLargeAllocationBit; }
     66    bool isMarkedBlock() const { return m_encodedPointer && !(m_encodedPointer & isPreciseAllocationBit); }
     67    bool isPreciseAllocation() const { return m_encodedPointer & isPreciseAllocationBit; }
    6868   
    6969    MarkedBlock& markedBlock() const
     
    7373    }
    7474   
    75     LargeAllocation& largeAllocation() const
     75    PreciseAllocation& preciseAllocation() const
    7676    {
    77         ASSERT(isLargeAllocation());
    78         return *bitwise_cast<LargeAllocation*>(m_encodedPointer - isLargeAllocationBit);
     77        ASSERT(isPreciseAllocation());
     78        return *bitwise_cast<PreciseAllocation*>(m_encodedPointer - isPreciseAllocationBit);
    7979    }
    8080   
     
    9595   
    9696private:
    97     static constexpr uintptr_t isLargeAllocationBit = 1;
     97    static constexpr uintptr_t isPreciseAllocationBit = 1;
    9898    uintptr_t m_encodedPointer;
    9999};
  • trunk/Source/JavaScriptCore/heap/CellContainerInlines.h

    r249175 r252302  
    2828#include "CellContainer.h"
    2929#include "JSCast.h"
    30 #include "LargeAllocation.h"
    3130#include "MarkedBlock.h"
     31#include "PreciseAllocation.h"
    3232#include "VM.h"
    3333
     
    3636inline VM& CellContainer::vm() const
    3737{
    38     if (isLargeAllocation())
    39         return largeAllocation().vm();
     38    if (isPreciseAllocation())
     39        return preciseAllocation().vm();
    4040    return markedBlock().vm();
    4141}
     
    4848inline bool CellContainer::isMarked(HeapCell* cell) const
    4949{
    50     if (isLargeAllocation())
    51         return largeAllocation().isMarked();
     50    if (isPreciseAllocation())
     51        return preciseAllocation().isMarked();
    5252    return markedBlock().isMarked(cell);
    5353}
     
    5555inline bool CellContainer::isMarked(HeapVersion markingVersion, HeapCell* cell) const
    5656{
    57     if (isLargeAllocation())
    58         return largeAllocation().isMarked();
     57    if (isPreciseAllocation())
     58        return preciseAllocation().isMarked();
    5959    return markedBlock().isMarked(markingVersion, cell);
    6060}
     
    6262inline void CellContainer::noteMarked()
    6363{
    64     if (!isLargeAllocation())
     64    if (!isPreciseAllocation())
    6565        markedBlock().noteMarked();
    6666}
     
    6868inline void CellContainer::assertValidCell(VM& vm, HeapCell* cell) const
    6969{
    70     if (isLargeAllocation())
    71         largeAllocation().assertValidCell(vm, cell);
     70    if (isPreciseAllocation())
     71        preciseAllocation().assertValidCell(vm, cell);
    7272    else
    7373        markedBlock().assertValidCell(vm, cell);
     
    7676inline size_t CellContainer::cellSize() const
    7777{
    78     if (isLargeAllocation())
    79         return largeAllocation().cellSize();
     78    if (isPreciseAllocation())
     79        return preciseAllocation().cellSize();
    8080    return markedBlock().cellSize();
    8181}
     
    8383inline WeakSet& CellContainer::weakSet() const
    8484{
    85     if (isLargeAllocation())
    86         return largeAllocation().weakSet();
     85    if (isPreciseAllocation())
     86        return preciseAllocation().weakSet();
    8787    return markedBlock().weakSet();
    8888}
     
    9090inline void CellContainer::aboutToMark(HeapVersion markingVersion)
    9191{
    92     if (!isLargeAllocation())
     92    if (!isPreciseAllocation())
    9393        markedBlock().aboutToMark(markingVersion);
    9494}
     
    9696inline bool CellContainer::areMarksStale() const
    9797{
    98     if (isLargeAllocation())
     98    if (isPreciseAllocation())
    9999        return false;
    100100    return markedBlock().areMarksStale();
  • trunk/Source/JavaScriptCore/heap/CompleteSubspace.cpp

    r252298 r252302  
    130130        return allocator.allocate(deferralContext, AllocationFailureMode::ReturnNull);
    131131   
    132     if (size <= Options::largeAllocationCutoff()
     132    if (size <= Options::preciseAllocationCutoff()
    133133        && size <= MarkedSpace::largeCutoff) {
    134134        dataLog("FATAL: attampting to allocate small object using large allocation.\n");
     
    140140   
    141141    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());
    143143    if (!allocation)
    144144        return nullptr;
    145145   
    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())
    148148        set->add(allocation->cell());
    149     ASSERT(allocation->indexInSpace() == m_space.m_largeAllocations.size() - 1);
     149    ASSERT(allocation->indexInSpace() == m_space.m_preciseAllocations.size() - 1);
    150150    vm.heap.didAllocate(size);
    151151    m_space.m_capacity += size;
    152152   
    153     m_largeAllocations.append(allocation);
     153    m_preciseAllocations.append(allocation);
    154154       
    155155    return allocation->cell();
    156156}
    157157
    158 void* CompleteSubspace::reallocateLargeAllocationNonVirtual(VM& vm, HeapCell* oldCell, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
     158void* CompleteSubspace::reallocatePreciseAllocationNonVirtual(VM& vm, HeapCell* oldCell, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
    159159{
    160160    if (validateDFGDoesGC)
     
    162162
    163163    // The following conditions are met in Butterfly for example.
    164     ASSERT(oldCell->isLargeAllocation());
    165 
    166     LargeAllocation* oldAllocation = &oldCell->largeAllocation();
     164    ASSERT(oldCell->isPreciseAllocation());
     165
     166    PreciseAllocation* oldAllocation = &oldCell->preciseAllocation();
    167167    ASSERT(oldAllocation->cellSize() <= size);
    168168    ASSERT(oldAllocation->weakSet().isTriviallyDestructible());
     
    173173    sanitizeStackForVM(vm);
    174174
    175     if (size <= Options::largeAllocationCutoff()
     175    if (size <= Options::preciseAllocationCutoff()
    176176        && size <= MarkedSpace::largeCutoff) {
    177177        dataLog("FATAL: attampting to allocate small object using large allocation.\n");
     
    188188        oldAllocation->remove();
    189189
    190     LargeAllocation* allocation = oldAllocation->tryReallocate(size, this);
     190    PreciseAllocation* allocation = oldAllocation->tryReallocate(size, this);
    191191    if (!allocation) {
    192192        RELEASE_ASSERT(failureMode != AllocationFailureMode::Assert);
    193         m_largeAllocations.append(oldAllocation);
     193        m_preciseAllocations.append(oldAllocation);
    194194        return nullptr;
    195195    }
     
    198198    // If reallocation changes the address, we should update HashSet.
    199199    if (oldAllocation != allocation) {
    200         if (auto* set = m_space.largeAllocationSet()) {
     200        if (auto* set = m_space.preciseAllocationSet()) {
    201201            set->remove(oldAllocation->cell());
    202202            set->add(allocation->cell());
     
    204204    }
    205205
    206     m_space.m_largeAllocations[oldIndexInSpace] = allocation;
     206    m_space.m_preciseAllocations[oldIndexInSpace] = allocation;
    207207    vm.heap.didAllocate(difference);
    208208    m_space.m_capacity += difference;
    209209
    210     m_largeAllocations.append(allocation);
     210    m_preciseAllocations.append(allocation);
    211211
    212212    return allocation->cell();
  • trunk/Source/JavaScriptCore/heap/CompleteSubspace.h

    r243688 r252302  
    4545    void* allocate(VM&, size_t, GCDeferralContext*, AllocationFailureMode) override;
    4646    void* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode);
    47     void* reallocateLargeAllocationNonVirtual(VM&, HeapCell*, size_t, GCDeferralContext*, AllocationFailureMode);
     47    void* reallocatePreciseAllocationNonVirtual(VM&, HeapCell*, size_t, GCDeferralContext*, AllocationFailureMode);
    4848   
    4949    static ptrdiff_t offsetOfAllocatorForSizeStep() { return OBJECT_OFFSETOF(CompleteSubspace, m_allocatorForSizeStep); }
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r252298 r252302  
    21542154void Heap::sweepInFinalize()
    21552155{
    2156     m_objectSpace.sweepLargeAllocations();
     2156    m_objectSpace.sweepPreciseAllocations();
    21572157    vm().eagerlySweptDestructibleObjectSpace.sweep();
    21582158}
  • trunk/Source/JavaScriptCore/heap/HeapCell.cpp

    r236450 r252302  
    3535bool HeapCell::isLive()
    3636{
    37     if (isLargeAllocation())
    38         return largeAllocation().isLive();
     37    if (isPreciseAllocation())
     38        return preciseAllocation().isLive();
    3939    auto& markedBlockHandle = markedBlock().handle();
    4040    if (markedBlockHandle.isFreeListed())
  • trunk/Source/JavaScriptCore/heap/HeapCell.h

    r251425 r252302  
    3232class CellContainer;
    3333class Heap;
    34 class LargeAllocation;
     34class PreciseAllocation;
    3535class MarkedBlock;
    3636class Subspace;
     
    6262    bool isLive();
    6363
    64     bool isLargeAllocation() const;
     64    bool isPreciseAllocation() const;
    6565    CellContainer cellContainer() const;
    6666    MarkedBlock& markedBlock() const;
    67     LargeAllocation& largeAllocation() const;
     67    PreciseAllocation& preciseAllocation() const;
    6868
    6969    // If you want performance and you know that your cell is small, you can do this instead:
    70     // ASSERT(!cell->isLargeAllocation());
     70    // ASSERT(!cell->isPreciseAllocation());
    7171    // cell->markedBlock().vm()
    7272    // We currently only use this hack for callees to make CallFrame::vm() fast. It's not
  • trunk/Source/JavaScriptCore/heap/HeapCellInlines.h

    r249175 r252302  
    2828#include "CellContainer.h"
    2929#include "HeapCell.h"
    30 #include "LargeAllocation.h"
     30#include "PreciseAllocation.h"
    3131#include "VM.h"
    3232
    3333namespace JSC {
    3434
    35 ALWAYS_INLINE bool HeapCell::isLargeAllocation() const
     35ALWAYS_INLINE bool HeapCell::isPreciseAllocation() const
    3636{
    37     return LargeAllocation::isLargeAllocation(const_cast<HeapCell*>(this));
     37    return PreciseAllocation::isPreciseAllocation(const_cast<HeapCell*>(this));
    3838}
    3939
    4040ALWAYS_INLINE CellContainer HeapCell::cellContainer() const
    4141{
    42     if (isLargeAllocation())
    43         return largeAllocation();
     42    if (isPreciseAllocation())
     43        return preciseAllocation();
    4444    return markedBlock();
    4545}
     
    5050}
    5151
    52 ALWAYS_INLINE LargeAllocation& HeapCell::largeAllocation() const
     52ALWAYS_INLINE PreciseAllocation& HeapCell::preciseAllocation() const
    5353{
    54     return *LargeAllocation::fromCell(const_cast<HeapCell*>(this));
     54    return *PreciseAllocation::fromCell(const_cast<HeapCell*>(this));
    5555}
    5656
     
    6262ALWAYS_INLINE VM& HeapCell::vm() const
    6363{
    64     if (isLargeAllocation())
    65         return largeAllocation().vm();
     64    if (isPreciseAllocation())
     65        return preciseAllocation().vm();
    6666    return markedBlock().vm();
    6767}
     
    6969ALWAYS_INLINE size_t HeapCell::cellSize() const
    7070{
    71     if (isLargeAllocation())
    72         return largeAllocation().cellSize();
     71    if (isPreciseAllocation())
     72        return preciseAllocation().cellSize();
    7373    return markedBlock().cellSize();
    7474}
     
    7676ALWAYS_INLINE CellAttributes HeapCell::cellAttributes() const
    7777{
    78     if (isLargeAllocation())
    79         return largeAllocation().attributes();
     78    if (isPreciseAllocation())
     79        return preciseAllocation().attributes();
    8080    return markedBlock().attributes();
    8181}
     
    9393ALWAYS_INLINE Subspace* HeapCell::subspace() const
    9494{
    95     if (isLargeAllocation())
    96         return largeAllocation().subspace();
     95    if (isPreciseAllocation())
     96        return preciseAllocation().subspace();
    9797    return markedBlock().subspace();
    9898}
  • trunk/Source/JavaScriptCore/heap/HeapInlines.h

    r249175 r252302  
    7171{
    7272    HeapCell* cell = bitwise_cast<HeapCell*>(rawCell);
    73     if (cell->isLargeAllocation())
    74         return cell->largeAllocation().isMarked();
     73    if (cell->isPreciseAllocation())
     74        return cell->preciseAllocation().isMarked();
    7575    MarkedBlock& block = cell->markedBlock();
    7676    return block.isMarked(m_objectSpace.markingVersion(), cell);
     
    8080{
    8181    HeapCell* cell = bitwise_cast<HeapCell*>(rawCell);
    82     if (cell->isLargeAllocation())
    83         return cell->largeAllocation().testAndSetMarked();
     82    if (cell->isPreciseAllocation())
     83        return cell->preciseAllocation().testAndSetMarked();
    8484    MarkedBlock& block = cell->markedBlock();
    8585    Dependency dependency = block.aboutToMark(markingVersion);
  • trunk/Source/JavaScriptCore/heap/HeapUtil.h

    r252298 r252302  
    5858       
    5959        // 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; });
    6868                if (result) {
    69                     auto attemptLarge = [&] (LargeAllocation* allocation) {
     69                    auto attemptLarge = [&] (PreciseAllocation* allocation) {
    7070                        if (allocation->contains(pointer))
    7171                            func(allocation->cell(), allocation->attributes().cellKind);
    7272                    };
    7373                   
    74                     if (result > heap.objectSpace().largeAllocationsForThisCollectionBegin())
     74                    if (result > heap.objectSpace().preciseAllocationsForThisCollectionBegin())
    7575                        attemptLarge(result[-1]);
    7676                    attemptLarge(result[0]);
    77                     if (result + 1 < heap.objectSpace().largeAllocationsForThisCollectionEnd())
     77                    if (result + 1 < heap.objectSpace().preciseAllocationsForThisCollectionEnd())
    7878                        attemptLarge(result[1]);
    7979                }
     
    132132    {
    133133        // It could point to a large allocation.
    134         if (pointer->isLargeAllocation()) {
    135             auto* set = heap.objectSpace().largeAllocationSet();
     134        if (pointer->isPreciseAllocation()) {
     135            auto* set = heap.objectSpace().preciseAllocationSet();
    136136            ASSERT(set);
    137137            if (set->isEmpty())
     
    167167        Heap& heap, TinyBloomFilter filter, JSValue value)
    168168    {
    169         ASSERT(heap.objectSpace().largeAllocationSet());
     169        ASSERT(heap.objectSpace().preciseAllocationSet());
    170170        if (!value.isCell())
    171171            return false;
  • trunk/Source/JavaScriptCore/heap/IsoAlignedMemoryAllocator.cpp

    r252298 r252302  
    102102void* IsoAlignedMemoryAllocator::tryReallocateMemory(void*, size_t)
    103103{
    104     // In IsoSubspace-managed LargeAllocation, we must not perform realloc.
     104    // In IsoSubspace-managed PreciseAllocation, we must not perform realloc.
    105105    RELEASE_ASSERT_NOT_REACHED();
    106106}
  • trunk/Source/JavaScriptCore/heap/IsoCellSetInlines.h

    r252298 r252302  
    3434inline bool IsoCellSet::add(HeapCell* cell)
    3535{
    36     if (cell->isLargeAllocation())
    37         return !m_lowerTierBits.concurrentTestAndSet(cell->largeAllocation().lowerTierIndex());
     36    if (cell->isPreciseAllocation())
     37        return !m_lowerTierBits.concurrentTestAndSet(cell->preciseAllocation().lowerTierIndex());
    3838    AtomIndices atomIndices(cell);
    3939    auto& bitsPtrRef = m_bits[atomIndices.blockIndex];
     
    4646inline bool IsoCellSet::remove(HeapCell* cell)
    4747{
    48     if (cell->isLargeAllocation())
    49         return !m_lowerTierBits.concurrentTestAndClear(cell->largeAllocation().lowerTierIndex());
     48    if (cell->isPreciseAllocation())
     49        return !m_lowerTierBits.concurrentTestAndClear(cell->preciseAllocation().lowerTierIndex());
    5050    AtomIndices atomIndices(cell);
    5151    auto& bitsPtrRef = m_bits[atomIndices.blockIndex];
     
    5858inline bool IsoCellSet::contains(HeapCell* cell) const
    5959{
    60     if (cell->isLargeAllocation())
    61         return !m_lowerTierBits.get(cell->largeAllocation().lowerTierIndex());
     60    if (cell->isPreciseAllocation())
     61        return !m_lowerTierBits.get(cell->preciseAllocation().lowerTierIndex());
    6262    AtomIndices atomIndices(cell);
    6363    auto* bits = m_bits[atomIndices.blockIndex].get();
     
    8585
    8686    CellAttributes attributes = m_subspace.attributes();
    87     m_subspace.forEachLargeAllocation(
    88         [&] (LargeAllocation* allocation) {
     87    m_subspace.forEachPreciseAllocation(
     88        [&] (PreciseAllocation* allocation) {
    8989            if (m_lowerTierBits.get(allocation->lowerTierIndex()) && allocation->isMarked())
    9090                func(allocation->cell(), attributes.cellKind);
     
    119119            {
    120120                auto locker = holdLock(m_lock);
    121                 if (!m_needToVisitLargeAllocations)
     121                if (!m_needToVisitPreciseAllocations)
    122122                    return;
    123                 m_needToVisitLargeAllocations = false;
     123                m_needToVisitPreciseAllocations = false;
    124124            }
    125125
    126126            CellAttributes attributes = m_set.m_subspace.attributes();
    127             m_set.m_subspace.forEachLargeAllocation(
    128                 [&] (LargeAllocation* allocation) {
     127            m_set.m_subspace.forEachPreciseAllocation(
     128                [&] (PreciseAllocation* allocation) {
    129129                    if (m_set.m_lowerTierBits.get(allocation->lowerTierIndex()) && allocation->isMarked())
    130130                        m_func(visitor, allocation->cell(), attributes.cellKind);
     
    137137        Func m_func;
    138138        Lock m_lock;
    139         bool m_needToVisitLargeAllocations { true };
     139        bool m_needToVisitPreciseAllocations { true };
    140140    };
    141141   
     
    161161
    162162    CellAttributes attributes = m_subspace.attributes();
    163     m_subspace.forEachLargeAllocation(
    164         [&] (LargeAllocation* allocation) {
     163    m_subspace.forEachPreciseAllocation(
     164        [&] (PreciseAllocation* allocation) {
    165165            if (m_lowerTierBits.get(allocation->lowerTierIndex()) && allocation->isLive())
    166166                func(allocation->cell(), attributes.cellKind);
  • trunk/Source/JavaScriptCore/heap/IsoSubspace.cpp

    r252298 r252302  
    9393void* IsoSubspace::tryAllocateFromLowerTier()
    9494{
    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());
    9797        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())
    100100            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);
    103103        return allocation->cell();
    104104    };
    105105
    106106    if (!m_lowerTierFreeList.isEmpty()) {
    107         LargeAllocation* allocation = m_lowerTierFreeList.begin();
     107        PreciseAllocation* allocation = m_lowerTierFreeList.begin();
    108108        allocation->remove();
    109109        return revive(allocation);
     
    111111    if (m_lowerTierCellCount != MarkedBlock::numberOfLowerTierCells) {
    112112        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++);
    114114        return revive(allocation);
    115115    }
     
    117117}
    118118
    119 void IsoSubspace::sweepLowerTierCell(LargeAllocation* largeAllocation)
     119void IsoSubspace::sweepLowerTierCell(PreciseAllocation* preciseAllocation)
    120120{
    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);
    124124    m_cellSets.forEach(
    125125        [&] (IsoCellSet* set) {
     
    130130void IsoSubspace::destroyLowerTierFreeList()
    131131{
    132     m_lowerTierFreeList.forEach([&](LargeAllocation* allocation) {
     132    m_lowerTierFreeList.forEach([&](PreciseAllocation* allocation) {
    133133        allocation->destroy();
    134134    });
  • trunk/Source/JavaScriptCore/heap/IsoSubspace.h

    r252298 r252302  
    4949    void* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode);
    5050
    51     void sweepLowerTierCell(LargeAllocation*);
     51    void sweepLowerTierCell(PreciseAllocation*);
    5252
    5353    void* tryAllocateFromLowerTier();
     
    6565    LocalAllocator m_localAllocator;
    6666    std::unique_ptr<IsoAlignedMemoryAllocator> m_isoAlignedMemoryAllocator;
    67     SentinelLinkedList<LargeAllocation, PackedRawSentinelNode<LargeAllocation>> m_lowerTierFreeList;
     67    SentinelLinkedList<PreciseAllocation, PackedRawSentinelNode<PreciseAllocation>> m_lowerTierFreeList;
    6868    SentinelLinkedList<IsoCellSet, PackedRawSentinelNode<IsoCellSet>> m_cellSets;
    6969    uint8_t m_lowerTierCellCount { 0 };
  • trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp

    r252298 r252302  
    131131                // This is usually how we get out of the loop.
    132132                if (betterSizeClass > MarkedSpace::largeCutoff
    133                     || betterSizeClass > Options::largeAllocationCutoff())
     133                    || betterSizeClass > Options::preciseAllocationCutoff())
    134134                    break;
    135135               
     
    212212            freeBlock(block);
    213213        });
    214     for (LargeAllocation* allocation : m_largeAllocations)
     214    for (PreciseAllocation* allocation : m_preciseAllocations)
    215215        allocation->destroy();
    216216    forEachSubspace([&](Subspace& subspace) {
     
    228228            return IterationStatus::Continue;
    229229        });
    230     for (LargeAllocation* allocation : m_largeAllocations)
     230    for (PreciseAllocation* allocation : m_preciseAllocations)
    231231        allocation->lastChanceToFinalize();
    232232    // We do not call lastChanceToFinalize for lower-tier swept cells since we need nothing to do.
     
    243243}
    244244
    245 void MarkedSpace::sweepLargeAllocations()
    246 {
    247     RELEASE_ASSERT(m_largeAllocationsNurseryOffset == m_largeAllocations.size());
    248     unsigned srcIndex = m_largeAllocationsNurseryOffsetForSweep;
     245void MarkedSpace::sweepPreciseAllocations()
     246{
     247    RELEASE_ASSERT(m_preciseAllocationsNurseryOffset == m_preciseAllocations.size());
     248    unsigned srcIndex = m_preciseAllocationsNurseryOffsetForSweep;
    249249    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++];
    252252        allocation->sweep();
    253253        if (allocation->isEmpty()) {
    254             if (auto* set = largeAllocationSet())
     254            if (auto* set = preciseAllocationSet())
    255255                set->remove(allocation->cell());
    256256            if (allocation->isLowerTier())
     
    263263        }
    264264        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();
    269269}
    270270
     
    278278   
    279279    if (m_heap->collectionScope() == CollectionScope::Eden)
    280         m_largeAllocationsNurseryOffsetForSweep = m_largeAllocationsNurseryOffset;
     280        m_preciseAllocationsNurseryOffsetForSweep = m_preciseAllocationsNurseryOffset;
    281281    else
    282         m_largeAllocationsNurseryOffsetForSweep = 0;
    283     m_largeAllocationsNurseryOffset = m_largeAllocations.size();
    284 }
    285 
    286 void MarkedSpace::enableLargeAllocationTracking()
    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
     286void MarkedSpace::enablePreciseAllocationTracking()
     287{
     288    m_preciseAllocationSet = makeUnique<HashSet<HeapCell*>>();
     289    for (auto* allocation : m_preciseAllocations)
     290        m_preciseAllocationSet->add(allocation->cell());
    291291}
    292292
     
    337337void MarkedSpace::prepareForConservativeScan()
    338338{
    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);
    343343   
    344344    std::sort(
    345         m_largeAllocationsForThisCollectionBegin, m_largeAllocationsForThisCollectionEnd,
    346         [&] (LargeAllocation* a, LargeAllocation* b) {
     345        m_preciseAllocationsForThisCollectionBegin, m_preciseAllocationsForThisCollectionEnd,
     346        [&] (PreciseAllocation* a, PreciseAllocation* b) {
    347347            return a < b;
    348348        });
    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) {
    351351        (*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);
    354354    }
    355355}
     
    358358{
    359359    if (m_heap->collectionScope() == CollectionScope::Eden)
    360         m_largeAllocationsOffsetForThisCollection = m_largeAllocationsNurseryOffset;
     360        m_preciseAllocationsOffsetForThisCollection = m_preciseAllocationsNurseryOffset;
    361361    else
    362         m_largeAllocationsOffsetForThisCollection = 0;
     362        m_preciseAllocationsOffsetForThisCollection = 0;
    363363}
    364364
     
    370370            return IterationStatus::Continue;
    371371        });
    372     // Nothing to do for LargeAllocations.
     372    // Nothing to do for PreciseAllocations.
    373373}
    374374
     
    384384            return IterationStatus::Continue;
    385385        });
    386     // FIXME: Consider taking LargeAllocations into account here.
     386    // FIXME: Consider taking PreciseAllocations into account here.
    387387    return result;
    388388}
     
    433433        m_markingVersion = nextVersion(m_markingVersion);
    434434       
    435         for (LargeAllocation* allocation : m_largeAllocations)
     435        for (PreciseAllocation* allocation : m_preciseAllocations)
    436436            allocation->flip();
    437437    }
     
    460460    m_newlyAllocatedVersion = nextVersion(m_newlyAllocatedVersion);
    461461   
    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();
    464464
    465465    if (!ASSERT_DISABLED) {
    466         for (LargeAllocation* allocation : m_largeAllocations)
     466        for (PreciseAllocation* allocation : m_preciseAllocations)
    467467            ASSERT_UNUSED(allocation, !allocation->isNewlyAllocated());
    468468    }
     
    498498            result += block->markCount();
    499499        });
    500     for (LargeAllocation* allocation : m_largeAllocations) {
     500    for (PreciseAllocation* allocation : m_preciseAllocations) {
    501501        if (allocation->isMarked())
    502502            result++;
     
    512512            result += block->markCount() * block->cellSize();
    513513        });
    514     for (LargeAllocation* allocation : m_largeAllocations) {
     514    for (PreciseAllocation* allocation : m_preciseAllocations) {
    515515        if (allocation->isMarked())
    516516            result += allocation->cellSize();
  • trunk/Source/JavaScriptCore/heap/MarkedSpace.h

    r252298 r252302  
    2424#include "BlockDirectory.h"
    2525#include "IterationStatus.h"
    26 #include "LargeAllocation.h"
    2726#include "MarkedBlock.h"
    2827#include "MarkedBlockSet.h"
     28#include "PreciseAllocation.h"
    2929#include <array>
    3030#include <wtf/Bag.h>
     
    142142    void clearNewlyAllocated();
    143143    void sweep();
    144     void sweepLargeAllocations();
     144    void sweepPreciseAllocations();
    145145    void assertNoUnswept();
    146146    size_t objectCount();
     
    153153    HeapVersion newlyAllocatedVersion() const { return m_newlyAllocatedVersion; }
    154154
    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 enableLargeAllocationTracking();
     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();
    161161   
    162162    // These are cached pointers and offsets for quickly searching the large allocations that are
    163163    // 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; }
    167167   
    168168    BlockDirectory* firstDirectory() const { return m_directories.first(); }
     
    205205    Vector<Subspace*> m_subspaces;
    206206
    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 };
    215215
    216216    Heap* m_heap;
  • trunk/Source/JavaScriptCore/heap/MarkedSpaceInlines.h

    r226822 r252302  
    4848            return;
    4949    }
    50     for (LargeAllocation* allocation : m_largeAllocations) {
     50    for (PreciseAllocation* allocation : m_preciseAllocations) {
    5151        if (allocation->isLive()) {
    5252            if (functor(allocation->cell(), allocation->attributes().cellKind) == IterationStatus::Done)
     
    6464            return;
    6565    }
    66     for (LargeAllocation* allocation : m_largeAllocations) {
     66    for (PreciseAllocation* allocation : m_preciseAllocations) {
    6767        if (!allocation->isLive()) {
    6868            if (functor(allocation->cell(), allocation->attributes().cellKind) == IterationStatus::Done)
  • trunk/Source/JavaScriptCore/heap/PreciseAllocation.cpp

    r252301 r252302  
    2525
    2626#include "config.h"
    27 #include "LargeAllocation.h"
     27#include "PreciseAllocation.h"
    2828
    2929#include "AlignedMemoryAllocator.h"
     
    3535namespace JSC {
    3636
    37 static inline bool isAlignedForLargeAllocation(void* memory)
     37static inline bool isAlignedForPreciseAllocation(void* memory)
    3838{
    3939    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
     43PreciseAllocation* PreciseAllocation::tryCreate(Heap& heap, size_t size, Subspace* subspace, unsigned indexInSpace)
    4444{
    4545    if (validateDFGDoesGC)
     
    5555
    5656    bool adjustedAlignment = false;
    57     if (!isAlignedForLargeAllocation(space)) {
     57    if (!isAlignedForPreciseAllocation(space)) {
    5858        space = bitwise_cast<void*>(bitwise_cast<uintptr_t>(space) + halfAlignment);
    5959        adjustedAlignment = true;
    60         ASSERT(isAlignedForLargeAllocation(space));
     60        ASSERT(isAlignedForPreciseAllocation(space));
    6161    }
    6262   
    6363    if (scribbleFreeCells())
    6464        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
     68PreciseAllocation* PreciseAllocation::tryReallocate(size_t size, Subspace* subspace)
    6969{
    7070    ASSERT(!isLowerTier());
     
    8282        return nullptr;
    8383
    84     LargeAllocation* newAllocation = bitwise_cast<LargeAllocation*>(newBasePointer);
     84    PreciseAllocation* newAllocation = bitwise_cast<PreciseAllocation*>(newBasePointer);
    8585    bool newAdjustedAlignment = false;
    86     if (!isAlignedForLargeAllocation(newBasePointer)) {
     86    if (!isAlignedForPreciseAllocation(newBasePointer)) {
    8787        newAdjustedAlignment = true;
    88         newAllocation = bitwise_cast<LargeAllocation*>(bitwise_cast<uintptr_t>(newBasePointer) + halfAlignment);
    89         ASSERT(isAlignedForLargeAllocation(static_cast<void*>(newAllocation)));
     88        newAllocation = bitwise_cast<PreciseAllocation*>(bitwise_cast<uintptr_t>(newBasePointer) + halfAlignment);
     89        ASSERT(isAlignedForPreciseAllocation(static_cast<void*>(newAllocation)));
    9090    }
    9191
     
    103103            // Now   [   ][  content  ]
    104104            // New   [  content  ]...
    105             memmove(newBasePointer, bitwise_cast<char*>(newBasePointer) + halfAlignment, oldCellSize + LargeAllocation::headerSize());
     105            memmove(newBasePointer, bitwise_cast<char*>(newBasePointer) + halfAlignment, oldCellSize + PreciseAllocation::headerSize());
    106106        } else {
    107107            ASSERT(newAdjustedAlignment);
     
    111111            // Now   [  content  ][   ]
    112112            // 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());
    114114        }
    115115    }
     
    121121
    122122
    123 LargeAllocation* LargeAllocation::createForLowerTier(Heap& heap, size_t size, Subspace* subspace, uint8_t lowerTierIndex)
     123PreciseAllocation* PreciseAllocation::createForLowerTier(Heap& heap, size_t size, Subspace* subspace, uint8_t lowerTierIndex)
    124124{
    125125    if (validateDFGDoesGC)
     
    133133
    134134    bool adjustedAlignment = false;
    135     if (!isAlignedForLargeAllocation(space)) {
     135    if (!isAlignedForPreciseAllocation(space)) {
    136136        space = bitwise_cast<void*>(bitwise_cast<uintptr_t>(space) + halfAlignment);
    137137        adjustedAlignment = true;
    138         ASSERT(isAlignedForLargeAllocation(space));
     138        ASSERT(isAlignedForPreciseAllocation(space));
    139139    }
    140140
    141141    if (scribbleFreeCells())
    142142        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
     148PreciseAllocation* PreciseAllocation::reuseForLowerTier()
    149149{
    150150    Heap& heap = *this->heap();
     
    155155
    156156    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
     165PreciseAllocation::PreciseAllocation(Heap& heap, size_t size, Subspace* subspace, unsigned indexInSpace, bool adjustedAlignment)
    166166    : m_indexInSpace(indexInSpace)
    167167    , m_cellSize(size)
     
    176176}
    177177
    178 LargeAllocation::~LargeAllocation()
     178PreciseAllocation::~PreciseAllocation()
    179179{
    180180    if (isOnList())
     
    182182}
    183183
    184 void LargeAllocation::lastChanceToFinalize()
     184void PreciseAllocation::lastChanceToFinalize()
    185185{
    186186    m_weakSet.lastChanceToFinalize();
     
    190190}
    191191
    192 void LargeAllocation::shrink()
     192void PreciseAllocation::shrink()
    193193{
    194194    m_weakSet.shrink();
    195195}
    196196
    197 void LargeAllocation::visitWeakSet(SlotVisitor& visitor)
     197void PreciseAllocation::visitWeakSet(SlotVisitor& visitor)
    198198{
    199199    m_weakSet.visit(visitor);
    200200}
    201201
    202 void LargeAllocation::reapWeakSet()
     202void PreciseAllocation::reapWeakSet()
    203203{
    204204    return m_weakSet.reap();
    205205}
    206206
    207 void LargeAllocation::flip()
     207void PreciseAllocation::flip()
    208208{
    209209    ASSERT(heap()->collectionScope() == CollectionScope::Full);
     
    211211}
    212212
    213 bool LargeAllocation::isEmpty()
     213bool PreciseAllocation::isEmpty()
    214214{
    215215    return !isMarked() && m_weakSet.isEmpty() && !isNewlyAllocated();
    216216}
    217217
    218 void LargeAllocation::sweep()
     218void PreciseAllocation::sweep()
    219219{
    220220    m_weakSet.sweep();
     
    227227}
    228228
    229 void LargeAllocation::destroy()
     229void PreciseAllocation::destroy()
    230230{
    231231    AlignedMemoryAllocator* allocator = m_subspace->alignedMemoryAllocator();
    232232    void* basePointer = this->basePointer();
    233     this->~LargeAllocation();
     233    this->~PreciseAllocation();
    234234    allocator->freeMemory(basePointer);
    235235}
    236236
    237 void LargeAllocation::dump(PrintStream& out) const
     237void PreciseAllocation::dump(PrintStream& out) const
    238238{
    239239    out.print(RawPointer(this), ":(cell at ", RawPointer(cell()), " with size ", m_cellSize, " and attributes ", m_attributes, ")");
     
    241241
    242242#if !ASSERT_DISABLED
    243 void LargeAllocation::assertValidCell(VM& vm, HeapCell* cell) const
     243void PreciseAllocation::assertValidCell(VM& vm, HeapCell* cell) const
    244244{
    245245    ASSERT(&vm == &this->vm());
  • trunk/Source/JavaScriptCore/heap/PreciseAllocation.h

    r252301 r252302  
    3535
    3636// 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 large
    38 // objects directly using malloc, and put the LargeAllocation header just before them. We can detect
    39 // 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.
    4040
    41 class LargeAllocation : public PackedRawSentinelNode<LargeAllocation> {
     41class PreciseAllocation : public PackedRawSentinelNode<PreciseAllocation> {
    4242public:
    4343    friend class LLIntOffsetsExtractor;
    4444    friend class IsoSubspace;
    4545
    46     static LargeAllocation* tryCreate(Heap&, size_t, Subspace*, unsigned indexInSpace);
     46    static PreciseAllocation* tryCreate(Heap&, size_t, Subspace*, unsigned indexInSpace);
    4747
    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();
    5050
    51     LargeAllocation* tryReallocate(size_t, Subspace*);
     51    PreciseAllocation* tryReallocate(size_t, Subspace*);
    5252   
    53     ~LargeAllocation();
     53    ~PreciseAllocation();
    5454   
    55     static LargeAllocation* fromCell(const void* cell)
     55    static PreciseAllocation* fromCell(const void* cell)
    5656    {
    57         return bitwise_cast<LargeAllocation*>(bitwise_cast<char*>(cell) - headerSize());
     57        return bitwise_cast<PreciseAllocation*>(bitwise_cast<char*>(cell) - headerSize());
    5858    }
    5959   
     
    6363    }
    6464   
    65     static bool isLargeAllocation(HeapCell* cell)
     65    static bool isPreciseAllocation(HeapCell* cell)
    6666    {
    6767        return bitwise_cast<uintptr_t>(cell) & halfAlignment;
     
    159159    static constexpr unsigned alignment = MarkedBlock::atomSize;
    160160    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; }
    162162
    163163private:
    164     LargeAllocation(Heap&, size_t, Subspace*, unsigned indexInSpace, bool adjustedAlignment);
     164    PreciseAllocation(Heap&, size_t, Subspace*, unsigned indexInSpace, bool adjustedAlignment);
    165165   
    166166    void* basePointer() const;
     
    178178};
    179179
    180 inline void* LargeAllocation::basePointer() const
     180inline void* PreciseAllocation::basePointer() const
    181181{
    182182    if (m_adjustedAlignment)
  • trunk/Source/JavaScriptCore/heap/SlotVisitor.cpp

    r250285 r252302  
    258258#endif
    259259   
    260     if (cell->isLargeAllocation())
    261         setMarkedAndAppendToMarkStack(cell->largeAllocation(), cell, dependency);
     260    if (cell->isPreciseAllocation())
     261        setMarkedAndAppendToMarkStack(cell->preciseAllocation(), cell, dependency);
    262262    else
    263263        setMarkedAndAppendToMarkStack(cell->markedBlock(), cell, dependency);
     
    282282void SlotVisitor::appendToMarkStack(JSCell* cell)
    283283{
    284     if (cell->isLargeAllocation())
    285         appendToMarkStack(cell->largeAllocation(), cell);
     284    if (cell->isPreciseAllocation())
     285        appendToMarkStack(cell->preciseAllocation(), cell);
    286286    else
    287287        appendToMarkStack(cell->markedBlock(), cell);
  • trunk/Source/JavaScriptCore/heap/SlotVisitorInlines.h

    r249175 r252302  
    4747   
    4848    Dependency dependency;
    49     if (UNLIKELY(cell->isLargeAllocation())) {
    50         if (LIKELY(cell->largeAllocation().isMarked())) {
     49    if (UNLIKELY(cell->isPreciseAllocation())) {
     50        if (LIKELY(cell->preciseAllocation().isMarked())) {
    5151            if (LIKELY(!m_heapAnalyzer))
    5252                return;
     
    8585   
    8686    Dependency dependency;
    87     if (UNLIKELY(cell->isLargeAllocation())) {
    88         if (LIKELY(cell->largeAllocation().isMarked()))
     87    if (UNLIKELY(cell->isPreciseAllocation())) {
     88        if (LIKELY(cell->preciseAllocation().isMarked()))
    8989            return;
    9090    } else {
  • trunk/Source/JavaScriptCore/heap/Subspace.h

    r252298 r252302  
    8282   
    8383    template<typename Func>
    84     void forEachLargeAllocation(const Func&);
     84    void forEachPreciseAllocation(const Func&);
    8585   
    8686    template<typename Func>
     
    114114    BlockDirectory* m_firstDirectory { nullptr };
    115115    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;
    117117    Subspace* m_nextSubspaceInAlignedMemoryAllocator { nullptr };
    118118
  • trunk/Source/JavaScriptCore/heap/SubspaceInlines.h

    r240216 r252302  
    6161
    6262template<typename Func>
    63 void Subspace::forEachLargeAllocation(const Func& func)
     63void Subspace::forEachPreciseAllocation(const Func& func)
    6464{
    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())
    6666        func(allocation);
    6767}
     
    7979        });
    8080    CellAttributes attributes = this->attributes();
    81     forEachLargeAllocation(
    82         [&] (LargeAllocation* allocation) {
     81    forEachPreciseAllocation(
     82        [&] (PreciseAllocation* allocation) {
    8383            if (allocation->isMarked())
    8484                func(allocation->cell(), attributes.cellKind);
     
    110110            {
    111111                auto locker = holdLock(m_lock);
    112                 if (!m_needToVisitLargeAllocations)
     112                if (!m_needToVisitPreciseAllocations)
    113113                    return;
    114                 m_needToVisitLargeAllocations = false;
     114                m_needToVisitPreciseAllocations = false;
    115115            }
    116116           
    117117            CellAttributes attributes = m_subspace.attributes();
    118             m_subspace.forEachLargeAllocation(
    119                 [&] (LargeAllocation* allocation) {
     118            m_subspace.forEachPreciseAllocation(
     119                [&] (PreciseAllocation* allocation) {
    120120                    if (allocation->isMarked())
    121121                        m_func(visitor, allocation->cell(), attributes.cellKind);
     
    128128        Func m_func;
    129129        Lock m_lock;
    130         bool m_needToVisitLargeAllocations { true };
     130        bool m_needToVisitPreciseAllocations { true };
    131131    };
    132132   
     
    146146        });
    147147    CellAttributes attributes = this->attributes();
    148     forEachLargeAllocation(
    149         [&] (LargeAllocation* allocation) {
     148    forEachPreciseAllocation(
     149        [&] (PreciseAllocation* allocation) {
    150150            if (allocation->isLive())
    151151                func(allocation->cell(), attributes.cellKind);
  • trunk/Source/JavaScriptCore/heap/WeakBlock.cpp

    r248925 r252302  
    142142    ASSERT(m_container);
    143143   
    144     if (m_container.isLargeAllocation())
    145         specializedVisit(m_container.largeAllocation(), visitor);
     144    if (m_container.isPreciseAllocation())
     145        specializedVisit(m_container.preciseAllocation(), visitor);
    146146    else
    147147        specializedVisit(m_container.markedBlock(), visitor);
  • trunk/Source/JavaScriptCore/heap/WeakSet.cpp

    r252298 r252302  
    5757            // If this WeakBlock is logically empty, but still has Weaks pointing into it,
    5858            // 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.
    6060            m_blocks.remove(block);
    6161            heap()->addLogicallyEmptyWeakBlock(block);
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r252273 r252302  
    558558const MarkedBlockMask = ~(MarkedBlockSize - 1)
    559559const MarkedBlockFooterOffset = constexpr MarkedBlock::offsetOfFooter
    560 const LargeAllocationHeaderSize = constexpr (LargeAllocation::headerSize())
    561 const LargeAllocationVMOffset = (LargeAllocation::m_weakSet + WeakSet::m_vm - LargeAllocationHeaderSize)
     560const PreciseAllocationHeaderSize = constexpr (PreciseAllocation::headerSize())
     561const PreciseAllocationVMOffset = (PreciseAllocation::m_weakSet + WeakSet::m_vm - PreciseAllocationHeaderSize)
    562562
    563563const BlackThreshold = constexpr blackThreshold
     
    11661166
    11671167macro convertCalleeToVM(callee)
    1168     btpnz callee, (constexpr LargeAllocation::halfAlignment), .largeAllocation
     1168    btpnz callee, (constexpr PreciseAllocation::halfAlignment), .preciseAllocation
    11691169    andp MarkedBlockMask, callee
    11701170    loadp MarkedBlockFooterOffset + MarkedBlock::Footer::m_vm[callee], callee
    11711171    jmp .done
    1172 .largeAllocation:
    1173     loadp LargeAllocationVMOffset[callee], callee
     1172.preciseAllocation:
     1173    loadp PreciseAllocationVMOffset[callee], callee
    11741174.done:
    11751175end
  • trunk/Source/JavaScriptCore/runtime/ButterflyInlines.h

    r252024 r252302  
    207207    ASSERT(newSize >= oldSize);
    208208
    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.
    210210    // This is because during deallocation concurrent collector can access butterfly and DFG concurrent compilers accesses properties.
    211211    // 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)->isLargeAllocation();
     212    bool canRealloc = !propertyCapacity && !vm.heap.mutatorShouldBeFenced() && bitwise_cast<HeapCell*>(theBase)->isPreciseAllocation();
    213213    if (canRealloc) {
    214         void* newBase = vm.jsValueGigacageAuxiliarySpace.reallocateLargeAllocationNonVirtual(vm, bitwise_cast<HeapCell*>(theBase), newSize, &deferralContext, AllocationFailureMode::ReturnNull);
     214        void* newBase = vm.jsValueGigacageAuxiliarySpace.reallocatePreciseAllocationNonVirtual(vm, bitwise_cast<HeapCell*>(theBase), newSize, &deferralContext, AllocationFailureMode::ReturnNull);
    215215        if (!newBase)
    216216            return nullptr;
  • trunk/Source/JavaScriptCore/runtime/OptionsList.h

    r252115 r252302  
    184184    v(Bool, scribbleFreeCells, false, Normal, nullptr) \
    185185    v(Double, sizeClassProgression, 1.4, Normal, nullptr) \
    186     v(Unsigned, largeAllocationCutoff, 100000, Normal, nullptr) \
     186    v(Unsigned, preciseAllocationCutoff, 100000, Normal, nullptr) \
    187187    v(Bool, dumpSizeClasses, false, Normal, nullptr) \
    188188    v(Bool, useBumpAllocator, true, Normal, nullptr) \
  • trunk/Source/JavaScriptCore/runtime/SamplingProfiler.cpp

    r252298 r252302  
    308308
    309309    m_currentFrames.grow(256);
    310     vm.heap.objectSpace().enableLargeAllocationTracking();
     310    vm.heap.objectSpace().enablePreciseAllocationTracking();
    311311}
    312312
  • trunk/Source/JavaScriptCore/tools/VMInspector.cpp

    r251475 r252302  
    232232    if (heap->objectSpace().blocks().set().contains(candidate))
    233233        return true;
    234     for (LargeAllocation* allocation : heap->objectSpace().largeAllocations()) {
     234    for (PreciseAllocation* allocation : heap->objectSpace().preciseAllocations()) {
    235235        if (allocation->contains(ptr))
    236236            return true;
  • trunk/Source/JavaScriptCore/tools/VMInspectorInlines.h

    r250289 r252302  
    6060{
    6161    size_t allocatorCellSize = 0;
    62     if (cell->isLargeAllocation()) {
    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);
    6565
    66         bool isValidLargeAllocation = false;
    67         for (auto* i : vm.heap.objectSpace().largeAllocations()) {
    68             if (i == &largeAllocation) {
    69                 isValidLargeAllocation = true;
     66        bool isValidPreciseAllocation = false;
     67        for (auto* i : vm.heap.objectSpace().preciseAllocations()) {
     68            if (i == &preciseAllocation) {
     69                isValidPreciseAllocation = true;
    7070                break;
    7171            }
    7272        }
    73         AUDIT_VERIFY(action, verifier, isValidLargeAllocation, cell, cell->type());
     73        AUDIT_VERIFY(action, verifier, isValidPreciseAllocation, cell, cell->type());
    7474
    75         allocatorCellSize = largeAllocation.cellSize();
     75        allocatorCellSize = preciseAllocation.cellSize();
    7676    } else {
    7777        MarkedBlock& block = cell->markedBlock();
Note: See TracChangeset for help on using the changeset viewer.