Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5e53548c666f1c76cb8d47f34be68e7fc4a25f84
      
https://github.com/WebKit/WebKit/commit/5e53548c666f1c76cb8d47f34be68e7fc4a25f84
  Author: Dan Hecht <[email protected]>
  Date:   2026-09-28 (Mon, 28 Sep 2026)

  Changed paths:
    M Source/JavaScriptCore/heap/Collector.cpp
    M Source/JavaScriptCore/heap/Collector.h
    M Source/JavaScriptCore/heap/Heap.cpp
    M Source/JavaScriptCore/heap/Heap.h
    M Source/JavaScriptCore/heap/MarkingConstraintSet.cpp
    M Source/JavaScriptCore/heap/MarkingConstraintSet.h
    M Source/JavaScriptCore/heap/MarkingConstraintSolver.cpp
    M Source/JavaScriptCore/heap/MarkingConstraintSolver.h

  Log Message:
  -----------
  [JSC] Move the marking constraint set to the Collector
https://bugs.webkit.org/show_bug.cgi?id=325513
rdar://188601461

Reviewed by Vassili Bykov.

The constraint set is what a collection's fixpoint converges, and once a 
Collector marks more than one
heap its constraints are no longer one heap's. Move it from Heap to Collector.

* Collector owns the MarkingConstraintSet and exposes addMarkingConstraint(), 
which Heap uses to
register its core constraints and embedders' constraints. It asserts that no 
collection is running,
since a collection iterates the set.
* MarkingConstraintSet drops the Heap it stored and never used.
* MarkingConstraintSolver reaches the Collector through its main visitor 
instead of a Heap.
* Leave defaults off Collector::addMarkingConstraint() parameters. There's a 
limited number
of constraints, so I think it's better to make them explicit, especially since 
the constraints
themselves will change somewhat to allow a Collector to mark multiple Heaps.

Heap::verifierMark still runs the set directly; how the verifier should run 
constraints once it covers
more than one heap is left for later.

No change in behavior.

* Source/JavaScriptCore/heap/Collector.cpp:
(JSC::Collector::Collector):
(JSC::Collector::runBeginPhase):
(JSC::Collector::runFixpointPhase):
(JSC::Collector::addMarkingConstraint):
* Source/JavaScriptCore/heap/Collector.h:
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::clearConcurrentRetainedDataIfPossible):
* Source/JavaScriptCore/heap/Heap.h:
* Source/JavaScriptCore/heap/MarkingConstraintSet.cpp:
(JSC::MarkingConstraintSet::executeConvergenceImpl):
(JSC::MarkingConstraintSet::MarkingConstraintSet): Deleted.
* Source/JavaScriptCore/heap/MarkingConstraintSet.h:
(JSC::MarkingConstraintSet::add): Deleted.
* Source/JavaScriptCore/heap/MarkingConstraintSolver.cpp:
(JSC::MarkingConstraintSolver::MarkingConstraintSolver):
(JSC::MarkingConstraintSolver::execute):
* Source/JavaScriptCore/heap/MarkingConstraintSolver.h:

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



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

Reply via email to