You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5b292ff
Browse filesBrowse the repository at this point in the historyBrowse files
[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
0 commit comments