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 4f97164
Browse filesBrowse the repository at this point in the historyBrowse files
[JSC] Remove friend declarations Heap and Collector no longer need
https://bugs.webkit.org/show_bug.cgi?id=328127
rdar://190469351
Reviewed by Vassili Bykov.
Many of Heap's friends reach nothing private, or reach one member that a public
accessor can provide. Unneeded friendships hide which parts of Heap other
classes actually use, so remove them.
Collector drops CollectorThread, a nested class that already has access.
Heap drops 14 friends. These reach nothing private: JIT, DFG::SpeculativeJIT,
CodeBlock, GCLogging, HeapUtil, JITStubRoutine, LLIntOffsetsExtractor,
BlockDirectory, MarkedBlock, IncrementalSweeper, and GCThread, which no longer
exists. These now use public accessors:
- HeapVerifier uses objectSpace() and verifier().
- GCAwareJITStubRoutine registers itself through the new
addGCAwareJITStubRoutine(). It replaces jitStubRoutines(), which nothing
called and which exposed the whole set.
- ConservativeRoots reports the strings it finds on a stack through the new
noteStringFoundOnStack(), instead of reaching into how Heap keeps swapped-out
string buffers alive. The set is renamed m_stringsFoundOnStack, since it
holds every such string, not only those a GCOwnedDataScope reads. Where the
collection epilogue uses it, a comment now says why dropping those buffers is
safe: the set conservatively covers GCOwnedDataScopes, and the collection
parked compiler threads at a safepoint.
No behavior change.
* Source/JavaScriptCore/heap/Collector.h:
* Source/JavaScriptCore/heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::genericAddPointer):
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::addGCAwareJITStubRoutine):
(JSC::Heap::runCollectionEpilogue):
* Source/JavaScriptCore/heap/Heap.h:
(JSC::Heap::jitStubRoutines): Deleted.
(JSC::Heap::noteStringFoundOnStack):
* Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp:
(JSC::GCAwareJITStubRoutine::makeGCAware):
* Source/JavaScriptCore/tools/HeapVerifier.cpp:
(JSC::HeapVerifier::gatherLiveCells):
(JSC::HeapVerifier::checkIfRecorded):
Canonical link: https://commits.webkit.org/324279@main
0 commit comments