diff --git a/Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.cpp b/Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.cpp index d433a5d196656..833f607583c2c 100644 --- a/Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.cpp +++ b/Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.cpp @@ -81,23 +81,6 @@ class WarmUpBlockProvider { return Options::useWarmUpMarkedBlocks() && Options::warmUpMarkedBlockCount() && !VM::isInMiniMode(); } - // Bringing up a VM takes a few dozen blocks, and a short program never asks for many more; for - // it the helper thread is only a thread to create, fault a supply on and tear down again at exit. - // So the provider stays dormant until the process has requested this many blocks. A heap that - // is ramping passes the threshold within its first milliseconds of allocation, and the helper - // then fills the supply to its full depth as it would have from the first request. - static bool isPastStartThreshold() - { - static std::atomic past { false }; - static std::atomic requests { 0 }; - if (past.load(std::memory_order_relaxed)) [[likely]] - return true; - if (requests.fetch_add(1, std::memory_order_relaxed) + 1 < Options::warmUpMarkedBlockStartAfterBlocks()) - return false; - past.store(true, std::memory_order_relaxed); - return true; - } - static WarmUpBlockProvider& singleton() { static LazyNeverDestroyed provider; @@ -278,7 +261,7 @@ void* FastMallocAlignedMemoryAllocator::tryAllocateAlignedMemory(size_t alignmen #else // MarkedBlock::tryCreate is the only caller today and always asks for a block-shaped region. // The guard keeps a future caller of some other size from being handed a block. - if (alignment == MarkedBlock::blockSize && size == MarkedBlock::blockSize && WarmUpBlockProvider::isEnabled() && WarmUpBlockProvider::isPastStartThreshold()) { + if (alignment == MarkedBlock::blockSize && size == MarkedBlock::blockSize && WarmUpBlockProvider::isEnabled()) { if (void* block = WarmUpBlockProvider::singleton().tryTake()) return block; } diff --git a/Source/JavaScriptCore/runtime/OptionsList.h b/Source/JavaScriptCore/runtime/OptionsList.h index dd559c4ba163d..00b28122ead71 100644 --- a/Source/JavaScriptCore/runtime/OptionsList.h +++ b/Source/JavaScriptCore/runtime/OptionsList.h @@ -273,7 +273,6 @@ bool hasCapacityToUseLargeGigacage(); v(Double, gcIncrementScale, 0, Normal, nullptr) \ v(Bool, useWarmUpMarkedBlocks, true, Normal, "hand MarkedBlock allocation pages that a helper thread already made resident"_s) \ v(Unsigned, warmUpMarkedBlockCount, 32, Normal, "how many MarkedBlocks the helper thread keeps ready with their pages already resident; 0 turns it off"_s) \ - v(Unsigned, warmUpMarkedBlockStartAfterBlocks, 64, Normal, "how many MarkedBlocks the process allocates before the helper thread starts; a program that stops before that never creates it"_s) \ v(Double, warmUpMarkedBlockIdleTimeout, 10, Normal, "seconds without a MarkedBlock request before the helper thread releases what it is holding and shuts down"_s) \ v(Bool, scribbleFreeCells, false, Normal, nullptr) \ v(Bool, decommitUnusedMarkedBlockPages, true, Normal, "after sweeping a MarkedBlock, return its interior OS pages that hold no live cell to the OS (only where OS pages are smaller than a MarkedBlock)") \