Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0839f9342ed5056785ce58ed9c5a0f92b323f625
      
https://github.com/WebKit/WebKit/commit/0839f9342ed5056785ce58ed9c5a0f92b323f625
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-08-29 (Sat, 29 Aug 2026)

  Changed paths:
    A JSTests/stress/warm-up-marked-blocks-state-machine.js
    A JSTests/stress/warm-up-marked-blocks.js
    M Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.cpp
    M Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.h
    M Source/JavaScriptCore/runtime/OptionsList.h
    M Source/JavaScriptCore/tools/JSDollarVM.cpp

  Log Message:
  -----------
  [JSC] Introduce JSC WarmUpThread for MarkedBlocks
https://bugs.webkit.org/show_bug.cgi?id=322774
rdar://186036234

Reviewed by Marcus Plutowski and Dan Hecht.

System page size is 16KB (on Darwin at least) and MarkedBlock size is
also 16KB. We end up having a page-fault for each MarkedBlock allocation
and it is really costly when it is executed synchronously. On M5 device,
each page-fault cost is 700ns.

This patch introduces WarmUpBlockProvider. This holds its own helper
thread via AutomaticThread, and offering a pre-page-faulted warmed-up
MarkedBlocks if possible. This manages a buffer of pre-page-faulted pages
and provides them. If it is exhausted, thread is launched / acked and
start allocating a new pages and perform page-fault concurrently to the
mutator.

Memory scores (Membuster7 / PLUM4) are both neutral.

* JSTests/stress/warm-up-marked-blocks-state-machine.js: Added.
* JSTests/stress/warm-up-marked-blocks.js: Added.
(shouldBe):
* Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.cpp:
(JSC::warmUpMarkedBlockStateForTesting):
(JSC::setWarmUpMarkedBlockAllocationShouldFailForTesting):
(JSC::FastMallocAlignedMemoryAllocator::tryAllocateAlignedMemory):
* Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.h:
* Source/JavaScriptCore/runtime/OptionsList.h:
* Source/JavaScriptCore/tools/JSDollarVM.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSDollarVM::finishCreation):

Canonical link: https://commits.webkit.org/320112@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to