Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 192fd94f17a5e23ac3a41491eff0f7a50fcf87bf
      
https://github.com/WebKit/WebKit/commit/192fd94f17a5e23ac3a41491eff0f7a50fcf87bf
  Author: Dan Hecht <[email protected]>
  Date:   2026-10-09 (Fri, 09 Oct 2026)

  Changed paths:
    M Source/JavaScriptCore/heap/Collector.cpp
    M Source/JavaScriptCore/heap/Collector.h
    M Source/JavaScriptCore/heap/Heap.h
    M Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.cpp
    M Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.h
    M Source/JavaScriptCore/heap/StochasticSpaceTimeMutatorScheduler.cpp
    M Source/JavaScriptCore/heap/StochasticSpaceTimeMutatorScheduler.h

  Log Message:
  -----------
  [JSC] Make the GC's mutator scheduler work for collections of several heaps
https://bugs.webkit.org/show_bug.cgi?id=326875
rdar://189554727

Reviewed by Yusuke Suzuki.

The mutator scheduler decides when concurrent marking stops and resumes the
mutator, by comparing the bytes allocated since the collection began with a
budget derived from the Eden size. It was built with one heap and read only
that heap. It now reads both from its Collector, which sums them over its
heaps, so it can work for a collection of several heaps.

With one heap the sums are that heap's values, so no behavior change for
collections with one heap.

Pooling the heaps' budgets is the simplest choice for several heaps. Whether
to combine them differently, such as letting the most constrained heap
decide, or whether the scheduler needs other changes, is left until
collections of several heaps can be measured.

* Source/JavaScriptCore/heap/Collector.cpp:
(JSC::m_threadCondition):
(JSC::Collector::totalBytesAllocatedThisCycle):
(JSC::Collector::totalMaxEdenSize):
* Source/JavaScriptCore/heap/Collector.h:
* Source/JavaScriptCore/heap/Heap.h:
* Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.cpp:
(JSC::SpaceTimeMutatorScheduler::SpaceTimeMutatorScheduler):
(JSC::SpaceTimeMutatorScheduler::beginCollection):
(JSC::SpaceTimeMutatorScheduler::bytesAllocatedThisCycleImpl):
* Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.h:
* Source/JavaScriptCore/heap/StochasticSpaceTimeMutatorScheduler.cpp:
(JSC::StochasticSpaceTimeMutatorScheduler::StochasticSpaceTimeMutatorScheduler):
(JSC::StochasticSpaceTimeMutatorScheduler::beginCollection):
(JSC::StochasticSpaceTimeMutatorScheduler::bytesAllocatedThisCycleImpl):
* Source/JavaScriptCore/heap/StochasticSpaceTimeMutatorScheduler.h:

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



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

Reply via email to