Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 47697fd0eb3e4279d3065166875c68b7194c341e
https://github.com/WebKit/WebKit/commit/47697fd0eb3e4279d3065166875c68b7194c341e
Author: Dan Hecht <[email protected]>
Date: 2026-10-12 (Mon, 12 Oct 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/HeapInlines.h
M Source/JavaScriptCore/heap/MarkStackMergingConstraint.cpp
M Source/JavaScriptCore/heap/MarkingConstraint.cpp
M Source/JavaScriptCore/heap/SlotVisitor.cpp
Log Message:
-----------
[JSC] Make the GC's scope decision and visitor checks work for collections of
several heaps
https://bugs.webkit.org/show_bug.cgi?id=327171
rdar://189763499
Reviewed by Yusuke Suzuki.
Every heap in a collection is collected with the same scope. When a request
doesn't specify one, decideCollectionScope() now asks every heap in the
collection
whether it needs a Full collection and the collection is Full if any of them
does.
With one heap the decision is the same as before. A FIXME notes that the policy
may
need rethinking for global collections.
The visitor checks that assumed a single heap now consider every heap in the
collection. SlotVisitor asserts that a cell it appends or marks as auxiliary
belongs to one of the collection's heaps, and passes the cell's own VM to
Integrity::auditCell() and CellContainer::assertValidCell(). Those compare the
VM with the cell's container, so the new upstream assert now checks that the
cell is part of the collection.
The flag saying the GC verifier is marking moves from Heap to the Collector.
The verifier belongs to the Collector and marks every heap in the collection at
once, so a copy per heap is not needed. The marking constraints read it through
their visitor's Collector.
No new tests: with one heap per collection, behavior is unchanged, and a
collection can't cover several heaps yet.
* Source/JavaScriptCore/heap/Collector.cpp:
(JSC::Collector::decideCollectionScope):
(JSC::Collector::verifierMark):
(JSC::Collector::dumpVerifierMarkerData):
* Source/JavaScriptCore/heap/Collector.h:
(JSC::Collector::isMarkingForGCVerifier const):
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::clearConcurrentRetainedDataIfPossible):
* Source/JavaScriptCore/heap/Heap.h:
(JSC::Heap::isMarkingForGCVerifier const): Deleted.
* Source/JavaScriptCore/heap/HeapInlines.h:
(JSC::Heap::isMarked):
* Source/JavaScriptCore/heap/MarkStackMergingConstraint.cpp:
(JSC::MarkStackMergingConstraint::executeImplImpl):
* Source/JavaScriptCore/heap/MarkingConstraint.cpp:
(JSC::MarkingConstraint::execute):
(JSC::MarkingConstraint::prepareToExecute):
(JSC::MarkingConstraint::doParallelWork):
* Source/JavaScriptCore/heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
(JSC::SlotVisitor::markAuxiliary):
(JSC::SlotVisitor::noteLiveAuxiliaryCell):
Canonical link: https://commits.webkit.org/323482@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications