Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5b292fffd73a6271195d0e5fc8dfcbdf868f12da
https://github.com/WebKit/WebKit/commit/5b292fffd73a6271195d0e5fc8dfcbdf868f12da
Author: Dan Hecht <[email protected]>
Date: 2026-10-14 (Wed, 14 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/SlotVisitor.cpp
M Source/JavaScriptCore/heap/SlotVisitor.h
M Source/JavaScriptCore/runtime/VM.cpp
Log Message:
-----------
[JSC] Rename the GC's bytes-visited counts to bytes marked and old generation
cell bytes
https://bugs.webkit.org/show_bug.cgi?id=327452
rdar://189949396
Reviewed by Yusuke Suzuki.
The term "bytes visited" is confusing because a cell is counted only once,
when it is first marked. When it is visited again, due to a write barrier or a
constraint, it is not counted. So the count is not literally the bytes
visited. What it does count is the number of bytes that are newly marked.
So rename the SlotVisitor fields and related methods to make it clear that
they are accounting marked bytes.
Then, what the heap is calculating is also not "total bytes visited". It's
accumulating bytes marked to determine the size of the old generation's
cells. So, name it accordingly:
- Heap::m_totalBytesVisited is now m_oldGenerationCellBytes.
- Heap::m_totalBytesVisitedAfterLastFullCollect is now
m_oldGenerationCellBytesAtStartOfLastFullCollect. "After" named when it is
assigned, at the last Full collection's End, but the value it holds is the
old generation as it stood when that collection began.
- Heap::recordBytesVisited() is now updateOldGenerationCellBytes().
- Heap::m_bytesVisitedDuringMarking is now m_bytesMarkedThisCycle.
SlotVisitor::performIncrementOfDraining() keeps "visited", since it does
actually count every cell it visits in order to estimate work.
Also document the terminology of the heap sizing fields: what a size counts,
and what "before" and "after" a collection and "this cycle" mean. And fix the
spelling of m_lastOversidedAllocationThisCycle.
No behavior change.
* Source/JavaScriptCore/heap/Collector.cpp:
(JSC::Collector::runFixpointPhase):
(JSC::Collector::runEndPhase):
(JSC::Collector::bytesMarked):
(JSC::Collector::bytesMarkedPerVisitorDump):
(JSC::Collector::bytesVisited): Deleted.
(JSC::Collector::bytesVisitedPerVisitorDump): Deleted.
* Source/JavaScriptCore/heap/Collector.h:
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::beginMarking):
(JSC::Heap::updateOldGenerationCellBytes):
(JSC::Heap::endMarking):
(JSC::Heap::clearConcurrentRetainedDataIfPossible):
(JSC::Heap::recordBytesVisited): Deleted.
* Source/JavaScriptCore/heap/Heap.h:
(JSC::Heap::reportBytesMarked):
(JSC::Heap::reportBytesVisited): Deleted.
* Source/JavaScriptCore/heap/SlotVisitor.cpp:
(JSC::SlotVisitor::didStartMarking):
(JSC::SlotVisitor::reset):
(JSC::SlotVisitor::appendToMarkStack):
(JSC::SlotVisitor::noteLiveAuxiliaryCell):
(JSC::SlotVisitor::noteBytesMarked):
(JSC::SlotVisitor::flushBytesMarked):
(JSC::SlotVisitor::noteBytesVisited): Deleted.
(JSC::SlotVisitor::flushBytesVisited): Deleted.
* Source/JavaScriptCore/heap/SlotVisitor.h:
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::performOpportunisticallyScheduledTasks):
Canonical link: https://commits.webkit.org/323735@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications