Repository navigation
Commit 101392f
committed
[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@main1 parent 501a722 commit 101392f
14 files changed
Lines changed: 81 additions & 92 deletions
File tree
- Source/JavaScriptCore
- SaferCPPExpectations
- heap
- runtime
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
| |||
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
218 | | - | |
| 222 | + | |
219 | 223 | | |
220 | 224 | | |
221 | 225 | | |
| |||
228 | 232 | | |
229 | 233 | | |
230 | 234 | | |
231 | | - | |
| 235 | + | |
232 | 236 | | |
233 | 237 | | |
234 | 238 | | |
| |||
241 | 245 | | |
242 | 246 | | |
243 | 247 | | |
| 248 | + | |
244 | 249 | | |
245 | 250 | | |
246 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 109 | + | |
| 110 | + | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 116 | | |
138 | 117 | | |
139 | 118 | | |
| |||
236 | 215 | | |
237 | 216 | | |
238 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
239 | 224 | | |
240 | 225 | | |
241 | 226 | | |
| 227 | + | |
242 | 228 | | |
243 | 229 | | |
244 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
290 | 291 | | |
291 | 292 | | |
292 | 293 | | |
293 | | - | |
| 294 | + | |
| 295 | + | |
294 | 296 | | |
295 | 297 | | |
296 | 298 | | |
| |||
311 | 313 | | |
312 | 314 | | |
313 | 315 | | |
| 316 | + | |
| 317 | + | |
314 | 318 | | |
315 | 319 | | |
316 | | - | |
| 320 | + | |
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
1800 | 1800 | | |
1801 | 1801 | | |
1802 | 1802 | | |
1803 | | - | |
| 1803 | + | |
1804 | 1804 | | |
1805 | 1805 | | |
1806 | 1806 | | |
| |||
2745 | 2745 | | |
2746 | 2746 | | |
2747 | 2747 | | |
| 2748 | + | |
2748 | 2749 | | |
2749 | 2750 | | |
2750 | 2751 | | |
| 2752 | + | |
2751 | 2753 | | |
2752 | 2754 | | |
2753 | 2755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
0 commit comments