Changeset 286572 in webkit
- Timestamp:
- Dec 6, 2021, 2:50:39 PM (3 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r286558 r286572 1 2021-12-06 Mark Lam <mark.lam@apple.com> 2 3 Remove unneeded virtual allocator methods from Subspace. 4 https://bugs.webkit.org/show_bug.cgi?id=233891 5 rdar://86117970 6 7 Reviewed by Yusuke Suzuki. 8 9 Since the virtual allocate() and allocateFor() methods are now deleted, we can 10 also rename the inline allocateNonVirtual() and allocatorForNonVirtual() methods 11 to simply allocate() and allocateFor(). Similarly, rename 12 allocatorForNonVirtualConcurrently() to allocatorForConcurrently(). 13 14 There are 2 places that still invokes the non-inline version of 15 CompleteSubspace::allocatorFor(). For this reason, we introduce a 16 CompleteSubsace::allocatorForNonInline() to keep the linkage the same. There's a 17 chance that the compiler/linker may already inline the method in 1 or both of 18 these places, but we'll offer allocatorForNonInline() to keep the code expressing 19 the same thing and let the compiler/linker decide whether to inline it or not just 20 as before. 21 22 This is purely a re-factoring patch. There are no behavior changes, except for 23 the removal of those 2 entries from the vtbls. 24 25 * bytecode/AccessCase.cpp: 26 (JSC::AccessCase::generateImpl): 27 * bytecode/ObjectAllocationProfileInlines.h: 28 (JSC::ObjectAllocationProfileBase<Derived>::initializeProfile): 29 * dfg/DFGSpeculativeJIT.cpp: 30 (JSC::DFG::SpeculativeJIT::emitAllocateRawObject): 31 * ftl/FTLLowerDFGToB3.cpp: 32 (JSC::FTL::DFG::LowerDFGToB3::compileMakeRope): 33 (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): 34 * heap/CompleteSubspace.cpp: 35 (JSC::CompleteSubspace::allocatorForNonInline): 36 (JSC::CompleteSubspace::tryAllocateSlow): 37 (JSC::CompleteSubspace::allocatorFor): Deleted. 38 (JSC::CompleteSubspace::allocate): Deleted. 39 * heap/CompleteSubspace.h: 40 (JSC::CompleteSubspace::allocatorFor): 41 (JSC::CompleteSubspace::allocatorForNonVirtual): Deleted. 42 * heap/CompleteSubspaceInlines.h: 43 (JSC::CompleteSubspace::allocate): 44 (JSC::CompleteSubspace::allocateNonVirtual): Deleted. 45 * heap/IsoSubspace.cpp: 46 (JSC::IsoSubspace::allocatorFor): Deleted. 47 (JSC::IsoSubspace::allocate): Deleted. 48 * heap/IsoSubspace.h: 49 (JSC::IsoSubspace::allocatorFor): 50 (JSC::IsoSubspace::allocatorForNonVirtual): Deleted. 51 * heap/IsoSubspaceInlines.h: 52 (JSC::IsoSubspace::allocate): 53 (JSC::IsoSubspace::allocateNonVirtual): Deleted. 54 * heap/Subspace.h: 55 * jit/AssemblyHelpers.h: 56 (JSC::AssemblyHelpers::emitAllocateJSObjectWithKnownSize): 57 * runtime/ButterflyInlines.h: 58 (JSC::Butterfly::tryCreateUninitialized): 59 (JSC::Butterfly::createUninitialized): 60 (JSC::Butterfly::tryCreate): 61 (JSC::Butterfly::growArrayRight): 62 (JSC::Butterfly::reallocArrayRightIfPossible): 63 * runtime/DirectArguments.cpp: 64 (JSC::DirectArguments::overrideThings): 65 * runtime/GenericArgumentsInlines.h: 66 (JSC::GenericArguments<Type>::initModifiedArgumentsDescriptor): 67 * runtime/HashMapImpl.h: 68 (JSC::HashMapBuffer::create): 69 * runtime/JSArray.cpp: 70 (JSC::JSArray::tryCreateUninitializedRestricted): 71 * runtime/JSArray.h: 72 (JSC::JSArray::tryCreate): 73 * runtime/JSArrayBufferView.cpp: 74 (JSC::JSArrayBufferView::ConstructionContext::ConstructionContext): 75 * runtime/JSBigInt.cpp: 76 (JSC::JSBigInt::createWithLength): 77 * runtime/JSCellInlines.h: 78 (JSC::allocatorForConcurrently): 79 (JSC::tryAllocateCellHelper): 80 (JSC::allocatorForNonVirtualConcurrently): Deleted. 81 * runtime/JSPropertyNameEnumerator.cpp: 82 (JSC::JSPropertyNameEnumerator::create): 83 * runtime/ScopedArguments.cpp: 84 (JSC::ScopedArguments::createUninitialized): 85 * runtime/StructureChain.cpp: 86 (JSC::StructureChain::create): 87 1 88 2021-12-06 Patrick Angle <pangle@apple.com> 2 89 -
trunk/Source/JavaScriptCore/bytecode/AccessCase.cpp
r286347 r286572 2278 2278 2279 2279 if (allocatingInline) { 2280 Allocator allocator = vm.jsValueGigacageAuxiliarySpace().allocatorFor (newSize, AllocatorForMode::AllocatorIfExists);2280 Allocator allocator = vm.jsValueGigacageAuxiliarySpace().allocatorForNonInline(newSize, AllocatorForMode::AllocatorIfExists); 2281 2281 2282 2282 jit.emitAllocate(scratchGPR, JITAllocator::constant(allocator), scratchGPR2, scratchGPR3, slowPath); -
trunk/Source/JavaScriptCore/bytecode/ObjectAllocationProfileInlines.h
r271269 r286572 1 1 /* 2 * Copyright (C) 2017-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2017-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 100 100 101 101 size_t allocationSize = JSFinalObject::allocationSize(inlineCapacity); 102 Allocator allocator = subspaceFor<JSFinalObject>(vm)->allocatorFor NonVirtual(allocationSize, AllocatorForMode::EnsureAllocator);102 Allocator allocator = subspaceFor<JSFinalObject>(vm)->allocatorFor(allocationSize, AllocatorForMode::EnsureAllocator); 103 103 104 104 // Take advantage of extra inline capacity available in the size class. -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r286347 r286572 121 121 VM& vm = this->vm(); 122 122 if (size) { 123 if (Allocator allocator = vm.jsValueGigacageAuxiliarySpace().allocatorFor NonVirtual(size, AllocatorForMode::AllocatorIfExists)) {123 if (Allocator allocator = vm.jsValueGigacageAuxiliarySpace().allocatorFor(size, AllocatorForMode::AllocatorIfExists)) { 124 124 m_jit.emitAllocate(storageGPR, JITAllocator::constant(allocator), scratchGPR, scratch2GPR, slowCases); 125 125 … … 136 136 Allocator allocator; 137 137 if (structure->typeInfo().type() == JSType::ArrayType) 138 allocator = allocatorFor NonVirtualConcurrently<JSArray>(vm, JSArray::allocationSize(inlineCapacity), AllocatorForMode::AllocatorIfExists);138 allocator = allocatorForConcurrently<JSArray>(vm, JSArray::allocationSize(inlineCapacity), AllocatorForMode::AllocatorIfExists); 139 139 else 140 allocator = allocatorFor NonVirtualConcurrently<JSFinalObject>(vm, JSFinalObject::allocationSize(inlineCapacity), AllocatorForMode::AllocatorIfExists);140 allocator = allocatorForConcurrently<JSFinalObject>(vm, JSFinalObject::allocationSize(inlineCapacity), AllocatorForMode::AllocatorIfExists); 141 141 if (allocator) { 142 142 emitAllocateJSObject(resultGPR, JITAllocator::constant(allocator), scratchGPR, TrustedImmPtr(structure), storageGPR, scratch2GPR, slowCases); … … 10738 10738 size_t size = initialOutOfLineCapacity * sizeof(JSValue); 10739 10739 10740 Allocator allocator = vm().jsValueGigacageAuxiliarySpace().allocatorFor NonVirtual(size, AllocatorForMode::AllocatorIfExists);10740 Allocator allocator = vm().jsValueGigacageAuxiliarySpace().allocatorFor(size, AllocatorForMode::AllocatorIfExists); 10741 10741 10742 10742 if (!allocator || node->transition()->previous->couldHaveIndexingHeader()) { … … 10782 10782 ASSERT(newSize == node->transition()->next->outOfLineCapacity() * sizeof(JSValue)); 10783 10783 10784 Allocator allocator = vm().jsValueGigacageAuxiliarySpace().allocatorFor NonVirtual(newSize, AllocatorForMode::AllocatorIfExists);10784 Allocator allocator = vm().jsValueGigacageAuxiliarySpace().allocatorFor(newSize, AllocatorForMode::AllocatorIfExists); 10785 10785 10786 10786 if (!allocator || node->transition()->previous->couldHaveIndexingHeader()) { … … 14912 14912 RegisteredStructure structure = node->structure(); 14913 14913 size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity()); 14914 Allocator allocatorValue = allocatorFor NonVirtualConcurrently<JSFinalObject>(vm(), allocationSize, AllocatorForMode::AllocatorIfExists);14914 Allocator allocatorValue = allocatorForConcurrently<JSFinalObject>(vm(), allocationSize, AllocatorForMode::AllocatorIfExists); 14915 14915 if (!allocatorValue) 14916 14916 slowPath.append(m_jit.jump()); … … 16004 16004 16005 16005 CCallHelpers::JumpList slowPath; 16006 Allocator allocatorValue = allocatorFor NonVirtualConcurrently<JSRopeString>(vm(), sizeof(JSRopeString), AllocatorForMode::AllocatorIfExists);16006 Allocator allocatorValue = allocatorForConcurrently<JSRopeString>(vm(), sizeof(JSRopeString), AllocatorForMode::AllocatorIfExists); 16007 16007 emitAllocateJSCell(resultGPR, JITAllocator::constant(allocatorValue), allocatorGPR, TrustedImmPtr(m_jit.graph().registerStructure(vm().stringStructure.get())), scratchGPR, slowPath); 16008 16008 -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r286502 r286572 8748 8748 LBasicBlock continuation = m_out.newBlock(); 8749 8749 8750 Allocator allocator = allocatorFor NonVirtualConcurrently<JSRopeString>(vm(), sizeof(JSRopeString), AllocatorForMode::AllocatorIfExists);8750 Allocator allocator = allocatorForConcurrently<JSRopeString>(vm(), sizeof(JSRopeString), AllocatorForMode::AllocatorIfExists); 8751 8751 8752 8752 LValue result = allocateCell( … … 13882 13882 Allocator cellAllocator; 13883 13883 if (structure->typeInfo().type() == JSType::ArrayType) 13884 cellAllocator = allocatorFor NonVirtualConcurrently<JSArray>(vm(), JSArray::allocationSize(structure->inlineCapacity()), AllocatorForMode::AllocatorIfExists);13884 cellAllocator = allocatorForConcurrently<JSArray>(vm(), JSArray::allocationSize(structure->inlineCapacity()), AllocatorForMode::AllocatorIfExists); 13885 13885 else 13886 cellAllocator = allocatorFor NonVirtualConcurrently<JSFinalObject>(vm(), JSFinalObject::allocationSize(structure->inlineCapacity()), AllocatorForMode::AllocatorIfExists);13886 cellAllocator = allocatorForConcurrently<JSFinalObject>(vm(), JSFinalObject::allocationSize(structure->inlineCapacity()), AllocatorForMode::AllocatorIfExists); 13887 13887 13888 13888 bool hasIndexingHeader = hasIndexedProperties(structure->indexingType()); … … 15018 15018 15019 15019 size_t sizeInBytes = sizeInValues * sizeof(JSValue); 15020 Allocator allocator = vm().jsValueGigacageAuxiliarySpace().allocatorFor NonVirtual(sizeInBytes, AllocatorForMode::AllocatorIfExists);15020 Allocator allocator = vm().jsValueGigacageAuxiliarySpace().allocatorFor(sizeInBytes, AllocatorForMode::AllocatorIfExists); 15021 15021 LValue startOfStorage = allocateHeapCell( 15022 15022 m_out.constIntPtr(allocator.localAllocator()), slowPath); … … 16853 16853 size_t size, StructureType structure, LValue butterfly, LBasicBlock slowPath) 16854 16854 { 16855 Allocator allocator = allocatorFor NonVirtualConcurrently<ClassType>(vm(), size, AllocatorForMode::AllocatorIfExists);16855 Allocator allocator = allocatorForConcurrently<ClassType>(vm(), size, AllocatorForMode::AllocatorIfExists); 16856 16856 return allocateObject( 16857 16857 m_out.constIntPtr(allocator.localAllocator()), structure, butterfly, slowPath); … … 16874 16874 size_t actualSize = size->asIntPtr(); 16875 16875 16876 Allocator actualAllocator = actualSubspace->allocatorFor NonVirtual(actualSize, AllocatorForMode::AllocatorIfExists);16876 Allocator actualAllocator = actualSubspace->allocatorFor(actualSize, AllocatorForMode::AllocatorIfExists); 16877 16877 if (!actualAllocator) { 16878 16878 LBasicBlock continuation = m_out.newBlock(); … … 16936 16936 { 16937 16937 size_t allocationSize = JSFinalObject::allocationSize(structure.get()->inlineCapacity()); 16938 Allocator allocator = allocatorFor NonVirtualConcurrently<JSFinalObject>(vm(), allocationSize, AllocatorForMode::AllocatorIfExists);16938 Allocator allocator = allocatorForConcurrently<JSFinalObject>(vm(), allocationSize, AllocatorForMode::AllocatorIfExists); 16939 16939 16940 16940 // FIXME: If the allocator is null, we could simply emit a normal C call to the allocator -
trunk/Source/JavaScriptCore/heap/CompleteSubspace.cpp
r286042 r286572 46 46 } 47 47 48 Allocator CompleteSubspace::allocatorFor(size_t size, AllocatorForMode mode) 49 { 50 return allocatorForNonVirtual(size, mode); 51 } 52 53 void* CompleteSubspace::allocate(VM& vm, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode) 54 { 55 return allocateNonVirtual(vm, size, deferralContext, failureMode); 48 Allocator CompleteSubspace::allocatorForNonInline(size_t size, AllocatorForMode mode) 49 { 50 return allocatorFor(size, mode); 56 51 } 57 52 … … 124 119 125 120 sanitizeStackForVM(vm); 126 127 if (Allocator allocator = allocatorFor (size, AllocatorForMode::EnsureAllocator))121 122 if (Allocator allocator = allocatorForNonInline(size, AllocatorForMode::EnsureAllocator)) 128 123 return allocator.allocate(vm.heap, deferralContext, AllocationFailureMode::ReturnNull); 129 124 -
trunk/Source/JavaScriptCore/heap/CompleteSubspace.h
r286042 r286572 40 40 // FIXME: Currently subspaces speak of BlockDirectories as "allocators", but that's temporary. 41 41 // https://bugs.webkit.org/show_bug.cgi?id=181559 42 Allocator allocatorFor(size_t, AllocatorForMode) final; 43 Allocator allocatorForNonVirtual(size_t, AllocatorForMode); 44 45 void* allocate(VM&, size_t, GCDeferralContext*, AllocationFailureMode) final; 46 void* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode); 42 Allocator allocatorFor(size_t, AllocatorForMode); 43 Allocator allocatorForNonInline(size_t, AllocatorForMode); 44 45 void* allocate(VM&, size_t, GCDeferralContext*, AllocationFailureMode); 47 46 void* reallocatePreciseAllocationNonVirtual(VM&, HeapCell*, size_t, GCDeferralContext*, AllocationFailureMode); 48 47 … … 63 62 }; 64 63 65 ALWAYS_INLINE Allocator CompleteSubspace::allocatorFor NonVirtual(size_t size, AllocatorForMode mode)64 ALWAYS_INLINE Allocator CompleteSubspace::allocatorFor(size_t size, AllocatorForMode mode) 66 65 { 67 66 if (size <= MarkedSpace::largeCutoff) { -
trunk/Source/JavaScriptCore/heap/CompleteSubspaceInlines.h
r285636 r286572 31 31 namespace JSC { 32 32 33 ALWAYS_INLINE void* CompleteSubspace::allocate NonVirtual(VM& vm, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)33 ALWAYS_INLINE void* CompleteSubspace::allocate(VM& vm, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode) 34 34 { 35 35 if constexpr (validateDFGDoesGC) 36 36 vm.verifyCanGC(); 37 37 38 if (Allocator allocator = allocatorFor NonVirtual(size, AllocatorForMode::AllocatorIfExists))38 if (Allocator allocator = allocatorFor(size, AllocatorForMode::AllocatorIfExists)) 39 39 return allocator.allocate(vm.heap, deferralContext, failureMode); 40 40 return allocateSlow(vm, size, deferralContext, failureMode); -
trunk/Source/JavaScriptCore/heap/IsoSubspace.cpp
r286391 r286572 55 55 IsoSubspace::~IsoSubspace() 56 56 { 57 }58 59 Allocator IsoSubspace::allocatorFor(size_t size, AllocatorForMode mode)60 {61 return allocatorForNonVirtual(size, mode);62 }63 64 void* IsoSubspace::allocate(VM& vm, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)65 {66 return allocateNonVirtual(vm, size, deferralContext, failureMode);67 57 } 68 58 -
trunk/Source/JavaScriptCore/heap/IsoSubspace.h
r286345 r286572 43 43 size_t cellSize() { return m_directory.cellSize(); } 44 44 45 Allocator allocatorFor(size_t, AllocatorForMode) override; 46 Allocator allocatorForNonVirtual(size_t, AllocatorForMode); 45 Allocator allocatorFor(size_t, AllocatorForMode); 47 46 48 void* allocate(VM&, size_t, GCDeferralContext*, AllocationFailureMode) override; 49 void* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode); 47 void* allocate(VM&, size_t, GCDeferralContext*, AllocationFailureMode); 50 48 51 49 void sweepLowerTierCell(PreciseAllocation*); … … 73 71 }; 74 72 75 ALWAYS_INLINE Allocator IsoSubspace::allocatorFor NonVirtual(size_t size, AllocatorForMode)73 ALWAYS_INLINE Allocator IsoSubspace::allocatorFor(size_t size, AllocatorForMode) 76 74 { 77 75 RELEASE_ASSERT(WTF::roundUpToMultipleOf<MarkedBlock::atomSize>(size) == cellSize()); -
trunk/Source/JavaScriptCore/heap/IsoSubspaceInlines.h
r258479 r286572 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 namespace JSC { 29 29 30 ALWAYS_INLINE void* IsoSubspace::allocate NonVirtual(VM& vm, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)30 ALWAYS_INLINE void* IsoSubspace::allocate(VM& vm, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode) 31 31 { 32 32 RELEASE_ASSERT(WTF::roundUpToMultipleOf<MarkedBlock::atomSize>(size) == cellSize()); 33 Allocator allocator = allocatorFor NonVirtual(size, AllocatorForMode::MustAlreadyHaveAllocator);33 Allocator allocator = allocatorFor(size, AllocatorForMode::MustAlreadyHaveAllocator); 34 34 void* result = allocator.allocate(vm.heap, deferralContext, failureMode); 35 35 return result; -
trunk/Source/JavaScriptCore/heap/Subspace.h
r286042 r286572 57 57 void destroy(VM&, JSCell*); 58 58 59 virtual Allocator allocatorFor(size_t, AllocatorForMode) = 0;60 virtual void* allocate(VM&, size_t, GCDeferralContext*, AllocationFailureMode) = 0;61 62 59 void prepareForAllocation(); 63 60 … … 116 113 BlockDirectory* m_directoryForEmptyAllocation { nullptr }; // Uses the MarkedSpace linked list of blocks. 117 114 SentinelLinkedList<PreciseAllocation, PackedRawSentinelNode<PreciseAllocation>> m_preciseAllocations; 115 116 bool m_isIsoSubspace { false }; 117 uint8_t m_remainingLowerTierCellCount { 0 }; 118 118 119 Subspace* m_nextSubspaceInAlignedMemoryAllocator { nullptr }; 119 120 120 121 CString m_name; 121 122 bool m_isIsoSubspace { false };123 protected:124 uint8_t m_remainingLowerTierCellCount { 0 };125 122 }; 126 123 -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h
r286502 r286572 1821 1821 GPRReg scratchGPR2, JumpList& slowPath, size_t size) 1822 1822 { 1823 Allocator allocator = allocatorFor NonVirtualConcurrently<ClassType>(vm, size, AllocatorForMode::AllocatorIfExists);1823 Allocator allocator = allocatorForConcurrently<ClassType>(vm, size, AllocatorForMode::AllocatorIfExists); 1824 1824 emitAllocateJSObject(resultGPR, JITAllocator::constant(allocator), scratchGPR1, structure, storage, scratchGPR2, slowPath); 1825 1825 } -
trunk/Source/JavaScriptCore/runtime/ButterflyInlines.h
r286347 r286572 1 1 /* 2 * Copyright (C) 2012-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2012-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 78 78 { 79 79 size_t size = totalSize(preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes); 80 void* base = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(vm, size, deferralContext, AllocationFailureMode::ReturnNull);80 void* base = vm.jsValueGigacageAuxiliarySpace().allocate(vm, size, deferralContext, AllocationFailureMode::ReturnNull); 81 81 if (UNLIKELY(!base)) 82 82 return nullptr; … … 90 90 { 91 91 size_t size = totalSize(preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes); 92 void* base = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(vm, size, nullptr, AllocationFailureMode::Assert);92 void* base = vm.jsValueGigacageAuxiliarySpace().allocate(vm, size, nullptr, AllocationFailureMode::Assert); 93 93 Butterfly* result = fromBase(base, preCapacity, propertyCapacity); 94 94 … … 99 99 { 100 100 size_t size = totalSize(preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes); 101 void* base = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(vm, size, nullptr, AllocationFailureMode::ReturnNull);101 void* base = vm.jsValueGigacageAuxiliarySpace().allocate(vm, size, nullptr, AllocationFailureMode::ReturnNull); 102 102 if (!base) 103 103 return nullptr; … … 175 175 size_t oldSize = totalSize(0, propertyCapacity, hadIndexingHeader, oldIndexingPayloadSizeInBytes); 176 176 size_t newSize = totalSize(0, propertyCapacity, true, newIndexingPayloadSizeInBytes); 177 void* newBase = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(vm, newSize, nullptr, AllocationFailureMode::ReturnNull);177 void* newBase = vm.jsValueGigacageAuxiliarySpace().allocate(vm, newSize, nullptr, AllocationFailureMode::ReturnNull); 178 178 if (!newBase) 179 179 return nullptr; … … 218 218 } 219 219 220 void* newBase = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(vm, newSize, &deferralContext, AllocationFailureMode::ReturnNull);220 void* newBase = vm.jsValueGigacageAuxiliarySpace().allocate(vm, newSize, &deferralContext, AllocationFailureMode::ReturnNull); 221 221 if (!newBase) 222 222 return nullptr; -
trunk/Source/JavaScriptCore/runtime/DirectArguments.cpp
r285730 r286572 124 124 putDirect(vm, vm.propertyNames->iteratorSymbol, globalObject->arrayProtoValuesFunction(), static_cast<unsigned>(PropertyAttribute::DontEnum)); 125 125 126 void* backingStore = vm.gigacageAuxiliarySpace(m_mappedArguments.kind).allocate NonVirtual(vm, mappedArgumentsSize(), nullptr, AllocationFailureMode::ReturnNull);126 void* backingStore = vm.gigacageAuxiliarySpace(m_mappedArguments.kind).allocate(vm, mappedArgumentsSize(), nullptr, AllocationFailureMode::ReturnNull); 127 127 if (UNLIKELY(!backingStore)) { 128 128 throwOutOfMemoryError(globalObject, scope); -
trunk/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h
r278589 r286572 277 277 278 278 if (argsLength) { 279 void* backingStore = vm.gigacageAuxiliarySpace(m_modifiedArgumentsDescriptor.kind).allocate NonVirtual(vm, WTF::roundUpToMultipleOf<8>(argsLength), nullptr, AllocationFailureMode::ReturnNull);279 void* backingStore = vm.gigacageAuxiliarySpace(m_modifiedArgumentsDescriptor.kind).allocate(vm, WTF::roundUpToMultipleOf<8>(argsLength), nullptr, AllocationFailureMode::ReturnNull); 280 280 if (UNLIKELY(!backingStore)) { 281 281 throwOutOfMemoryError(globalObject, scope); -
trunk/Source/JavaScriptCore/runtime/HashMapImpl.h
r286347 r286572 214 214 auto scope = DECLARE_THROW_SCOPE(vm); 215 215 size_t allocationSize = HashMapBuffer::allocationSize(capacity); 216 void* data = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(vm, allocationSize, nullptr, AllocationFailureMode::ReturnNull);216 void* data = vm.jsValueGigacageAuxiliarySpace().allocate(vm, allocationSize, nullptr, AllocationFailureMode::ReturnNull); 217 217 if (!data) { 218 218 throwOutOfMemoryError(globalObject, scope); -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r286347 r286572 57 57 58 58 unsigned vectorLength = Butterfly::optimalContiguousVectorLength(structure, initialLength); 59 void* temp = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(59 void* temp = vm.jsValueGigacageAuxiliarySpace().allocate( 60 60 vm, 61 61 Butterfly::totalSize(0, outOfLineStorage, true, vectorLength * sizeof(EncodedJSValue)), … … 79 79 static constexpr unsigned indexBias = 0; 80 80 unsigned vectorLength = ArrayStorage::optimalVectorLength(indexBias, structure, initialLength); 81 void* temp = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(81 void* temp = vm.jsValueGigacageAuxiliarySpace().allocate( 82 82 vm, 83 83 Butterfly::totalSize(indexBias, outOfLineStorage, true, ArrayStorage::sizeFor(vectorLength)), -
trunk/Source/JavaScriptCore/runtime/JSArray.h
r286347 r286572 245 245 246 246 unsigned vectorLength = Butterfly::optimalContiguousVectorLength(structure, vectorLengthHint); 247 void* temp = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(247 void* temp = vm.jsValueGigacageAuxiliarySpace().allocate( 248 248 vm, 249 249 Butterfly::totalSize(0, outOfLineStorage, true, vectorLength * sizeof(EncodedJSValue)), -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp
r286347 r286572 65 65 void* temp; 66 66 size_t size = sizeOf(length, elementSize); 67 temp = vm.primitiveGigacageAuxiliarySpace().allocate NonVirtual(vm, size, nullptr, AllocationFailureMode::ReturnNull);67 temp = vm.primitiveGigacageAuxiliarySpace().allocate(vm, size, nullptr, AllocationFailureMode::ReturnNull); 68 68 if (!temp) 69 69 return; -
trunk/Source/JavaScriptCore/runtime/JSBigInt.cpp
r286347 r286572 118 118 119 119 ASSERT(length <= maxLength); 120 void* data = vm.primitiveGigacageAuxiliarySpace().allocate NonVirtual(vm, length * sizeof(Digit), nullptr, AllocationFailureMode::ReturnNull);120 void* data = vm.primitiveGigacageAuxiliarySpace().allocate(vm, length * sizeof(Digit), nullptr, AllocationFailureMode::ReturnNull); 121 121 if (UNLIKELY(!data)) { 122 122 if (nullOrGlobalObjectForOOM) { -
trunk/Source/JavaScriptCore/runtime/JSCellInlines.h
r286345 r286572 166 166 167 167 template<typename Type> 168 inline Allocator allocatorFor NonVirtualConcurrently(VM& vm, size_t allocationSize, AllocatorForMode mode)168 inline Allocator allocatorForConcurrently(VM& vm, size_t allocationSize, AllocatorForMode mode) 169 169 { 170 170 if (auto* subspace = subspaceForConcurrently<Type>(vm)) 171 return subspace->allocatorFor NonVirtual(allocationSize, mode);171 return subspace->allocatorFor(allocationSize, mode); 172 172 return { }; 173 173 } … … 179 179 ASSERT(deferralContext || heap.isDeferred() || !DisallowGC::isInEffectOnCurrentThread()); 180 180 ASSERT(size >= sizeof(T)); 181 JSCell* result = static_cast<JSCell*>(subspaceFor<T>(vm)->allocate NonVirtual(vm, size, deferralContext, failureMode));181 JSCell* result = static_cast<JSCell*>(subspaceFor<T>(vm)->allocate(vm, size, deferralContext, failureMode)); 182 182 if (failureMode == AllocationFailureMode::ReturnNull && !result) 183 183 return nullptr; -
trunk/Source/JavaScriptCore/runtime/JSPropertyNameEnumerator.cpp
r286347 r286572 39 39 WriteBarrier<JSString>* propertyNamesBuffer = nullptr; 40 40 if (propertyNamesBufferSizeInBytes) { 41 propertyNamesBuffer = static_cast<WriteBarrier<JSString>*>(vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(vm, propertyNamesBufferSizeInBytes, nullptr, AllocationFailureMode::Assert));41 propertyNamesBuffer = static_cast<WriteBarrier<JSString>*>(vm.jsValueGigacageAuxiliarySpace().allocate(vm, propertyNamesBufferSizeInBytes, nullptr, AllocationFailureMode::Assert)); 42 42 for (unsigned i = 0; i < propertyNamesSize; ++i) 43 43 propertyNamesBuffer[i].clear(); -
trunk/Source/JavaScriptCore/runtime/ScopedArguments.cpp
r286347 r286572 56 56 if (totalLength > table->length()) { 57 57 Checked<unsigned> overflowLength = totalLength - table->length(); 58 storage = static_cast<WriteBarrier<Unknown>*>(vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(vm, overflowLength * sizeof(WriteBarrier<Unknown>), nullptr, AllocationFailureMode::Assert));58 storage = static_cast<WriteBarrier<Unknown>*>(vm.jsValueGigacageAuxiliarySpace().allocate(vm, overflowLength * sizeof(WriteBarrier<Unknown>), nullptr, AllocationFailureMode::Assert)); 59 59 } 60 60 -
trunk/Source/JavaScriptCore/runtime/StructureChain.cpp
r286387 r286572 49 49 ++size; // Sentinel nullptr. 50 50 size_t bytes = Checked<size_t>(size) * sizeof(StructureID); 51 void* vector = vm.jsValueGigacageAuxiliarySpace().allocate NonVirtual(vm, bytes, nullptr, AllocationFailureMode::Assert);51 void* vector = vm.jsValueGigacageAuxiliarySpace().allocate(vm, bytes, nullptr, AllocationFailureMode::Assert); 52 52 static_assert(!StructureID().bits(), "Make sure the value we're going to memcpy below matches the default StructureID"); 53 53 memset(vector, 0, bytes);
Note:
See TracChangeset
for help on using the changeset viewer.