Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 101392f63ca9966babdf9757a1a85793f2b38073
      
https://github.com/WebKit/WebKit/commit/101392f63ca9966babdf9757a1a85793f2b38073
  Author: Dan Hecht <[email protected]>
  Date:   2026-09-27 (Sun, 27 Sep 2026)

  Changed paths:
    M Source/JavaScriptCore/SaferCPPExpectations/ForwardDeclCheckerExpectations
    M Source/JavaScriptCore/heap/AbstractSlotVisitor.h
    M Source/JavaScriptCore/heap/AbstractSlotVisitorInlines.h
    M Source/JavaScriptCore/heap/Collector.cpp
    M Source/JavaScriptCore/heap/Heap.cpp
    M Source/JavaScriptCore/heap/MarkingConstraint.cpp
    M Source/JavaScriptCore/heap/SlotVisitor.cpp
    M Source/JavaScriptCore/heap/SlotVisitor.h
    M Source/JavaScriptCore/heap/SlotVisitorInlines.h
    M Source/JavaScriptCore/heap/VerifierSlotVisitor.cpp
    M Source/JavaScriptCore/heap/VerifierSlotVisitor.h
    M Source/JavaScriptCore/heap/WeakBlock.cpp
    M Source/JavaScriptCore/runtime/JSObject.cpp
    M Source/JavaScriptCore/runtime/Structure.cpp

  Log Message:
  -----------
  [JSC] Remove SlotVisitor's Heap in preparation for a visitor that marks more 
than one heap
https://bugs.webkit.org/show_bug.cgi?id=325317
rdar://188428012

Reviewed by Yusuke Suzuki.

Currently, a SlotVisitor holds the Heap it marks, which 
AbstractSlotVisitor::vm() and heap() rely
on. We want one Collector to mark several heaps, so remove vm(), heap() and the 
Heap&
behind them, leaving the visitor with only its Collector.

What callers still asked through them is about the collection rather than a 
heap:

 * Structure and WeakBlock ask whether this is a full collection and whether a 
heap snapshot is
   being taken. The Collector now passes both to each visitor when marking 
starts, along with the
   marking version, and the visitor answers from its own fields. 
Heap::verifierMark does the same
   for VerifierSlotVisitor.
 * SlotVisitor::isMarked(const void*) uses the visitor's marking version 
instead of the heap's.
 * JSObject's assert that a cell is in the visitor's heap is removed.

The visitor's data changes accordingly:

 * AbstractSlotVisitor loses Heap& m_heap and gains CollectionScope 
m_collectionScope.
 * HeapAnalyzer* m_heapAnalyzer moves from SlotVisitor to AbstractSlotVisitor, 
so that
   VerifierSlotVisitor has it too, and AbstractSlotVisitor::reset() clears it.
 * SlotVisitor::m_markingVersion stays, but is passed in rather than read from 
the heap.

sizeof(SlotVisitor) stays at 256.

Structure::visitChildren asks for the collection scope on every visit, and now 
reads it from the
visitor instead of through the Heap.

The uses that still need a heap, which are memory accounting, the world-state 
checks and the asserts
that a cell belongs to the collection, go through Collector::heap() for now, 
and will be handled
separately.

No change in behavior.

* Source/JavaScriptCore/heap/AbstractSlotVisitor.h:
(JSC::AbstractSlotVisitor::collector const):
(JSC::AbstractSlotVisitor::collectionScope const):
(JSC::AbstractSlotVisitor::heapAnalyzer const):
* Source/JavaScriptCore/heap/AbstractSlotVisitorInlines.h:
(JSC::AbstractSlotVisitor::AbstractSlotVisitor):
(JSC::AbstractSlotVisitor::didStartMarking):
(JSC::AbstractSlotVisitor::reset):
(JSC::AbstractSlotVisitor::heap const): Deleted.
(JSC::AbstractSlotVisitor::collector const): Deleted.
(JSC::AbstractSlotVisitor::vm): Deleted.
(JSC::AbstractSlotVisitor::vm const): Deleted.
* Source/JavaScriptCore/heap/Collector.cpp:
(JSC::Collector::Collector):
(JSC::Collector::runBeginPhase):
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::clearConcurrentRetainedDataIfPossible):
* Source/JavaScriptCore/heap/MarkingConstraint.cpp:
(JSC::MarkingConstraint::execute):
(JSC::MarkingConstraint::prepareToExecute):
(JSC::MarkingConstraint::doParallelWork):
* Source/JavaScriptCore/heap/SlotVisitor.cpp:
(JSC::SlotVisitor::SlotVisitor):
(JSC::SlotVisitor::didStartMarking):
(JSC::SlotVisitor::reset):
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
(JSC::SlotVisitor::appendToMarkStack):
(JSC::SlotVisitor::markAuxiliary):
(JSC::SlotVisitor::noteLiveAuxiliaryCell):
(JSC::SlotVisitor::visitChildren):
(JSC::SlotVisitor::propagateExternalMemoryVisitedIfNecessary):
(JSC::SlotVisitor::updateMutatorIsStopped):
(JSC::SlotVisitor::mutatorIsStoppedIsUpToDate const):
(JSC::SlotVisitor::drainFromShared):
(JSC::SlotVisitor::drainInParallelPassively):
* Source/JavaScriptCore/heap/SlotVisitor.h:
* Source/JavaScriptCore/heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::isMarked const):
(JSC::SlotVisitor::reportExternalMemoryVisited):
* Source/JavaScriptCore/heap/VerifierSlotVisitor.cpp:
(JSC::VerifierSlotVisitor::VerifierSlotVisitor):
(JSC::VerifierSlotVisitor::~VerifierSlotVisitor):
(JSC::VerifierSlotVisitor::dumpMarkerData):
(JSC::VerifierSlotVisitor::markAuxiliary):
* Source/JavaScriptCore/heap/VerifierSlotVisitor.h:
* Source/JavaScriptCore/heap/WeakBlock.cpp:
(JSC::WeakBlock::specializedVisit):
* Source/JavaScriptCore/runtime/JSObject.cpp:
(JSC::JSObjectWithButterfly::markAuxiliaryAndVisitOutOfLineProperties):
* Source/JavaScriptCore/runtime/Structure.cpp:
(JSC::Structure::visitChildrenImpl):
* Source/JavaScriptCore/SaferCPPExpectations/ForwardDeclCheckerExpectations:

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



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

Reply via email to