Changeset 235271 in webkit
- Timestamp:
- Aug 23, 2018, 9:10:31 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 170 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Source/JavaScriptCore/API/JSAPIWrapperObject.mm ¶
r226752 r235271 38 38 public: 39 39 void finalize(JSC::Handle<JSC::Unknown>, void*) override; 40 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& ) override;40 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**) override; 41 41 }; 42 42 … … 57 57 } 58 58 59 bool JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor )59 bool JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor, const char**) 60 60 { 61 61 JSC::JSAPIWrapperObject* wrapperObject = JSC::jsCast<JSC::JSAPIWrapperObject*>(handle.get().asCell()); -
TabularUnified trunk/Source/JavaScriptCore/API/JSManagedValue.mm ¶
r233409 r235271 44 44 public: 45 45 void finalize(JSC::Handle<JSC::Unknown>, void* context) override; 46 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& ) override;46 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**) override; 47 47 }; 48 48 … … 183 183 @end 184 184 185 bool JSManagedValueHandleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& visitor )185 bool JSManagedValueHandleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& visitor, const char** reason) 186 186 { 187 if (UNLIKELY(reason)) 188 *reason = "JSManagedValue is opaque root"; 187 189 JSManagedValue *managedValue = (__bridge JSManagedValue *)context; 188 190 return visitor.containsOpaqueRoot((__bridge void*)managedValue); -
TabularUnified trunk/Source/JavaScriptCore/API/glib/JSAPIWrapperObjectGLib.cpp ¶
r229798 r235271 37 37 public: 38 38 void finalize(JSC::Handle<JSC::Unknown>, void*) override; 39 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& ) override;39 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**) override; 40 40 }; 41 41 … … 56 56 } 57 57 58 bool JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor )58 bool JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor, const char**) 59 59 { 60 60 JSC::JSAPIWrapperObject* wrapperObject = JSC::jsCast<JSC::JSAPIWrapperObject*>(handle.get().asCell()); -
TabularUnified trunk/Source/JavaScriptCore/CMakeLists.txt ¶
r234491 r235271 535 535 heap/HeapInlines.h 536 536 heap/HeapObserver.h 537 heap/HeapSnapshotBuilder.h 537 538 heap/IncrementalSweeper.h 538 539 heap/IsoCellSet.h -
TabularUnified trunk/Source/JavaScriptCore/ChangeLog ¶
r235261 r235271 1 2018-08-23 Simon Fraser <simon.fraser@apple.com> 2 3 Add support for dumping GC heap snapshots, and a viewer 4 https://bugs.webkit.org/show_bug.cgi?id=186416 5 6 Reviewed by Joseph Pecoraro. 7 8 Make a way to dump information about the GC heap that is useful for looking for leaked 9 or abandoned objects. This dump is obtained (on Apple platforms) via: 10 notifyutil -p com.apple.WebKit.dumpGCHeap 11 which writes a JSON file to /tmp which can then be loaded into the viewer in Tools/GCHeapInspector. 12 13 This leverages the heap snapshot used by Web Inspector, adding an alternate format for 14 the snapshot JSON that adds additional data about objects and why they are GC roots. 15 16 SlotVisitor maintains a RootMarkReason (via SetRootMarkReasonScope) that allows 17 the HeapSnapshotBuilder to keep track of why a JSCell was treated as a GC root. For 18 objects visited via opaque roots, we record the reason why via a new out param to 19 isReachableFromOpaqueRoots(). 20 21 HeapSnapshotBuilder is enhanced to produce GCDebuggingSnapshot JSON output. This contains 22 additional information including the address of the JSCell* and the wrapped object (for 23 JSDOMWrappers), the root reasons, and for some objects like JSDocument a label which can 24 be the document URL. 25 26 GCDebuggingSnapshots are always full snapshots (previous snapshots are not kept around). 27 28 * API/JSAPIWrapperObject.mm: 29 (JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots): 30 * API/JSManagedValue.mm: 31 (JSManagedValueHandleOwner::isReachableFromOpaqueRoots): 32 * API/glib/JSAPIWrapperObjectGLib.cpp: 33 (JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots): 34 * CMakeLists.txt: 35 * heap/ConservativeRoots.h: 36 (JSC::ConservativeRoots::size const): 37 (JSC::ConservativeRoots::size): Deleted. 38 * heap/Heap.cpp: 39 (JSC::Heap::addCoreConstraints): 40 * heap/HeapSnapshotBuilder.cpp: 41 (JSC::HeapSnapshotBuilder::getNextObjectIdentifier): 42 (JSC::HeapSnapshotBuilder::HeapSnapshotBuilder): 43 (JSC::HeapSnapshotBuilder::~HeapSnapshotBuilder): 44 (JSC::HeapSnapshotBuilder::buildSnapshot): 45 (JSC::HeapSnapshotBuilder::appendNode): 46 (JSC::HeapSnapshotBuilder::appendEdge): 47 (JSC::HeapSnapshotBuilder::setOpaqueRootReachabilityReasonForCell): 48 (JSC::HeapSnapshotBuilder::setWrappedObjectForCell): 49 (JSC::HeapSnapshotBuilder::previousSnapshotHasNodeForCell): 50 (JSC::snapshotTypeToString): 51 (JSC::rootTypeToString): 52 (JSC::HeapSnapshotBuilder::setLabelForCell): 53 (JSC::HeapSnapshotBuilder::descriptionForCell const): 54 (JSC::HeapSnapshotBuilder::json): 55 (JSC::HeapSnapshotBuilder::hasExistingNodeForCell): Deleted. 56 * heap/HeapSnapshotBuilder.h: 57 * heap/SlotVisitor.cpp: 58 (JSC::SlotVisitor::appendSlow): 59 * heap/SlotVisitor.h: 60 (JSC::SlotVisitor::heapSnapshotBuilder const): 61 (JSC::SlotVisitor::rootMarkReason const): 62 (JSC::SlotVisitor::setRootMarkReason): 63 (JSC::SetRootMarkReasonScope::SetRootMarkReasonScope): 64 (JSC::SetRootMarkReasonScope::~SetRootMarkReasonScope): 65 * heap/WeakBlock.cpp: 66 (JSC::WeakBlock::specializedVisit): 67 * heap/WeakHandleOwner.cpp: 68 (JSC::WeakHandleOwner::isReachableFromOpaqueRoots): 69 * heap/WeakHandleOwner.h: 70 * runtime/SimpleTypedArrayController.cpp: 71 (JSC::SimpleTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): 72 * runtime/SimpleTypedArrayController.h: 73 * tools/JSDollarVM.cpp: 74 1 75 2018-08-23 Saam barati <sbarati@apple.com> 2 76 -
TabularUnified trunk/Source/JavaScriptCore/heap/ConservativeRoots.h ¶
r226783 r235271 42 42 void add(void* begin, void* end, JITStubRoutineSet&, CodeBlockSet&); 43 43 44 size_t size() ;44 size_t size() const; 45 45 HeapCell** roots(); 46 46 … … 64 64 }; 65 65 66 inline size_t ConservativeRoots::size() 66 inline size_t ConservativeRoots::size() const 67 67 { 68 68 return m_size; -
TabularUnified trunk/Source/JavaScriptCore/heap/Heap.cpp ¶
r235261 r235271 2642 2642 TimingScope preConvergenceTimingScope(*this, "Constraint: conservative scan"); 2643 2643 m_objectSpace.prepareForConservativeScan(); 2644 2644 2645 ConservativeRoots conservativeRoots(*this); 2645 2646 SuperSamplerScope superSamplerScope(false); 2647 2646 2648 gatherStackRoots(conservativeRoots); 2647 2649 gatherJSStackRoots(conservativeRoots); 2648 2650 gatherScratchBufferRoots(conservativeRoots); 2651 2652 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::ConservativeScan); 2649 2653 slotVisitor.append(conservativeRoots); 2650 2654 … … 2656 2660 "Msr", "Misc Small Roots", 2657 2661 [this] (SlotVisitor& slotVisitor) { 2662 2658 2663 #if JSC_OBJC_API_ENABLED 2659 2664 scanExternalRememberedSet(*m_vm, slotVisitor); 2660 2665 #endif 2661 2662 if (m_vm->smallStrings.needsToBeVisited(*m_collectionScope))2666 if (m_vm->smallStrings.needsToBeVisited(*m_collectionScope)) { 2667 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::StrongReferences); 2663 2668 m_vm->smallStrings.visitStrongReferences(slotVisitor); 2669 } 2664 2670 2665 for (auto& pair : m_protectedValues) 2666 slotVisitor.appendUnbarriered(pair.key); 2671 { 2672 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::ProtectedValues); 2673 for (auto& pair : m_protectedValues) 2674 slotVisitor.appendUnbarriered(pair.key); 2675 } 2667 2676 2668 if (m_markListSet && m_markListSet->size()) 2677 if (m_markListSet && m_markListSet->size()) { 2678 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::ConservativeScan); 2669 2679 MarkedArgumentBuffer::markLists(slotVisitor, *m_markListSet); 2670 2671 slotVisitor.appendUnbarriered(m_vm->exception()); 2672 slotVisitor.appendUnbarriered(m_vm->lastException()); 2680 } 2681 2682 { 2683 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::VMExceptions); 2684 slotVisitor.appendUnbarriered(m_vm->exception()); 2685 slotVisitor.appendUnbarriered(m_vm->lastException()); 2686 } 2673 2687 }, 2674 2688 ConstraintVolatility::GreyedByExecution); … … 2677 2691 "Sh", "Strong Handles", 2678 2692 [this] (SlotVisitor& slotVisitor) { 2693 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::StrongHandles); 2679 2694 m_handleSet.visitStrongHandles(slotVisitor); 2680 2695 }, … … 2684 2699 "D", "Debugger", 2685 2700 [this] (SlotVisitor& slotVisitor) { 2701 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::Debugger); 2702 2686 2703 #if ENABLE(SAMPLING_PROFILER) 2687 2704 if (SamplingProfiler* samplingProfiler = m_vm->samplingProfiler()) { … … 2693 2710 } 2694 2711 #endif // ENABLE(SAMPLING_PROFILER) 2695 2712 2696 2713 if (m_vm->typeProfiler()) 2697 2714 m_vm->typeProfilerLog()->visit(slotVisitor); … … 2704 2721 "Jsr", "JIT Stub Routines", 2705 2722 [this] (SlotVisitor& slotVisitor) { 2723 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::JITStubRoutines); 2706 2724 m_jitStubRoutines->traceMarkedStubRoutines(slotVisitor); 2707 2725 }, … … 2711 2729 "Ws", "Weak Sets", 2712 2730 [this] (SlotVisitor& slotVisitor) { 2731 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::WeakSets); 2713 2732 m_objectSpace.visitWeakSets(slotVisitor); 2714 2733 }, … … 2719 2738 [] (SlotVisitor& slotVisitor) { 2720 2739 VM& vm = slotVisitor.vm(); 2721 2740 2722 2741 auto callOutputConstraint = [] (SlotVisitor& slotVisitor, HeapCell* heapCell, HeapCell::Kind) { 2742 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::Output); 2723 2743 VM& vm = slotVisitor.vm(); 2724 2744 JSCell* cell = static_cast<JSCell*>(heapCell); … … 2740 2760 "Dw", "DFG Worklists", 2741 2761 [this] (SlotVisitor& slotVisitor) { 2762 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::DFGWorkLists); 2763 2742 2764 for (unsigned i = DFG::numberOfWorklists(); i--;) 2743 2765 DFG::existingWorklistForIndex(i).visitWeakReferences(slotVisitor); … … 2760 2782 "Cb", "CodeBlocks", 2761 2783 [this] (SlotVisitor& slotVisitor) { 2784 SetRootMarkReasonScope rootScope(slotVisitor, SlotVisitor::RootMarkReason::CodeBlocks); 2762 2785 iterateExecutingAndCompilingCodeBlocksWithoutHoldingLocks( 2763 2786 [&] (CodeBlock* codeBlock) { -
TabularUnified trunk/Source/JavaScriptCore/heap/HeapSnapshotBuilder.cpp ¶
r234082 r235271 38 38 39 39 namespace JSC { 40 41 unsigned HeapSnapshotBuilder::nextAvailableObjectIdentifier = 1; 42 unsigned HeapSnapshotBuilder::getNextObjectIdentifier() { return nextAvailableObjectIdentifier++; } 40 41 static const char* rootTypeToString(SlotVisitor::RootMarkReason); 42 43 NodeIdentifier HeapSnapshotBuilder::nextAvailableObjectIdentifier = 1; 44 NodeIdentifier HeapSnapshotBuilder::getNextObjectIdentifier() { return nextAvailableObjectIdentifier++; } 43 45 void HeapSnapshotBuilder::resetNextAvailableObjectIdentifier() { HeapSnapshotBuilder::nextAvailableObjectIdentifier = 1; } 44 46 45 HeapSnapshotBuilder::HeapSnapshotBuilder(HeapProfiler& profiler )47 HeapSnapshotBuilder::HeapSnapshotBuilder(HeapProfiler& profiler, SnapshotType type) 46 48 : m_profiler(profiler) 49 , m_snapshotType(type) 47 50 { 48 51 } … … 50 53 HeapSnapshotBuilder::~HeapSnapshotBuilder() 51 54 { 55 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot) 56 m_profiler.clearSnapshots(); 52 57 } 53 58 54 59 void HeapSnapshotBuilder::buildSnapshot() 55 60 { 61 // GCDebuggingSnapshot are always full snapshots, so clear any existing snapshots. 62 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot) 63 m_profiler.clearSnapshots(); 64 56 65 PreventCollectionScope preventCollectionScope(m_profiler.vm().heap); 57 66 58 67 m_snapshot = std::make_unique<HeapSnapshot>(m_profiler.mostRecentSnapshot()); 59 68 { … … 70 79 { 71 80 ASSERT(m_profiler.activeSnapshotBuilder() == this); 81 72 82 ASSERT(Heap::isMarked(cell)); 73 83 74 if (hasExistingNodeForCell(cell)) 84 NodeIdentifier identifier; 85 if (previousSnapshotHasNodeForCell(cell, identifier)) 75 86 return; 76 87 77 88 std::lock_guard<Lock> lock(m_buildingNodeMutex); 78 79 89 m_snapshot->appendNode(HeapSnapshotNode(cell, getNextObjectIdentifier())); 80 90 } 81 91 82 void HeapSnapshotBuilder::appendEdge(JSCell* from, JSCell* to )92 void HeapSnapshotBuilder::appendEdge(JSCell* from, JSCell* to, SlotVisitor::RootMarkReason rootMarkReason) 83 93 { 84 94 ASSERT(m_profiler.activeSnapshotBuilder() == this); … … 91 101 std::lock_guard<Lock> lock(m_buildingEdgeMutex); 92 102 103 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot && !from) { 104 if (rootMarkReason == SlotVisitor::RootMarkReason::None && m_snapshotType == SnapshotType::GCDebuggingSnapshot) 105 WTFLogAlways("Cell %p is a root but no root marking reason was supplied", to); 106 107 m_rootData.ensure(to, [] () -> RootData { 108 return { }; 109 }).iterator->value.markReason = rootMarkReason; 110 } 111 93 112 m_edges.append(HeapSnapshotEdge(from, to)); 94 113 } … … 124 143 } 125 144 126 bool HeapSnapshotBuilder::hasExistingNodeForCell(JSCell* cell) 145 void HeapSnapshotBuilder::setOpaqueRootReachabilityReasonForCell(JSCell* cell, const char* reason) 146 { 147 if (!reason || !*reason || m_snapshotType != SnapshotType::GCDebuggingSnapshot) 148 return; 149 150 m_rootData.ensure(cell, [] () -> RootData { 151 return { }; 152 }).iterator->value.reachabilityFromOpaqueRootReasons = reason; 153 } 154 155 void HeapSnapshotBuilder::setWrappedObjectForCell(JSCell* cell, void* wrappedPtr) 156 { 157 m_wrappedObjectPointers.set(cell, wrappedPtr); 158 } 159 160 bool HeapSnapshotBuilder::previousSnapshotHasNodeForCell(JSCell* cell, NodeIdentifier& identifier) 127 161 { 128 162 if (!m_snapshot->previous()) 129 163 return false; 130 164 131 return !!m_snapshot->previous()->nodeForCell(cell); 132 } 133 165 auto existingNode = m_snapshot->previous()->nodeForCell(cell); 166 if (existingNode) { 167 identifier = existingNode.value().identifier; 168 return true; 169 } 170 171 return false; 172 } 134 173 135 174 // Heap Snapshot JSON Format: 175 // 176 // Inspector snapshots: 136 177 // 137 178 // { 138 179 // "version": 1.0, 180 // "type": "Inspector", 181 // // [<address>, <labelIndex>, <wrappedEddress>] only present in GCDebuggingSnapshot-type snapshots 139 182 // "nodes": [ 140 // <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <internal> ,141 // <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <internal> ,183 // <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <internal> 184 // <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <internal> 142 185 // ... 143 186 // ], … … 158 201 // } 159 202 // 203 // GC heap debugger snapshots: 204 // 205 // { 206 // "version": 1.0, 207 // "type": "GCDebugging", 208 // "nodes": [ 209 // <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <internal>, <labelIndex>, <cellEddress>, <wrappedEddress>, 210 // <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <internal>, <labelIndex>, <cellEddress>, <wrappedEddress>, 211 // ... 212 // ], 213 // "nodeClassNames": [ 214 // "string", "Structure", "Object", ... 215 // ], 216 // "edges": [ 217 // <fromNodeId>, <toNodeId>, <edgeTypeIndex>, <edgeExtraData>, 218 // <fromNodeId>, <toNodeId>, <edgeTypeIndex>, <edgeExtraData>, 219 // ... 220 // ], 221 // "edgeTypes": [ 222 // "Internal", "Property", "Index", "Variable" 223 // ], 224 // "edgeNames": [ 225 // "propertyName", "variableName", ... 226 // ], 227 // "roots" : [ 228 // <nodeId>, <rootReasonIndex>, <reachabilityReasonIndex>, 229 // <nodeId>, <rootReasonIndex>, <reachabilityReasonIndex>, 230 // ... // <nodeId> may be repeated 231 // ], 232 // "labels" : [ 233 // "foo", "bar", ... 234 // ] 235 // } 236 // 160 237 // Notes: 161 238 // … … 173 250 // - for Index edges this is the index value. 174 251 // - for Property or Variable edges this is an index into the "edgeNames" list. 252 // 253 // <rootReasonIndex> 254 // - index into the "labels" list. 175 255 176 256 static uint8_t edgeTypeToNumber(EdgeType type) … … 195 275 } 196 276 277 static const char* snapshotTypeToString(HeapSnapshotBuilder::SnapshotType type) 278 { 279 switch (type) { 280 case HeapSnapshotBuilder::SnapshotType::InspectorSnapshot: 281 return "Inspector"; 282 case HeapSnapshotBuilder::SnapshotType::GCDebuggingSnapshot: 283 return "GCDebugging"; 284 } 285 ASSERT_NOT_REACHED(); 286 return "Inspector"; 287 } 288 289 static const char* rootTypeToString(SlotVisitor::RootMarkReason type) 290 { 291 switch (type) { 292 case SlotVisitor::RootMarkReason::None: 293 return "None"; 294 case SlotVisitor::RootMarkReason::ConservativeScan: 295 return "Conservative scan"; 296 case SlotVisitor::RootMarkReason::StrongReferences: 297 return "Strong references"; 298 case SlotVisitor::RootMarkReason::ProtectedValues: 299 return "Protected values"; 300 case SlotVisitor::RootMarkReason::MarkListSet: 301 return "Mark list set"; 302 case SlotVisitor::RootMarkReason::VMExceptions: 303 return "VM exceptions"; 304 case SlotVisitor::RootMarkReason::StrongHandles: 305 return "Strong handles"; 306 case SlotVisitor::RootMarkReason::Debugger: 307 return "Debugger"; 308 case SlotVisitor::RootMarkReason::JITStubRoutines: 309 return "JIT stub routines"; 310 case SlotVisitor::RootMarkReason::WeakSets: 311 return "Weak sets"; 312 case SlotVisitor::RootMarkReason::Output: 313 return "Output"; 314 case SlotVisitor::RootMarkReason::DFGWorkLists: 315 return "DFG work lists"; 316 case SlotVisitor::RootMarkReason::CodeBlocks: 317 return "Code blocks"; 318 case SlotVisitor::RootMarkReason::DOMGCOutput: 319 return "DOM GC output"; 320 } 321 ASSERT_NOT_REACHED(); 322 return "None"; 323 } 324 197 325 String HeapSnapshotBuilder::json() 198 326 { 199 327 return json([] (const HeapSnapshotNode&) { return true; }); 328 } 329 330 void HeapSnapshotBuilder::setLabelForCell(JSCell* cell, const String& label) 331 { 332 m_cellLabels.set(cell, label); 333 } 334 335 String HeapSnapshotBuilder::descriptionForCell(JSCell *cell) const 336 { 337 if (cell->isString()) 338 return emptyString(); // FIXME: get part of string. 339 340 VM& vm = m_profiler.vm(); 341 Structure* structure = cell->structure(vm); 342 343 if (structure->classInfo()->isSubClassOf(Structure::info())) { 344 Structure* cellAsStructure = jsCast<Structure*>(cell); 345 return cellAsStructure->classInfo()->className; 346 } 347 348 return emptyString(); 200 349 } 201 350 … … 206 355 207 356 // Build a node to identifier map of allowed nodes to use when serializing edges. 208 HashMap<JSCell*, unsigned> allowedNodeIdentifiers;357 HashMap<JSCell*, NodeIdentifier> allowedNodeIdentifiers; 209 358 210 359 // Build a list of used class names. … … 213 362 unsigned nextClassNameIndex = 1; 214 363 364 // Build a list of labels (this is just a string table). 365 HashMap<String, unsigned> labelIndexes; 366 labelIndexes.set(emptyString(), 0); 367 unsigned nextLabelIndex = 1; 368 215 369 // Build a list of used edge names. 216 370 HashMap<UniquedStringImpl*, unsigned> edgeNameIndexes; … … 232 386 233 387 bool isInternal = false; 388 void* wrappedAddress = 0; 389 unsigned labelIndex = 0; 234 390 if (!node.cell->isString()) { 235 391 Structure* structure = node.cell->structure(vm); 236 392 isInternal = !structure || !structure->globalObject(); 237 } 238 239 // <nodeId>, <sizeInBytes>, <className>, <optionalInternalBoolean> 393 394 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot) { 395 String nodeLabel; 396 auto it = m_cellLabels.find(node.cell); 397 if (it != m_cellLabels.end()) 398 nodeLabel = it->value; 399 400 if (nodeLabel.isEmpty()) { 401 if (auto* object = jsDynamicCast<JSObject*>(vm, node.cell)) { 402 if (auto* function = jsDynamicCast<JSFunction*>(vm, object)) 403 nodeLabel = function->calculatedDisplayName(vm); 404 } 405 } 406 407 String description = descriptionForCell(node.cell); 408 if (description.length()) { 409 if (nodeLabel.length()) 410 nodeLabel.append(' '); 411 nodeLabel.append(description); 412 } 413 414 if (!nodeLabel.isEmpty() && m_snapshotType == SnapshotType::GCDebuggingSnapshot) { 415 auto result = labelIndexes.add(nodeLabel, nextLabelIndex); 416 if (result.isNewEntry) 417 nextLabelIndex++; 418 labelIndex = result.iterator->value; 419 } 420 421 wrappedAddress = m_wrappedObjectPointers.get(node.cell); 422 } 423 } 424 425 // <nodeId>, <sizeInBytes>, <nodeClassNameIndex>, <internal>, [<labelIndex>, <cellEddress>, <wrappedEddress>] 240 426 json.append(','); 241 427 json.appendNumber(node.identifier); … … 246 432 json.append(','); 247 433 json.append(isInternal ? '1' : '0'); 434 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot) { 435 json.append(','); 436 json.appendNumber(labelIndex); 437 json.append(','); 438 json.append(String::format("\"%p\"", node.cell)); // FIXME: Should add StringBuilder::appendAddress(void*). 439 json.append(','); 440 json.append(String::format("\"%p\"", wrappedAddress)); 441 } 248 442 }; 249 443 … … 286 480 json.appendLiteral("\"version\":1"); 287 481 482 // type 483 json.append(','); 484 json.appendLiteral("\"type\":"); 485 json.appendQuotedJSONString(snapshotTypeToString(m_snapshotType)); 486 288 487 // nodes 289 488 json.append(','); 290 489 json.appendLiteral("\"nodes\":"); 291 490 json.append('['); 292 json.appendLiteral("0,0,0,0"); // <root> 491 // <root> 492 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot) 493 json.appendLiteral("0,0,0,0,0,\"0x0\",\"0x0\""); 494 else 495 json.appendLiteral("0,0,0,0"); 496 293 497 for (HeapSnapshot* snapshot = m_profiler.mostRecentSnapshot(); snapshot; snapshot = snapshot->previous()) { 294 498 for (auto& node : snapshot->m_nodes) … … 324 528 else { 325 529 auto fromLookup = allowedNodeIdentifiers.find(edge.from.cell); 326 if (fromLookup == allowedNodeIdentifiers.end()) 530 if (fromLookup == allowedNodeIdentifiers.end()) { 531 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot) 532 WTFLogAlways("Failed to find node for from-edge cell %p", edge.from.cell); 327 533 return true; 534 } 328 535 edge.from.identifier = fromLookup->value; 329 536 } … … 333 540 else { 334 541 auto toLookup = allowedNodeIdentifiers.find(edge.to.cell); 335 if (toLookup == allowedNodeIdentifiers.end()) 542 if (toLookup == allowedNodeIdentifiers.end()) { 543 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot) 544 WTFLogAlways("Failed to find node for to-edge cell %p", edge.to.cell); 336 545 return true; 546 } 337 547 edge.to.identifier = toLookup->value; 338 548 } … … 340 550 return false; 341 551 }); 552 342 553 allowedNodeIdentifiers.clear(); 343 554 m_edges.shrinkToFit(); … … 387 598 json.append(']'); 388 599 600 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot) { 601 json.append(','); 602 json.appendLiteral("\"roots\":"); 603 json.append('['); 604 605 HeapSnapshot* snapshot = m_profiler.mostRecentSnapshot(); 606 607 bool firstNode = true; 608 for (auto it : m_rootData) { 609 auto snapshotNode = snapshot->nodeForCell(it.key); 610 if (!snapshotNode) { 611 WTFLogAlways("Failed to find snapshot node for cell %p", it.key); 612 continue; 613 } 614 615 if (!firstNode) 616 json.append(','); 617 618 firstNode = false; 619 json.appendNumber(snapshotNode.value().identifier); 620 621 // Maybe we should just always encode the root names. 622 const char* rootName = rootTypeToString(it.value.markReason); 623 auto result = labelIndexes.add(rootName, nextLabelIndex); 624 if (result.isNewEntry) 625 nextLabelIndex++; 626 unsigned labelIndex = result.iterator->value; 627 json.append(','); 628 json.appendNumber(labelIndex); 629 630 unsigned reachabilityReasonIndex = 0; 631 if (it.value.reachabilityFromOpaqueRootReasons) { 632 auto result = labelIndexes.add(it.value.reachabilityFromOpaqueRootReasons, nextLabelIndex); 633 if (result.isNewEntry) 634 nextLabelIndex++; 635 reachabilityReasonIndex = result.iterator->value; 636 } 637 json.append(','); 638 json.appendNumber(reachabilityReasonIndex); 639 } 640 641 json.append(']'); 642 } 643 644 if (m_snapshotType == SnapshotType::GCDebuggingSnapshot) { 645 // internal node descriptions 646 json.append(','); 647 json.appendLiteral("\"labels\":"); 648 json.append('['); 649 650 Vector<String> orderedLabels(labelIndexes.size()); 651 for (auto& entry : labelIndexes) 652 orderedLabels[entry.value] = entry.key; 653 labelIndexes.clear(); 654 bool firstLabel = true; 655 for (auto& label : orderedLabels) { 656 if (!firstLabel) 657 json.append(','); 658 659 firstLabel = false; 660 json.appendQuotedJSONString(label); 661 } 662 orderedLabels.clear(); 663 664 json.append(']'); 665 } 666 389 667 json.append('}'); 390 668 return json.toString(); -
TabularUnified trunk/Source/JavaScriptCore/heap/HeapSnapshotBuilder.h ¶
r234082 r235271 26 26 #pragma once 27 27 28 #include "SlotVisitor.h" 28 29 #include <functional> 29 30 #include <wtf/Lock.h> … … 34 35 namespace JSC { 35 36 37 class ConservativeRoots; 36 38 class HeapProfiler; 37 39 class HeapSnapshot; 38 40 class JSCell; 41 42 typedef unsigned NodeIdentifier; 39 43 40 44 struct HeapSnapshotNode { … … 45 49 46 50 JSCell* cell; 47 unsignedidentifier;51 NodeIdentifier identifier; 48 52 }; 49 53 … … 83 87 union { 84 88 JSCell *cell; 85 unsignedidentifier;89 NodeIdentifier identifier; 86 90 } from; 87 91 88 92 union { 89 93 JSCell *cell; 90 unsignedidentifier;94 NodeIdentifier identifier; 91 95 } to; 92 96 … … 102 106 WTF_MAKE_FAST_ALLOCATED; 103 107 public: 104 HeapSnapshotBuilder(HeapProfiler&); 108 enum SnapshotType { InspectorSnapshot, GCDebuggingSnapshot }; 109 110 HeapSnapshotBuilder(HeapProfiler&, SnapshotType = SnapshotType::InspectorSnapshot); 105 111 ~HeapSnapshotBuilder(); 106 112 107 static unsigned nextAvailableObjectIdentifier;108 static unsigned getNextObjectIdentifier();109 113 static void resetNextAvailableObjectIdentifier(); 110 114 … … 112 116 void buildSnapshot(); 113 117 114 // A marked cell.118 // A root or marked cell. 115 119 void appendNode(JSCell*); 116 120 117 121 // A reference from one cell to another. 118 void appendEdge(JSCell* from, JSCell* to );122 void appendEdge(JSCell* from, JSCell* to, SlotVisitor::RootMarkReason); 119 123 void appendPropertyNameEdge(JSCell* from, JSCell* to, UniquedStringImpl* propertyName); 120 124 void appendVariableNameEdge(JSCell* from, JSCell* to, UniquedStringImpl* variableName); 121 125 void appendIndexEdge(JSCell* from, JSCell* to, uint32_t index); 126 127 void setOpaqueRootReachabilityReasonForCell(JSCell*, const char*); 128 void setWrappedObjectForCell(JSCell*, void*); 129 void setLabelForCell(JSCell*, const String&); 122 130 123 131 String json(); … … 125 133 126 134 private: 135 static NodeIdentifier nextAvailableObjectIdentifier; 136 static NodeIdentifier getNextObjectIdentifier(); 137 127 138 // Finalized snapshots are not modified during building. So searching them 128 139 // for an existing node can be done concurrently without a lock. 129 bool hasExistingNodeForCell(JSCell*); 130 140 bool previousSnapshotHasNodeForCell(JSCell*, NodeIdentifier&); 141 142 String descriptionForCell(JSCell*) const; 143 144 struct RootData { 145 const char* reachabilityFromOpaqueRootReasons { nullptr }; 146 SlotVisitor::RootMarkReason markReason { SlotVisitor::RootMarkReason::None }; 147 }; 148 131 149 HeapProfiler& m_profiler; 132 150 … … 136 154 Lock m_buildingEdgeMutex; 137 155 Vector<HeapSnapshotEdge> m_edges; 156 HashMap<JSCell*, RootData> m_rootData; 157 HashMap<JSCell*, void*> m_wrappedObjectPointers; 158 HashMap<JSCell*, String> m_cellLabels; 159 SnapshotType m_snapshotType; 138 160 }; 139 161 -
TabularUnified trunk/Source/JavaScriptCore/heap/SlotVisitor.cpp ¶
r233236 r235271 226 226 { 227 227 if (UNLIKELY(m_heapSnapshotBuilder)) 228 m_heapSnapshotBuilder->appendEdge(m_currentCell, cell );228 m_heapSnapshotBuilder->appendEdge(m_currentCell, cell, m_rootMarkReason); 229 229 230 230 appendHiddenSlowImpl(cell, dependency); -
TabularUnified trunk/Source/JavaScriptCore/heap/SlotVisitor.h ¶
r232443 r235271 58 58 59 59 public: 60 enum RootMarkReason { 61 None, 62 ConservativeScan, 63 StrongReferences, 64 ProtectedValues, 65 MarkListSet, 66 VMExceptions, 67 StrongHandles, 68 Debugger, 69 JITStubRoutines, 70 WeakSets, 71 Output, 72 DFGWorkLists, 73 CodeBlocks, 74 DOMGCOutput, 75 }; 76 60 77 SlotVisitor(Heap&, CString codeName); 61 78 ~SlotVisitor(); … … 143 160 144 161 bool isBuildingHeapSnapshot() const { return !!m_heapSnapshotBuilder; } 145 162 HeapSnapshotBuilder* heapSnapshotBuilder() const { return m_heapSnapshotBuilder; } 163 164 RootMarkReason rootMarkReason() const { return m_rootMarkReason; } 165 void setRootMarkReason(RootMarkReason reason) { m_rootMarkReason = reason; } 166 146 167 HeapVersion markingVersion() const { return m_markingVersion; } 147 168 … … 225 246 HeapSnapshotBuilder* m_heapSnapshotBuilder { nullptr }; 226 247 JSCell* m_currentCell { nullptr }; 248 RootMarkReason m_rootMarkReason { RootMarkReason::None }; 227 249 bool m_isFirstVisit { false }; 228 250 bool m_mutatorIsStopped { false }; … … 263 285 }; 264 286 287 class SetRootMarkReasonScope { 288 public: 289 SetRootMarkReasonScope(SlotVisitor& visitor, SlotVisitor::RootMarkReason reason) 290 : m_visitor(visitor) 291 , m_previousReason(visitor.rootMarkReason()) 292 { 293 m_visitor.setRootMarkReason(reason); 294 } 295 296 ~SetRootMarkReasonScope() 297 { 298 m_visitor.setRootMarkReason(m_previousReason); 299 } 300 301 private: 302 SlotVisitor& m_visitor; 303 SlotVisitor::RootMarkReason m_previousReason; 304 }; 305 265 306 } // namespace JSC -
TabularUnified trunk/Source/JavaScriptCore/heap/WeakBlock.cpp ¶
r225524 r235271 29 29 #include "CellContainerInlines.h" 30 30 #include "Heap.h" 31 #include "HeapSnapshotBuilder.h" 31 32 #include "JSCInlines.h" 32 33 #include "JSObject.h" … … 115 116 continue; 116 117 117 if (!weakHandleOwner->isReachableFromOpaqueRoots(Handle<Unknown>::wrapSlot(&const_cast<JSValue&>(jsValue)), weakImpl->context(), visitor)) 118 const char* reason = ""; 119 const char** reasonPtr = nullptr; 120 if (UNLIKELY(visitor.isBuildingHeapSnapshot())) 121 reasonPtr = &reason; 122 123 if (!weakHandleOwner->isReachableFromOpaqueRoots(Handle<Unknown>::wrapSlot(&const_cast<JSValue&>(jsValue)), weakImpl->context(), visitor, reasonPtr)) 118 124 continue; 119 125 120 126 visitor.appendUnbarriered(jsValue); 127 128 if (UNLIKELY(visitor.isBuildingHeapSnapshot())) { 129 if (jsValue.isCell()) 130 visitor.heapSnapshotBuilder()->setOpaqueRootReachabilityReasonForCell(jsValue.asCell(), *reasonPtr); 131 } 121 132 } 122 133 } -
TabularUnified trunk/Source/JavaScriptCore/heap/WeakHandleOwner.cpp ¶
r190113 r235271 38 38 } 39 39 40 bool WeakHandleOwner::isReachableFromOpaqueRoots(Handle<Unknown>, void*, SlotVisitor& )40 bool WeakHandleOwner::isReachableFromOpaqueRoots(Handle<Unknown>, void*, SlotVisitor&, const char**) 41 41 { 42 42 return false; -
TabularUnified trunk/Source/JavaScriptCore/heap/WeakHandleOwner.h ¶
r206525 r235271 35 35 public: 36 36 virtual ~WeakHandleOwner(); 37 virtual bool isReachableFromOpaqueRoots(Handle<Unknown>, void* context, SlotVisitor&); 37 // reason will only be non-null when generating a debug GC heap snapshot. 38 virtual bool isReachableFromOpaqueRoots(Handle<Unknown>, void* context, SlotVisitor&, char const** reason = nullptr); 38 39 virtual void finalize(Handle<Unknown>, void* context); 39 40 }; -
TabularUnified trunk/Source/JavaScriptCore/runtime/SimpleTypedArrayController.cpp ¶
r208209 r235271 59 59 } 60 60 61 bool SimpleTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor )61 bool SimpleTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor, const char** reason) 62 62 { 63 if (UNLIKELY(reason)) 64 *reason = "JSArrayBuffer is opaque root"; 63 65 auto& wrapper = *JSC::jsCast<JSC::JSArrayBuffer*>(handle.slot()->asCell()); 64 66 return visitor.containsOpaqueRoot(wrapper.impl()); -
TabularUnified trunk/Source/JavaScriptCore/runtime/SimpleTypedArrayController.h ¶
r208209 r235271 59 59 class JSArrayBufferOwner : public WeakHandleOwner { 60 60 public: 61 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, SlotVisitor& ) override;61 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, SlotVisitor&, const char** reason) override; 62 62 void finalize(JSC::Handle<JSC::Unknown>, void* context) override; 63 63 }; -
TabularUnified trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp ¶
r234728 r235271 173 173 class ElementHandleOwner : public WeakHandleOwner { 174 174 public: 175 bool isReachableFromOpaqueRoots(Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) override 176 { 175 bool isReachableFromOpaqueRoots(Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) override 176 { 177 if (UNLIKELY(reason)) 178 *reason = "JSC::Element is opaque root"; 177 179 Element* element = jsCast<Element*>(handle.slot()->asCell()); 178 180 return visitor.containsOpaqueRoot(element->root()); -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r235268 r235271 1 2018-08-23 Simon Fraser <simon.fraser@apple.com> 2 3 Add support for dumping GC heap snapshots, and a viewer 4 https://bugs.webkit.org/show_bug.cgi?id=186416 5 6 Reviewed by Joseph Pecoraro. 7 8 Make a way to dump information about the GC heap that is useful for looking for leaked 9 or abandoned objects. This dump is obtained (on Apple platforms) via: 10 notifyutil -p com.apple.WebKit.dumpGCHeap 11 which writes a JSON file to /tmp which can then be loaded into the viewer in Tools/GCHeapInspector. 12 13 This leverages the heap snapshot used by Web Inspector, adding an alternate format for 14 the snapshot JSON that adds additional data about objects and why they are GC roots. 15 16 The generated bindings code is changed to include the output root reason from isReachableFromOpaqueRoots(), 17 and to implement heapSnapshot() which provides the address of the wrapped object. A new IDL attribute, 18 CustomHeapSnapshot, is used to allow custom heapSnapshot() implementations for classes like JSDocument 19 that need to decorate the heap snapshot cell data with things like the document URL. 20 21 GCController registers a notifyutil callback which gathers the debug heap snapshot, and dumps it 22 to a file in /tmp. The file path is printed out to the system log. 23 24 * bindings/js/DOMGCOutputConstraint.cpp: 25 (WebCore::DOMGCOutputConstraint::executeImpl): 26 * bindings/js/GCController.cpp: 27 (WebCore::GCController::GCController): 28 (WebCore::GCController::dumpHeap): 29 * bindings/js/GCController.h: 30 * bindings/js/JSCSSRuleListCustom.cpp: 31 (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots): 32 * bindings/js/JSCallbackData.cpp: 33 (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots): 34 * bindings/js/JSCallbackData.h: 35 * bindings/js/JSCanvasRenderingContext2DCustom.cpp: 36 (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots): 37 * bindings/js/JSDOMWindowCustom.cpp: 38 (WebCore::JSDOMWindow::getOwnPropertySlot): 39 (WebCore::JSDOMWindow::heapSnapshot): 40 * bindings/js/JSDeprecatedCSSOMValueCustom.cpp: 41 (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots): 42 * bindings/js/JSDocumentCustom.cpp: 43 (WebCore::JSDocument::heapSnapshot): 44 * bindings/js/JSMicrotaskCallback.h: 45 (WebCore::JSMicrotaskCallback::call): 46 * bindings/js/JSMutationObserverCustom.cpp: 47 (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): 48 * bindings/js/JSNavigatorCustom.cpp: 49 (WebCore::JSNavigator::visitAdditionalChildren): 50 * bindings/js/JSNodeCustom.cpp: 51 (WebCore::isReachableFromDOM): 52 (WebCore::JSNodeOwner::isReachableFromOpaqueRoots): 53 * bindings/js/JSNodeListCustom.cpp: 54 (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots): 55 * bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp: 56 (WebCore::JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots): 57 * bindings/js/JSPerformanceObserverCustom.cpp: 58 (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots): 59 * bindings/js/JSPopStateEventCustom.cpp: 60 * bindings/js/JSTextTrackCueCustom.cpp: 61 (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots): 62 * bindings/js/WebCoreTypedArrayController.cpp: 63 (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): 64 * bindings/js/WebCoreTypedArrayController.h: 65 * bindings/scripts/CodeGeneratorJS.pm: 66 (GenerateHeader): 67 (GenerateImplementation): 68 * bindings/scripts/IDLAttributes.json: 69 * bindings/scripts/test/JS/JSInterfaceName.cpp: 70 (WebCore::JSInterfaceName::heapSnapshot): 71 (WebCore::JSInterfaceNameOwner::isReachableFromOpaqueRoots): 72 * bindings/scripts/test/JS/JSInterfaceName.h: 73 * bindings/scripts/test/JS/JSMapLike.cpp: 74 (WebCore::JSMapLike::heapSnapshot): 75 (WebCore::JSMapLikeOwner::isReachableFromOpaqueRoots): 76 * bindings/scripts/test/JS/JSMapLike.h: 77 * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: 78 (WebCore::JSReadOnlyMapLike::heapSnapshot): 79 (WebCore::JSReadOnlyMapLikeOwner::isReachableFromOpaqueRoots): 80 * bindings/scripts/test/JS/JSReadOnlyMapLike.h: 81 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: 82 (WebCore::JSTestActiveDOMObject::heapSnapshot): 83 (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots): 84 * bindings/scripts/test/JS/JSTestActiveDOMObject.h: 85 * bindings/scripts/test/JS/JSTestCEReactions.cpp: 86 (WebCore::JSTestCEReactions::heapSnapshot): 87 (WebCore::JSTestCEReactionsOwner::isReachableFromOpaqueRoots): 88 * bindings/scripts/test/JS/JSTestCEReactions.h: 89 * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: 90 (WebCore::JSTestCEReactionsStringifier::heapSnapshot): 91 (WebCore::JSTestCEReactionsStringifierOwner::isReachableFromOpaqueRoots): 92 * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: 93 * bindings/scripts/test/JS/JSTestCallTracer.cpp: 94 (WebCore::JSTestCallTracer::heapSnapshot): 95 (WebCore::JSTestCallTracerOwner::isReachableFromOpaqueRoots): 96 * bindings/scripts/test/JS/JSTestCallTracer.h: 97 * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: 98 (WebCore::JSTestClassWithJSBuiltinConstructor::heapSnapshot): 99 (WebCore::JSTestClassWithJSBuiltinConstructorOwner::isReachableFromOpaqueRoots): 100 * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h: 101 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: 102 (WebCore::JSTestCustomConstructorWithNoInterfaceObject::heapSnapshot): 103 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots): 104 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: 105 * bindings/scripts/test/JS/JSTestDOMJIT.cpp: 106 (WebCore::JSTestDOMJIT::heapSnapshot): 107 * bindings/scripts/test/JS/JSTestDOMJIT.h: 108 * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: 109 (WebCore::JSTestEnabledBySetting::heapSnapshot): 110 (WebCore::JSTestEnabledBySettingOwner::isReachableFromOpaqueRoots): 111 * bindings/scripts/test/JS/JSTestEnabledBySetting.h: 112 * bindings/scripts/test/JS/JSTestEventConstructor.cpp: 113 (WebCore::JSTestEventConstructor::heapSnapshot): 114 * bindings/scripts/test/JS/JSTestEventConstructor.h: 115 * bindings/scripts/test/JS/JSTestEventTarget.cpp: 116 (WebCore::JSTestEventTarget::heapSnapshot): 117 * bindings/scripts/test/JS/JSTestEventTarget.h: 118 * bindings/scripts/test/JS/JSTestException.cpp: 119 (WebCore::JSTestException::heapSnapshot): 120 (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots): 121 * bindings/scripts/test/JS/JSTestException.h: 122 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: 123 (WebCore::JSTestGenerateIsReachable::heapSnapshot): 124 (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): 125 * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: 126 * bindings/scripts/test/JS/JSTestGlobalObject.cpp: 127 (WebCore::JSTestGlobalObject::heapSnapshot): 128 (WebCore::JSTestGlobalObjectOwner::isReachableFromOpaqueRoots): 129 * bindings/scripts/test/JS/JSTestGlobalObject.h: 130 * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: 131 (WebCore::JSTestIndexedSetterNoIdentifier::heapSnapshot): 132 (WebCore::JSTestIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots): 133 * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: 134 * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: 135 (WebCore::JSTestIndexedSetterThrowingException::heapSnapshot): 136 (WebCore::JSTestIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots): 137 * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: 138 * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: 139 (WebCore::JSTestIndexedSetterWithIdentifier::heapSnapshot): 140 (WebCore::JSTestIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots): 141 * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: 142 * bindings/scripts/test/JS/JSTestInterface.cpp: 143 (WebCore::JSTestInterface::heapSnapshot): 144 (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots): 145 * bindings/scripts/test/JS/JSTestInterface.h: 146 * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: 147 (WebCore::JSTestInterfaceLeadingUnderscore::heapSnapshot): 148 (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots): 149 * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: 150 * bindings/scripts/test/JS/JSTestIterable.cpp: 151 (WebCore::JSTestIterable::heapSnapshot): 152 (WebCore::JSTestIterableOwner::isReachableFromOpaqueRoots): 153 * bindings/scripts/test/JS/JSTestIterable.h: 154 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: 155 (WebCore::JSTestMediaQueryListListener::heapSnapshot): 156 (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots): 157 * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: 158 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: 159 (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::heapSnapshot): 160 (WebCore::JSTestNamedAndIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots): 161 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: 162 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: 163 (WebCore::JSTestNamedAndIndexedSetterThrowingException::heapSnapshot): 164 (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots): 165 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: 166 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: 167 (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::heapSnapshot): 168 (WebCore::JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots): 169 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: 170 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: 171 (WebCore::JSTestNamedConstructor::heapSnapshot): 172 (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots): 173 * bindings/scripts/test/JS/JSTestNamedConstructor.h: 174 * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: 175 (WebCore::JSTestNamedDeleterNoIdentifier::heapSnapshot): 176 (WebCore::JSTestNamedDeleterNoIdentifierOwner::isReachableFromOpaqueRoots): 177 * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: 178 * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: 179 (WebCore::JSTestNamedDeleterThrowingException::heapSnapshot): 180 (WebCore::JSTestNamedDeleterThrowingExceptionOwner::isReachableFromOpaqueRoots): 181 * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: 182 * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: 183 (WebCore::JSTestNamedDeleterWithIdentifier::heapSnapshot): 184 (WebCore::JSTestNamedDeleterWithIdentifierOwner::isReachableFromOpaqueRoots): 185 * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: 186 * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: 187 (WebCore::JSTestNamedDeleterWithIndexedGetter::heapSnapshot): 188 (WebCore::JSTestNamedDeleterWithIndexedGetterOwner::isReachableFromOpaqueRoots): 189 * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: 190 * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: 191 (WebCore::JSTestNamedGetterCallWith::heapSnapshot): 192 (WebCore::JSTestNamedGetterCallWithOwner::isReachableFromOpaqueRoots): 193 * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: 194 * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: 195 (WebCore::JSTestNamedGetterNoIdentifier::heapSnapshot): 196 (WebCore::JSTestNamedGetterNoIdentifierOwner::isReachableFromOpaqueRoots): 197 * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: 198 * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: 199 (WebCore::JSTestNamedGetterWithIdentifier::heapSnapshot): 200 (WebCore::JSTestNamedGetterWithIdentifierOwner::isReachableFromOpaqueRoots): 201 * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: 202 * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: 203 (WebCore::JSTestNamedSetterNoIdentifier::heapSnapshot): 204 (WebCore::JSTestNamedSetterNoIdentifierOwner::isReachableFromOpaqueRoots): 205 * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: 206 * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: 207 (WebCore::JSTestNamedSetterThrowingException::heapSnapshot): 208 (WebCore::JSTestNamedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots): 209 * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: 210 * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: 211 (WebCore::JSTestNamedSetterWithIdentifier::heapSnapshot): 212 (WebCore::JSTestNamedSetterWithIdentifierOwner::isReachableFromOpaqueRoots): 213 * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: 214 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: 215 (WebCore::JSTestNamedSetterWithIndexedGetter::heapSnapshot): 216 (WebCore::JSTestNamedSetterWithIndexedGetterOwner::isReachableFromOpaqueRoots): 217 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: 218 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: 219 (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::heapSnapshot): 220 (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterOwner::isReachableFromOpaqueRoots): 221 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: 222 * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: 223 (WebCore::JSTestNamedSetterWithOverrideBuiltins::heapSnapshot): 224 (WebCore::JSTestNamedSetterWithOverrideBuiltinsOwner::isReachableFromOpaqueRoots): 225 * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: 226 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: 227 (WebCore::JSTestNamedSetterWithUnforgableProperties::heapSnapshot): 228 (WebCore::JSTestNamedSetterWithUnforgablePropertiesOwner::isReachableFromOpaqueRoots): 229 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: 230 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: 231 (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::heapSnapshot): 232 (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::isReachableFromOpaqueRoots): 233 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: 234 * bindings/scripts/test/JS/JSTestNode.cpp: 235 (WebCore::JSTestNode::heapSnapshot): 236 * bindings/scripts/test/JS/JSTestNode.h: 237 * bindings/scripts/test/JS/JSTestObj.cpp: 238 (WebCore::JSTestObj::heapSnapshot): 239 (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots): 240 * bindings/scripts/test/JS/JSTestObj.h: 241 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: 242 (WebCore::JSTestOverloadedConstructors::heapSnapshot): 243 (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots): 244 * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: 245 * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: 246 (WebCore::JSTestOverloadedConstructorsWithSequence::heapSnapshot): 247 (WebCore::JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots): 248 * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h: 249 * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: 250 (WebCore::JSTestOverrideBuiltins::heapSnapshot): 251 (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots): 252 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: 253 * bindings/scripts/test/JS/JSTestPluginInterface.cpp: 254 (WebCore::JSTestPluginInterface::heapSnapshot): 255 (WebCore::JSTestPluginInterfaceOwner::isReachableFromOpaqueRoots): 256 * bindings/scripts/test/JS/JSTestPluginInterface.h: 257 * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: 258 (WebCore::JSTestPromiseRejectionEvent::heapSnapshot): 259 * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h: 260 * bindings/scripts/test/JS/JSTestSerialization.cpp: 261 (WebCore::JSTestSerialization::heapSnapshot): 262 (WebCore::JSTestSerializationOwner::isReachableFromOpaqueRoots): 263 * bindings/scripts/test/JS/JSTestSerialization.h: 264 * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: 265 (WebCore::JSTestSerializationIndirectInheritance::heapSnapshot): 266 * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h: 267 * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: 268 (WebCore::JSTestSerializationInherit::heapSnapshot): 269 * bindings/scripts/test/JS/JSTestSerializationInherit.h: 270 * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: 271 (WebCore::JSTestSerializationInheritFinal::heapSnapshot): 272 * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: 273 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 274 (WebCore::JSTestSerializedScriptValueInterface::heapSnapshot): 275 (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots): 276 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: 277 * bindings/scripts/test/JS/JSTestStringifier.cpp: 278 (WebCore::JSTestStringifier::heapSnapshot): 279 (WebCore::JSTestStringifierOwner::isReachableFromOpaqueRoots): 280 * bindings/scripts/test/JS/JSTestStringifier.h: 281 * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: 282 (WebCore::JSTestStringifierAnonymousOperation::heapSnapshot): 283 (WebCore::JSTestStringifierAnonymousOperationOwner::isReachableFromOpaqueRoots): 284 * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h: 285 * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: 286 (WebCore::JSTestStringifierNamedOperation::heapSnapshot): 287 (WebCore::JSTestStringifierNamedOperationOwner::isReachableFromOpaqueRoots): 288 * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h: 289 * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: 290 (WebCore::JSTestStringifierOperationImplementedAs::heapSnapshot): 291 (WebCore::JSTestStringifierOperationImplementedAsOwner::isReachableFromOpaqueRoots): 292 * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h: 293 * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: 294 (WebCore::JSTestStringifierOperationNamedToString::heapSnapshot): 295 (WebCore::JSTestStringifierOperationNamedToStringOwner::isReachableFromOpaqueRoots): 296 * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h: 297 * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: 298 (WebCore::JSTestStringifierReadOnlyAttribute::heapSnapshot): 299 (WebCore::JSTestStringifierReadOnlyAttributeOwner::isReachableFromOpaqueRoots): 300 * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h: 301 * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: 302 (WebCore::JSTestStringifierReadWriteAttribute::heapSnapshot): 303 (WebCore::JSTestStringifierReadWriteAttributeOwner::isReachableFromOpaqueRoots): 304 * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h: 305 * bindings/scripts/test/JS/JSTestTypedefs.cpp: 306 (WebCore::JSTestTypedefs::heapSnapshot): 307 (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots): 308 * bindings/scripts/test/JS/JSTestTypedefs.h: 309 * dom/Document.idl: 310 * page/DOMWindow.idl: 311 1 312 2018-08-23 Ryosuke Niwa <rniwa@webkit.org> 2 313 -
TabularUnified trunk/Source/WebCore/bindings/js/DOMGCOutputConstraint.cpp ¶
r228218 r235271 30 30 #include <JavaScriptCore/BlockDirectoryInlines.h> 31 31 #include <JavaScriptCore/HeapInlines.h> 32 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 33 #include <JavaScriptCore/MarkedBlockInlines.h> 33 34 #include <JavaScriptCore/SubspaceInlines.h> … … 62 63 [&] (Subspace& subspace) { 63 64 auto func = [] (SlotVisitor& visitor, HeapCell* heapCell, HeapCell::Kind) { 65 SetRootMarkReasonScope rootScope(visitor, SlotVisitor::RootMarkReason::DOMGCOutput); 64 66 JSCell* cell = static_cast<JSCell*>(heapCell); 65 67 cell->methodTable(visitor.vm())->visitOutputConstraints(cell, visitor); -
TabularUnified trunk/Source/WebCore/bindings/js/GCController.cpp ¶
r228218 r235271 28 28 29 29 #include "CommonVM.h" 30 #include "FileSystem.h" 31 #include "JSHTMLDocument.h" 32 #include "Location.h" 30 33 #include <JavaScriptCore/Heap.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 35 #include <JavaScriptCore/JSLock.h> 32 36 #include <JavaScriptCore/VM.h> 37 #include <pal/Logging.h> 33 38 #include <wtf/FastMalloc.h> 34 39 #include <wtf/NeverDestroyed.h> … … 53 58 : m_GCTimer(*this, &GCController::gcTimerFired) 54 59 { 60 static std::once_flag onceFlag; 61 std::call_once(onceFlag, [] { 62 PAL::registerNotifyCallback("com.apple.WebKit.dumpGCHeap", [] { 63 GCController::singleton().dumpHeap(); 64 }); 65 }); 55 66 } 56 67 … … 128 139 } 129 140 141 void GCController::dumpHeap() 142 { 143 FileSystem::PlatformFileHandle fileHandle; 144 String tempFilePath = FileSystem::openTemporaryFile("GCHeap"_s, fileHandle); 145 if (!FileSystem::isHandleValid(fileHandle)) { 146 WTFLogAlways("Dumping GC heap failed to open temporary file"); 147 return; 148 } 149 150 VM& vm = commonVM(); 151 JSLockHolder lock(vm); 152 153 sanitizeStackForVM(&vm); 154 155 String jsonData; 156 { 157 DeferGCForAWhile deferGC(vm.heap); // Prevent concurrent GC from interfering with the full GC that the snapshot does. 158 159 HeapSnapshotBuilder snapshotBuilder(vm.ensureHeapProfiler(), HeapSnapshotBuilder::SnapshotType::GCDebuggingSnapshot); 160 snapshotBuilder.buildSnapshot(); 161 162 jsonData = snapshotBuilder.json(); 163 } 164 165 CString utf8String = jsonData.utf8(); 166 167 FileSystem::writeToFile(fileHandle, utf8String.data(), utf8String.length()); 168 FileSystem::closeFile(fileHandle); 169 170 WTFLogAlways("Dumped GC heap to %s", tempFilePath.utf8().data()); 171 } 172 130 173 } // namespace WebCore -
TabularUnified trunk/Source/WebCore/bindings/js/GCController.h ¶
r228218 r235271 52 52 GCController(); // Use singleton() instead. 53 53 54 void dumpHeap(); 55 54 56 void gcTimerFired(); 55 57 Timer m_GCTimer; -
TabularUnified trunk/Source/WebCore/bindings/js/JSCSSRuleListCustom.cpp ¶
r232337 r235271 37 37 using namespace JSC; 38 38 39 bool JSCSSRuleListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor )39 bool JSCSSRuleListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 40 40 { 41 41 JSCSSRuleList* jsCSSRuleList = jsCast<JSCSSRuleList*>(handle.slot()->asCell()); 42 42 if (!jsCSSRuleList->hasCustomProperties(*jsCSSRuleList->vm())) 43 43 return false; 44 if (CSSStyleSheet* styleSheet = jsCSSRuleList->wrapped().styleSheet()) 44 45 if (CSSStyleSheet* styleSheet = jsCSSRuleList->wrapped().styleSheet()) { 46 if (UNLIKELY(reason)) 47 *reason = "CSSStyleSheet is opaque root"; 48 45 49 return visitor.containsOpaqueRoot(root(styleSheet)); 46 if (CSSRule* cssRule = jsCSSRuleList->wrapped().item(0)) 50 } 51 52 if (CSSRule* cssRule = jsCSSRuleList->wrapped().item(0)) { 53 if (UNLIKELY(reason)) 54 *reason = "CSSRule is opaque root"; 55 47 56 return visitor.containsOpaqueRoot(root(cssRule)); 57 } 48 58 return false; 49 59 } -
TabularUnified trunk/Source/WebCore/bindings/js/JSCallbackData.cpp ¶
r234586 r235271 91 91 } 92 92 93 bool JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, SlotVisitor& visitor )93 bool JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, SlotVisitor& visitor, const char** reason) 94 94 { 95 if (UNLIKELY(reason)) 96 *reason = "Context is opaque root"; // FIXME: what is the context. 95 97 return visitor.containsOpaqueRoot(context); 96 98 } -
TabularUnified trunk/Source/WebCore/bindings/js/JSCallbackData.h ¶
r228218 r235271 117 117 private: 118 118 class WeakOwner : public JSC::WeakHandleOwner { 119 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& ) override;119 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**) override; 120 120 }; 121 121 WeakOwner m_weakOwner; -
TabularUnified trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp ¶
r225816 r235271 23 23 namespace WebCore { 24 24 25 bool JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor )25 bool JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor, const char** reason) 26 26 { 27 if (UNLIKELY(reason)) 28 *reason = "Canvas is opaque root"; 29 27 30 JSCanvasRenderingContext2D* jsCanvasRenderingContext = jsCast<JSCanvasRenderingContext2D*>(handle.slot()->asCell()); 28 31 void* root = WebCore::root(jsCanvasRenderingContext->wrapped().canvas()); -
TabularUnified trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp ¶
r234491 r235271 46 46 #include "Settings.h" 47 47 #include "WebCoreJSClientData.h" 48 #include <JavaScriptCore/HeapSnapshotBuilder.h> 48 49 #include <JavaScriptCore/JSCInlines.h> 49 50 #include <JavaScriptCore/JSMicrotask.h> … … 203 204 return jsDOMWindowGetOwnPropertySlotRestrictedAccess<DOMWindowType::Local>(thisObject, thisObject->wrapped(), *state, propertyName, slot, errorMessage); 204 205 205 // FIXME: this need more explanation.206 // FIXME: this needs more explanation. 206 207 // (Particularly, is it correct that this exists here but not in getOwnPropertySlotByIndex?) 207 208 slot.setWatchpointSet(thisObject->m_windowCloseWatchpoints); … … 327 328 return false; 328 329 return Base::deletePropertyByIndex(thisObject, exec, propertyName); 330 } 331 332 void JSDOMWindow::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 333 { 334 JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell); 335 if (auto* location = thisObject->wrapped().location()) 336 builder.setLabelForCell(cell, location->href()); 337 338 Base::heapSnapshot(cell, builder); 329 339 } 330 340 -
TabularUnified trunk/Source/WebCore/bindings/js/JSDeprecatedCSSOMValueCustom.cpp ¶
r232337 r235271 36 36 using namespace JSC; 37 37 38 bool JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor )38 bool JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 39 39 { 40 40 JSDeprecatedCSSOMValue* jsCSSValue = jsCast<JSDeprecatedCSSOMValue*>(handle.slot()->asCell()); 41 41 if (!jsCSSValue->hasCustomProperties(*jsCSSValue->vm())) 42 42 return false; 43 44 if (UNLIKELY(reason)) 45 *reason = "CSSStyleDeclaration is opaque root"; 46 43 47 return visitor.containsOpaqueRoot(root(&jsCSSValue->wrapped().owner())); 44 48 } -
TabularUnified trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp ¶
r223476 r235271 27 27 #include "NodeTraversal.h" 28 28 #include "SVGDocument.h" 29 #include <JavaScriptCore/HeapSnapshotBuilder.h> 29 30 30 31 … … 94 95 } 95 96 97 void JSDocument::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 98 { 99 Base::heapSnapshot(cell, builder); 100 auto* thisObject = jsCast<JSDocument*>(cell); 101 builder.setLabelForCell(cell, thisObject->wrapped().url().string()); 102 } 103 96 104 } // namespace WebCore -
TabularUnified trunk/Source/WebCore/bindings/js/JSMicrotaskCallback.h ¶
r234586 r235271 41 41 { 42 42 auto protectedThis { makeRef(*this) }; 43 VM& vm = m_globalObject->vm();44 JS LockHolder lock(vm);43 JSC::VM& vm = m_globalObject->vm(); 44 JSC::JSLockHolder lock(vm); 45 45 auto scope = DECLARE_THROW_SCOPE(vm); 46 46 JSExecState::runTask(m_globalObject->globalExec(), m_task); … … 55 55 } 56 56 57 Strong<JSDOMGlobalObject> m_globalObject;57 JSC::Strong<JSDOMGlobalObject> m_globalObject; 58 58 Ref<JSC::Microtask> m_task; 59 59 }; -
TabularUnified trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp ¶
r223476 r235271 45 45 } 46 46 47 bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor )47 bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char**reason) 48 48 { 49 49 for (auto* node : jsCast<JSMutationObserver*>(handle.slot()->asCell())->wrapped().observedNodes()) { 50 if (visitor.containsOpaqueRoot(root(node))) 50 if (visitor.containsOpaqueRoot(root(node))) { 51 if (UNLIKELY(reason)) 52 *reason = "Reachable from observed nodes"; 51 53 return true; 54 } 52 55 } 53 56 return false; -
TabularUnified trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp ¶
r225203 r235271 29 29 namespace WebCore { 30 30 31 void JSNavigator::visitAdditionalChildren( SlotVisitor& visitor)31 void JSNavigator::visitAdditionalChildren(JSC::SlotVisitor& visitor) 32 32 { 33 33 #if ENABLE(SERVICE_WORKER) -
TabularUnified trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp ¶
r229410 r235271 72 72 using namespace HTMLNames; 73 73 74 static inline bool isReachableFromDOM(Node* node, SlotVisitor& visitor )74 static inline bool isReachableFromDOM(Node* node, SlotVisitor& visitor, const char** reason) 75 75 { 76 76 if (!node->isConnected()) { … … 84 84 // FIXME: The DOM should manage this issue without the help of JavaScript wrappers. 85 85 if (is<HTMLImageElement>(element)) { 86 if (downcast<HTMLImageElement>(element).hasPendingActivity()) 86 if (downcast<HTMLImageElement>(element).hasPendingActivity()) { 87 if (UNLIKELY(reason)) 88 *reason = "Image element with pending activity"; 87 89 return true; 90 } 88 91 } 89 92 #if ENABLE(VIDEO) 90 93 else if (is<HTMLAudioElement>(element)) { 91 if (!downcast<HTMLAudioElement>(element).paused()) 94 if (!downcast<HTMLAudioElement>(element).paused()) { 95 if (UNLIKELY(reason)) 96 *reason = "Audio element which is not paused"; 92 97 return true; 98 } 93 99 } 94 100 #endif … … 97 103 // If a node is firing event listeners, its wrapper is observable because 98 104 // its wrapper is responsible for marking those event listeners. 99 if (node->isFiringEventListeners()) 105 if (node->isFiringEventListeners()) { 106 if (UNLIKELY(reason)) 107 *reason = "Node which is firing event listeners"; 100 108 return true; 109 } 101 110 } 102 111 112 if (UNLIKELY(reason)) 113 *reason = "Connected node"; 114 103 115 return visitor.containsOpaqueRoot(root(node)); 104 116 } 105 117 106 bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor )118 bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 107 119 { 108 120 JSNode* jsNode = jsCast<JSNode*>(handle.slot()->asCell()); 109 return isReachableFromDOM(&jsNode->wrapped(), visitor );121 return isReachableFromDOM(&jsNode->wrapped(), visitor, reason); 110 122 } 111 123 -
TabularUnified trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp ¶
r232337 r235271 38 38 using namespace JSC; 39 39 40 bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor )40 bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 41 41 { 42 42 JSNodeList* jsNodeList = jsCast<JSNodeList*>(handle.slot()->asCell()); 43 43 if (!jsNodeList->hasCustomProperties(*jsNodeList->vm())) 44 44 return false; 45 if (jsNodeList->wrapped().isLiveNodeList()) 45 46 if (jsNodeList->wrapped().isLiveNodeList()) { 47 if (UNLIKELY(reason)) 48 *reason = "LiveNodeList owner is opaque root"; 49 46 50 return visitor.containsOpaqueRoot(root(static_cast<LiveNodeList&>(jsNodeList->wrapped()).ownerNode())); 47 if (jsNodeList->wrapped().isChildNodeList()) 51 } 52 53 if (jsNodeList->wrapped().isChildNodeList()) { 54 if (UNLIKELY(reason)) 55 *reason = "ChildNodeList owner is opaque root"; 56 48 57 return visitor.containsOpaqueRoot(root(static_cast<ChildNodeList&>(jsNodeList->wrapped()).ownerNode())); 49 if (jsNodeList->wrapped().isEmptyNodeList()) 58 } 59 60 if (jsNodeList->wrapped().isEmptyNodeList()) { 61 if (UNLIKELY(reason)) 62 *reason = "EmptyNodeList owner is opaque root"; 63 50 64 return visitor.containsOpaqueRoot(root(static_cast<EmptyNodeList&>(jsNodeList->wrapped()).ownerNode())); 65 } 51 66 return false; 52 67 } -
TabularUnified trunk/Source/WebCore/bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp ¶
r225816 r235271 29 29 } 30 30 31 bool JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor )31 bool JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 32 32 { 33 if (UNLIKELY(reason)) 34 *reason = "Canvas is opaque root"; 35 33 36 JSOffscreenCanvasRenderingContext2D* jsOffscreenCanvasRenderingContext = jsCast<JSOffscreenCanvasRenderingContext2D*>(handle.slot()->asCell()); 34 37 void* root = WebCore::root(&jsOffscreenCanvasRenderingContext->wrapped().canvas()); -
TabularUnified trunk/Source/WebCore/bindings/js/JSPerformanceObserverCustom.cpp ¶
r233053 r235271 36 36 } 37 37 38 bool JSPerformanceObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& )38 bool JSPerformanceObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor&, const char** reason) 39 39 { 40 if (UNLIKELY(reason)) 41 *reason = "Registered PerformanceObserver callback"; 42 40 43 return jsCast<JSPerformanceObserver*>(handle.slot()->asCell())->wrapped().isRegistered(); 41 44 } -
TabularUnified trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp ¶
r228260 r235271 38 38 39 39 namespace WebCore { 40 using namespace JSC; 40 41 41 42 JSValue JSPopStateEvent::state(ExecState& state) const -
TabularUnified trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp ¶
r223476 r235271 39 39 using namespace JSC; 40 40 41 bool JSTextTrackCueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor )41 bool JSTextTrackCueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 42 42 { 43 43 JSTextTrackCue* jsTextTrackCue = jsCast<JSTextTrackCue*>(handle.slot()->asCell()); … … 46 46 // If the cue is firing event listeners, its wrapper is reachable because 47 47 // the wrapper is responsible for marking those event listeners. 48 if (textTrackCue.isFiringEventListeners()) 48 if (textTrackCue.isFiringEventListeners()) { 49 if (UNLIKELY(reason)) 50 *reason = "TextTrackCue is firing event listeners"; 49 51 return true; 52 } 50 53 51 54 // If the cue is not associated with a track, it is not reachable. 52 55 if (!textTrackCue.track()) 53 56 return false; 57 58 if (UNLIKELY(reason)) 59 *reason = "TextTrack is an opaque root"; 54 60 55 61 return visitor.containsOpaqueRoot(root(textTrackCue.track())); -
TabularUnified trunk/Source/WebCore/bindings/js/WebCoreTypedArrayController.cpp ¶
r228218 r235271 54 54 } 55 55 56 bool WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor )56 bool WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor, const char** reason) 57 57 { 58 if (UNLIKELY(reason)) 59 *reason = "ArrayBuffer is opaque root"; 58 60 auto& wrapper = *JSC::jsCast<JSC::JSArrayBuffer*>(handle.slot()->asCell()); 59 61 return visitor.containsOpaqueRoot(wrapper.impl()); -
TabularUnified trunk/Source/WebCore/bindings/js/WebCoreTypedArrayController.h ¶
r228218 r235271 49 49 class JSArrayBufferOwner : public JSC::WeakHandleOwner { 50 50 public: 51 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& ) override;51 bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**) override; 52 52 void finalize(JSC::Handle<JSC::Unknown>, void* context) override; 53 53 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm ¶
r234636 r235271 2658 2658 push(@headerContent, " static bool preventExtensions(JSC::JSObject*, JSC::ExecState*);\n"); 2659 2659 } 2660 2660 2661 2661 if (InstanceNeedsEstimatedSize($interface)) { 2662 2662 push(@headerContent, " static size_t estimatedSize(JSCell*, JSC::VM&);\n"); … … 2759 2759 } 2760 2760 } 2761 2762 if (NeedsImplementationClass($interface)) { 2763 push(@headerContent, " static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&);\n"); 2764 } 2761 2765 2762 2766 if ($numCustomAttributes > 0) { … … 2868 2872 $headerIncludes{"<wtf/NeverDestroyed.h>"} = 1; 2869 2873 push(@headerContent, "public:\n"); 2870 push(@headerContent, " virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );\n");2874 push(@headerContent, " virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**);\n"); 2871 2875 push(@headerContent, " virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);\n"); 2872 2876 push(@headerContent, "};\n"); … … 4522 4526 } 4523 4527 4528 if (NeedsImplementationClass($interface) && !$interface->extendedAttributes->{CustomHeapSnapshot}) { 4529 AddToImplIncludes("<JavaScriptCore/HeapSnapshotBuilder.h>"); 4530 AddToImplIncludes("ScriptExecutionContext.h"); 4531 AddToImplIncludes("URL.h"); 4532 push(@implContent, "void ${className}::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)\n"); 4533 push(@implContent, "{\n"); 4534 push(@implContent, " auto* thisObject = jsCast<${className}*>(cell);\n"); 4535 push(@implContent, " builder.setWrappedObjectForCell(cell, &thisObject->wrapped());\n"); 4536 push(@implContent, " if (thisObject->scriptExecutionContext())\n"); 4537 push(@implContent, " builder.setLabelForCell(cell, String::format(\"url %s\", thisObject->scriptExecutionContext()->url().string().utf8().data()));\n"); 4538 push(@implContent, " Base::heapSnapshot(cell, builder);\n"); 4539 push(@implContent, "}\n\n"); 4540 } 4541 4524 4542 if ($indexedGetterOperation) { 4525 4543 $implIncludes{"URL.h"} = 1 if $indexedGetterOperation->type->name eq "DOMString"; … … 4531 4549 4532 4550 if (ShouldGenerateWrapperOwnerCode($hasParent, $interface) && !GetCustomIsReachable($interface)) { 4533 push(@implContent, "bool JS${interfaceName}Owner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor )\n");4551 push(@implContent, "bool JS${interfaceName}Owner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)\n"); 4534 4552 push(@implContent, "{\n"); 4535 4553 # All ActiveDOMObjects implement hasPendingActivity(), but not all of them … … 4544 4562 push(@implContent, " auto* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n"); 4545 4563 $emittedJSCast = 1; 4546 push(@implContent, " if (js${interfaceName}->wrapped().hasPendingActivity())\n"); 4564 push(@implContent, " if (js${interfaceName}->wrapped().hasPendingActivity()) {\n"); 4565 push(@implContent, " if (UNLIKELY(reason))\n"); 4566 push(@implContent, " *reason = \"ActiveDOMObject with pending activity\";\n"); 4547 4567 push(@implContent, " return true;\n"); 4568 push(@implContent, " }\n"); 4548 4569 } 4549 4570 if ($codeGenerator->InheritsInterface($interface, "EventTarget")) { … … 4552 4573 $emittedJSCast = 1; 4553 4574 } 4554 push(@implContent, " if (js${interfaceName}->wrapped().isFiringEventListeners())\n"); 4575 push(@implContent, " if (js${interfaceName}->wrapped().isFiringEventListeners()) {\n"); 4576 push(@implContent, " if (UNLIKELY(reason))\n"); 4577 push(@implContent, " *reason = \"EventTarget firing event listeners\";\n"); 4555 4578 push(@implContent, " return true;\n"); 4579 push(@implContent, " }\n"); 4556 4580 } 4557 4581 if ($codeGenerator->InheritsInterface($interface, "Node")) { … … 4560 4584 $emittedJSCast = 1; 4561 4585 } 4562 push(@implContent, " if (JSNodeOwner::isReachableFromOpaqueRoots(handle, 0, visitor ))\n");4586 push(@implContent, " if (JSNodeOwner::isReachableFromOpaqueRoots(handle, 0, visitor, reason))\n"); 4563 4587 push(@implContent, " return true;\n"); 4564 4588 } … … 4572 4596 if (GetGenerateIsReachable($interface) eq "Impl") { 4573 4597 $rootString = " ${implType}* root = &js${interfaceName}->wrapped();\n"; 4598 $rootString .= " if (UNLIKELY(reason))\n"; 4599 $rootString .= " *reason = \"Reachable from ${interfaceName}\";\n"; 4574 4600 } elsif (GetGenerateIsReachable($interface) eq "ImplWebGLRenderingContext") { 4575 4601 $rootString = " WebGLRenderingContextBase* root = WTF::getPtr(js${interfaceName}->wrapped().context());\n"; 4602 $rootString .= " if (UNLIKELY(reason))\n"; 4603 $rootString .= " *reason = \"Reachable from ${interfaceName}\";\n"; 4576 4604 } elsif (GetGenerateIsReachable($interface) eq "ImplFrame") { 4577 4605 $rootString = " Frame* root = WTF::getPtr(js${interfaceName}->wrapped().frame());\n"; 4578 4606 $rootString .= " if (!root)\n"; 4579 4607 $rootString .= " return false;\n"; 4608 $rootString .= " if (UNLIKELY(reason))\n"; 4609 $rootString .= " *reason = \"Reachable from Frame\";\n"; 4580 4610 } elsif (GetGenerateIsReachable($interface) eq "ImplDocument") { 4581 4611 $rootString = " Document* root = WTF::getPtr(js${interfaceName}->wrapped().document());\n"; 4582 4612 $rootString .= " if (!root)\n"; 4583 4613 $rootString .= " return false;\n"; 4614 $rootString .= " if (UNLIKELY(reason))\n"; 4615 $rootString .= " *reason = \"Reachable from Document\";\n"; 4584 4616 } elsif (GetGenerateIsReachable($interface) eq "ImplElementRoot") { 4585 4617 $implIncludes{"Element.h"} = 1; … … 4588 4620 $rootString .= " if (!element)\n"; 4589 4621 $rootString .= " return false;\n"; 4622 $rootString .= " if (UNLIKELY(reason))\n"; 4623 $rootString .= " *reason = \"Reachable from ${interfaceName}Owner\";\n"; 4590 4624 $rootString .= " void* root = WebCore::root(element);\n"; 4591 4625 } elsif (GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot") { … … 4593 4627 $implIncludes{"JSNodeCustom.h"} = 1; 4594 4628 $rootString = " void* root = WebCore::root(js${interfaceName}->wrapped().ownerNode());\n"; 4629 $rootString .= " if (UNLIKELY(reason))\n"; 4630 $rootString .= " *reason = \"Reachable from ${interfaceName} ownerNode\";\n"; 4595 4631 } elsif (GetGenerateIsReachable($interface) eq "ImplScriptExecutionContext") { 4596 4632 $rootString = " ScriptExecutionContext* root = WTF::getPtr(js${interfaceName}->wrapped().scriptExecutionContext());\n"; 4597 4633 $rootString .= " if (!root)\n"; 4598 4634 $rootString .= " return false;\n"; 4635 $rootString .= " if (UNLIKELY(reason))\n"; 4636 $rootString .= " *reason = \"Reachable from ScriptExecutionContext\";\n"; 4599 4637 } else { 4600 4638 $rootString = " void* root = WebCore::root(&js${interfaceName}->wrapped());\n"; 4639 $rootString .= " if (UNLIKELY(reason))\n"; 4640 $rootString .= " *reason = \"Reachable from js${interfaceName}\";\n"; 4601 4641 } 4602 4642 … … 4608 4648 } 4609 4649 push(@implContent, " UNUSED_PARAM(visitor);\n"); 4650 push(@implContent, " UNUSED_PARAM(reason);\n"); 4610 4651 push(@implContent, " return false;\n"); 4611 4652 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/IDLAttributes.json ¶
r232499 r235271 119 119 "contextsAllowed": ["attribute"] 120 120 }, 121 "CustomHeapSnapshot": { 122 "contextsAllowed": ["interface"] 123 }, 121 124 "CustomIndexedSetter": { 122 125 "contextsAllowed": ["interface"] -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.cpp ¶
r233765 r235271 26 26 #include "JSDOMExceptionHandling.h" 27 27 #include "JSDOMWrapperCache.h" 28 #include "ScriptExecutionContext.h" 29 #include "URL.h" 28 30 #include <JavaScriptCore/FunctionPrototype.h> 31 #include <JavaScriptCore/HeapSnapshotBuilder.h> 29 32 #include <JavaScriptCore/JSCInlines.h> 30 33 #include <wtf/GetPtr.h> … … 169 172 } 170 173 171 bool JSInterfaceNameOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 174 void JSInterfaceName::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 175 { 176 auto* thisObject = jsCast<JSInterfaceName*>(cell); 177 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 178 if (thisObject->scriptExecutionContext()) 179 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 180 Base::heapSnapshot(cell, builder); 181 } 182 183 bool JSInterfaceNameOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 172 184 { 173 185 UNUSED_PARAM(handle); 174 186 UNUSED_PARAM(visitor); 187 UNUSED_PARAM(reason); 175 188 return false; 176 189 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.h ¶
r233765 r235271 53 53 static void visitChildren(JSCell*, JSC::SlotVisitor&); 54 54 55 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 55 56 protected: 56 57 JSInterfaceName(JSC::Structure*, JSDOMGlobalObject&, Ref<InterfaceName>&&); … … 61 62 class JSInterfaceNameOwner : public JSC::WeakHandleOwner { 62 63 public: 63 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );64 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 64 65 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 65 66 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSMapLike.cpp ¶
r233122 r235271 31 31 #include "JSDOMOperation.h" 32 32 #include "JSDOMWrapperCache.h" 33 #include "ScriptExecutionContext.h" 34 #include "URL.h" 33 35 #include <JavaScriptCore/BuiltinNames.h> 34 36 #include <JavaScriptCore/FunctionPrototype.h> 37 #include <JavaScriptCore/HeapSnapshotBuilder.h> 35 38 #include <JavaScriptCore/JSCInlines.h> 36 39 #include <wtf/GetPtr.h> … … 338 341 } 339 342 340 bool JSMapLikeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 343 void JSMapLike::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 344 { 345 auto* thisObject = jsCast<JSMapLike*>(cell); 346 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 347 if (thisObject->scriptExecutionContext()) 348 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 349 Base::heapSnapshot(cell, builder); 350 } 351 352 bool JSMapLikeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 341 353 { 342 354 UNUSED_PARAM(handle); 343 355 UNUSED_PARAM(visitor); 356 UNUSED_PARAM(reason); 344 357 return false; 345 358 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSMapLike.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSMapLike(JSC::Structure*, JSDOMGlobalObject&, Ref<MapLike>&&); … … 58 59 class JSMapLikeOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSReadOnlyMapLike.cpp ¶
r233122 r235271 31 31 #include "JSDOMOperation.h" 32 32 #include "JSDOMWrapperCache.h" 33 #include "ScriptExecutionContext.h" 34 #include "URL.h" 33 35 #include <JavaScriptCore/BuiltinNames.h> 34 36 #include <JavaScriptCore/FunctionPrototype.h> 37 #include <JavaScriptCore/HeapSnapshotBuilder.h> 35 38 #include <JavaScriptCore/JSCInlines.h> 36 39 #include <wtf/GetPtr.h> … … 287 290 } 288 291 289 bool JSReadOnlyMapLikeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 292 void JSReadOnlyMapLike::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 293 { 294 auto* thisObject = jsCast<JSReadOnlyMapLike*>(cell); 295 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 296 if (thisObject->scriptExecutionContext()) 297 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 298 Base::heapSnapshot(cell, builder); 299 } 300 301 bool JSReadOnlyMapLikeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 290 302 { 291 303 UNUSED_PARAM(handle); 292 304 UNUSED_PARAM(visitor); 305 UNUSED_PARAM(reason); 293 306 return false; 294 307 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSReadOnlyMapLike.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSReadOnlyMapLike(JSC::Structure*, JSDOMGlobalObject&, Ref<ReadOnlyMapLike>&&); … … 58 59 class JSReadOnlyMapLikeOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp ¶
r233122 r235271 33 33 #include "JSDOMWrapperCache.h" 34 34 #include "JSNode.h" 35 #include "ScriptExecutionContext.h" 36 #include "URL.h" 35 37 #include <JavaScriptCore/FunctionPrototype.h> 38 #include <JavaScriptCore/HeapSnapshotBuilder.h> 36 39 #include <JavaScriptCore/JSCInlines.h> 37 40 #include <wtf/GetPtr.h> … … 248 251 } 249 252 250 bool JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 253 void JSTestActiveDOMObject::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 254 { 255 auto* thisObject = jsCast<JSTestActiveDOMObject*>(cell); 256 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 257 if (thisObject->scriptExecutionContext()) 258 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 259 Base::heapSnapshot(cell, builder); 260 } 261 262 bool JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 251 263 { 252 264 UNUSED_PARAM(handle); 253 265 UNUSED_PARAM(visitor); 266 UNUSED_PARAM(reason); 254 267 return false; 255 268 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 public: 53 54 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags; … … 60 61 class JSTestActiveDOMObjectOwner : public JSC::WeakHandleOwner { 61 62 public: 62 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );63 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 63 64 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 64 65 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp ¶
r234636 r235271 34 34 #include "JSDOMWrapperCache.h" 35 35 #include "JSTestCEReactionsStringifier.h" 36 #include "ScriptExecutionContext.h" 37 #include "URL.h" 36 38 #include <JavaScriptCore/FunctionPrototype.h> 39 #include <JavaScriptCore/HeapSnapshotBuilder.h> 37 40 #include <JavaScriptCore/JSCInlines.h> 38 41 #include <wtf/GetPtr.h> … … 428 431 } 429 432 430 bool JSTestCEReactionsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 433 void JSTestCEReactions::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 434 { 435 auto* thisObject = jsCast<JSTestCEReactions*>(cell); 436 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 437 if (thisObject->scriptExecutionContext()) 438 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 439 Base::heapSnapshot(cell, builder); 440 } 441 442 bool JSTestCEReactionsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 431 443 { 432 444 UNUSED_PARAM(handle); 433 445 UNUSED_PARAM(visitor); 446 UNUSED_PARAM(reason); 434 447 return false; 435 448 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestCEReactions(JSC::Structure*, JSDOMGlobalObject&, Ref<TestCEReactions>&&); … … 58 59 class JSTestCEReactionsOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp ¶
r234636 r235271 30 30 #include "JSDOMOperation.h" 31 31 #include "JSDOMWrapperCache.h" 32 #include "ScriptExecutionContext.h" 33 #include "URL.h" 32 34 #include <JavaScriptCore/FunctionPrototype.h> 35 #include <JavaScriptCore/HeapSnapshotBuilder.h> 33 36 #include <JavaScriptCore/JSCInlines.h> 34 37 #include <wtf/GetPtr.h> … … 257 260 } 258 261 259 bool JSTestCEReactionsStringifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 262 void JSTestCEReactionsStringifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 263 { 264 auto* thisObject = jsCast<JSTestCEReactionsStringifier*>(cell); 265 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 266 if (thisObject->scriptExecutionContext()) 267 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 268 Base::heapSnapshot(cell, builder); 269 } 270 271 bool JSTestCEReactionsStringifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 260 272 { 261 273 UNUSED_PARAM(handle); 262 274 UNUSED_PARAM(visitor); 275 UNUSED_PARAM(reason); 263 276 return false; 264 277 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestCEReactionsStringifier(JSC::Structure*, JSDOMGlobalObject&, Ref<TestCEReactionsStringifier>&&); … … 58 59 class JSTestCEReactionsStringifierOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.cpp ¶
r233122 r235271 37 37 #include "JSDOMWrapperCache.h" 38 38 #include "JSNode.h" 39 #include "ScriptExecutionContext.h" 40 #include "URL.h" 39 41 #include <JavaScriptCore/FunctionPrototype.h> 42 #include <JavaScriptCore/HeapSnapshotBuilder.h> 40 43 #include <JavaScriptCore/JSCInlines.h> 41 44 #include <wtf/GetPtr.h> … … 521 524 } 522 525 523 bool JSTestCallTracerOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 526 void JSTestCallTracer::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 527 { 528 auto* thisObject = jsCast<JSTestCallTracer*>(cell); 529 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 530 if (thisObject->scriptExecutionContext()) 531 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 532 Base::heapSnapshot(cell, builder); 533 } 534 535 bool JSTestCallTracerOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 524 536 { 525 537 UNUSED_PARAM(handle); 526 538 UNUSED_PARAM(visitor); 539 UNUSED_PARAM(reason); 527 540 return false; 528 541 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallTracer.h ¶
r219964 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestCallTracer(JSC::Structure*, JSDOMGlobalObject&, Ref<TestCallTracer>&&); … … 58 59 class JSTestCallTracerOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp ¶
r233122 r235271 26 26 #include "JSDOMExceptionHandling.h" 27 27 #include "JSDOMWrapperCache.h" 28 #include "ScriptExecutionContext.h" 28 29 #include "TestClassWithJSBuiltinConstructorBuiltins.h" 30 #include "URL.h" 29 31 #include <JavaScriptCore/FunctionPrototype.h> 32 #include <JavaScriptCore/HeapSnapshotBuilder.h> 30 33 #include <JavaScriptCore/JSCInlines.h> 31 34 #include <wtf/GetPtr.h> … … 161 164 } 162 165 163 bool JSTestClassWithJSBuiltinConstructorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 166 void JSTestClassWithJSBuiltinConstructor::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 167 { 168 auto* thisObject = jsCast<JSTestClassWithJSBuiltinConstructor*>(cell); 169 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 170 if (thisObject->scriptExecutionContext()) 171 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 172 Base::heapSnapshot(cell, builder); 173 } 174 175 bool JSTestClassWithJSBuiltinConstructorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 164 176 { 165 177 UNUSED_PARAM(handle); 166 178 UNUSED_PARAM(visitor); 179 UNUSED_PARAM(reason); 167 180 return false; 168 181 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h ¶
r217642 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestClassWithJSBuiltinConstructor(JSC::Structure*, JSDOMGlobalObject&, Ref<TestClassWithJSBuiltinConstructor>&&); … … 58 59 class JSTestClassWithJSBuiltinConstructorOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp ¶
r233122 r235271 26 26 #include "JSDOMExceptionHandling.h" 27 27 #include "JSDOMWrapperCache.h" 28 #include "ScriptExecutionContext.h" 29 #include "URL.h" 28 30 #include <JavaScriptCore/FunctionPrototype.h> 31 #include <JavaScriptCore/HeapSnapshotBuilder.h> 29 32 #include <JavaScriptCore/JSCInlines.h> 30 33 #include <wtf/GetPtr.h> … … 159 162 } 160 163 161 bool JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 164 void JSTestCustomConstructorWithNoInterfaceObject::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 165 { 166 auto* thisObject = jsCast<JSTestCustomConstructorWithNoInterfaceObject*>(cell); 167 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 168 if (thisObject->scriptExecutionContext()) 169 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 170 Base::heapSnapshot(cell, builder); 171 } 172 173 bool JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 162 174 { 163 175 UNUSED_PARAM(handle); 164 176 UNUSED_PARAM(visitor); 177 UNUSED_PARAM(reason); 165 178 return false; 166 179 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h ¶
r216198 r235271 49 49 } 50 50 51 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 51 52 protected: 52 53 JSTestCustomConstructorWithNoInterfaceObject(JSC::Structure*, JSDOMGlobalObject&, Ref<TestCustomConstructorWithNoInterfaceObject>&&); … … 57 58 class JSTestCustomConstructorWithNoInterfaceObjectOwner : public JSC::WeakHandleOwner { 58 59 public: 59 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 60 61 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 61 62 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp ¶
r233122 r235271 41 41 #include "JSElement.h" 42 42 #include "JSNodeList.h" 43 #include "ScriptExecutionContext.h" 44 #include "URL.h" 43 45 #include <JavaScriptCore/FrameTracers.h> 46 #include <JavaScriptCore/HeapSnapshotBuilder.h> 44 47 #include <JavaScriptCore/JSCInlines.h> 45 48 #include <wtf/GetPtr.h> … … 1259 1262 } 1260 1263 1261 1262 } 1264 void JSTestDOMJIT::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 1265 { 1266 auto* thisObject = jsCast<JSTestDOMJIT*>(cell); 1267 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 1268 if (thisObject->scriptExecutionContext()) 1269 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 1270 Base::heapSnapshot(cell, builder); 1271 } 1272 1273 1274 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h ¶
r230831 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 TestDOMJIT& wrapped() const 53 54 { -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp ¶
r233122 r235271 30 30 #include "JSDOMWrapperCache.h" 31 31 #include "JSTestSubObj.h" 32 #include "ScriptExecutionContext.h" 32 33 #include "Settings.h" 34 #include "URL.h" 33 35 #include "WebCoreJSClientData.h" 34 36 #include <JavaScriptCore/FunctionPrototype.h> 37 #include <JavaScriptCore/HeapSnapshotBuilder.h> 35 38 #include <JavaScriptCore/JSCInlines.h> 36 39 #include <wtf/GetPtr.h> … … 295 298 #endif 296 299 297 bool JSTestEnabledBySettingOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 300 void JSTestEnabledBySetting::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 301 { 302 auto* thisObject = jsCast<JSTestEnabledBySetting*>(cell); 303 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 304 if (thisObject->scriptExecutionContext()) 305 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 306 Base::heapSnapshot(cell, builder); 307 } 308 309 bool JSTestEnabledBySettingOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 298 310 { 299 311 UNUSED_PARAM(handle); 300 312 UNUSED_PARAM(visitor); 313 UNUSED_PARAM(reason); 301 314 return false; 302 315 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.h ¶
r221585 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 public: 53 54 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags; … … 60 61 class JSTestEnabledBySettingOwner : public JSC::WeakHandleOwner { 61 62 public: 62 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );63 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 63 64 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 64 65 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp ¶
r233122 r235271 30 30 #include "JSDOMExceptionHandling.h" 31 31 #include "JSDOMWrapperCache.h" 32 #include "ScriptExecutionContext.h" 33 #include "URL.h" 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 35 #include <JavaScriptCore/JSCInlines.h> 33 36 #include <wtf/GetPtr.h> … … 304 307 #endif 305 308 309 void JSTestEventConstructor::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 310 { 311 auto* thisObject = jsCast<JSTestEventConstructor*>(cell); 312 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 313 if (thisObject->scriptExecutionContext()) 314 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 315 Base::heapSnapshot(cell, builder); 316 } 317 306 318 #if ENABLE(BINDING_INTEGRITY) 307 319 #if PLATFORM(WIN) -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h ¶
r230831 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 TestEventConstructor& wrapped() const 53 54 { -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp ¶
r233122 r235271 32 32 #include "JSDOMWrapperCache.h" 33 33 #include "JSNode.h" 34 #include "ScriptExecutionContext.h" 35 #include "URL.h" 36 #include <JavaScriptCore/HeapSnapshotBuilder.h> 34 37 #include <JavaScriptCore/JSCInlines.h> 35 38 #include <JavaScriptCore/PropertyNameArray.h> … … 247 250 } 248 251 252 void JSTestEventTarget::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 253 { 254 auto* thisObject = jsCast<JSTestEventTarget*>(cell); 255 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 256 if (thisObject->scriptExecutionContext()) 257 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 258 Base::heapSnapshot(cell, builder); 259 } 260 249 261 #if ENABLE(BINDING_INTEGRITY) 250 262 #if PLATFORM(WIN) -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h ¶
r230831 r235271 54 54 55 55 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 56 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 56 57 TestEventTarget& wrapped() const 57 58 { -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 178 181 } 179 182 180 bool JSTestExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 183 void JSTestException::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 184 { 185 auto* thisObject = jsCast<JSTestException*>(cell); 186 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 187 if (thisObject->scriptExecutionContext()) 188 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 189 Base::heapSnapshot(cell, builder); 190 } 191 192 bool JSTestExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 181 193 { 182 194 UNUSED_PARAM(handle); 183 195 UNUSED_PARAM(visitor); 196 UNUSED_PARAM(reason); 184 197 return false; 185 198 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h ¶
r228038 r235271 51 51 52 52 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 53 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 53 54 protected: 54 55 JSTestException(JSC::Structure*, JSDOMGlobalObject&, Ref<TestException>&&); … … 59 60 class JSTestExceptionOwner : public JSC::WeakHandleOwner { 60 61 public: 61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );62 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 62 63 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 63 64 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp ¶
r233122 r235271 29 29 #include "JSDOMWrapperCache.h" 30 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 31 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 34 #include <JavaScriptCore/JSCInlines.h> 33 35 #include <wtf/GetPtr.h> … … 184 186 } 185 187 186 bool JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 188 void JSTestGenerateIsReachable::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 189 { 190 auto* thisObject = jsCast<JSTestGenerateIsReachable*>(cell); 191 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 192 if (thisObject->scriptExecutionContext()) 193 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 194 Base::heapSnapshot(cell, builder); 195 } 196 197 bool JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 187 198 { 188 199 auto* jsTestGenerateIsReachable = jsCast<JSTestGenerateIsReachable*>(handle.slot()->asCell()); 189 200 TestGenerateIsReachable* root = &jsTestGenerateIsReachable->wrapped(); 201 if (UNLIKELY(reason)) 202 *reason = "Reachable from TestGenerateIsReachable"; 190 203 return visitor.containsOpaqueRoot(root); 191 204 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestGenerateIsReachable(JSC::Structure*, JSDOMGlobalObject&, Ref<TestGenerateIsReachable>&&); … … 58 59 class JSTestGenerateIsReachableOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp ¶
r233122 r235271 35 35 #include "RuntimeEnabledFeatures.h" 36 36 #include "ScriptExecutionContext.h" 37 #include "URL.h" 37 38 #include "WebCoreJSClientData.h" 38 39 #include <JavaScriptCore/FunctionPrototype.h> 40 #include <JavaScriptCore/HeapSnapshotBuilder.h> 39 41 #include <JavaScriptCore/JSCInlines.h> 40 42 #include <wtf/GetPtr.h> … … 569 571 #endif 570 572 571 bool JSTestGlobalObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 573 void JSTestGlobalObject::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 574 { 575 auto* thisObject = jsCast<JSTestGlobalObject*>(cell); 576 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 577 if (thisObject->scriptExecutionContext()) 578 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 579 Base::heapSnapshot(cell, builder); 580 } 581 582 bool JSTestGlobalObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 572 583 { 573 584 UNUSED_PARAM(handle); 574 585 UNUSED_PARAM(visitor); 586 UNUSED_PARAM(reason); 575 587 return false; 576 588 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h ¶
r216198 r235271 52 52 53 53 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 54 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 54 55 public: 55 56 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags; … … 62 63 class JSTestGlobalObjectOwner : public JSC::WeakHandleOwner { 63 64 public: 64 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );65 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 65 66 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 66 67 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp ¶
r233122 r235271 27 27 #include "JSDOMExceptionHandling.h" 28 28 #include "JSDOMWrapperCache.h" 29 #include "ScriptExecutionContext.h" 29 30 #include "URL.h" 30 31 #include <JavaScriptCore/FunctionPrototype.h> 32 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 33 #include <JavaScriptCore/JSCInlines.h> 32 34 #include <JavaScriptCore/PropertyNameArray.h> … … 247 249 } 248 250 249 bool JSTestIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 251 void JSTestIndexedSetterNoIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 252 { 253 auto* thisObject = jsCast<JSTestIndexedSetterNoIdentifier*>(cell); 254 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 255 if (thisObject->scriptExecutionContext()) 256 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 257 Base::heapSnapshot(cell, builder); 258 } 259 260 bool JSTestIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 250 261 { 251 262 UNUSED_PARAM(handle); 252 263 UNUSED_PARAM(visitor); 264 UNUSED_PARAM(reason); 253 265 return false; 254 266 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestIndexedSetterNoIdentifierOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp ¶
r233122 r235271 27 27 #include "JSDOMExceptionHandling.h" 28 28 #include "JSDOMWrapperCache.h" 29 #include "ScriptExecutionContext.h" 29 30 #include "URL.h" 30 31 #include <JavaScriptCore/FunctionPrototype.h> 32 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 33 #include <JavaScriptCore/JSCInlines.h> 32 34 #include <JavaScriptCore/PropertyNameArray.h> … … 247 249 } 248 250 249 bool JSTestIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 251 void JSTestIndexedSetterThrowingException::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 252 { 253 auto* thisObject = jsCast<JSTestIndexedSetterThrowingException*>(cell); 254 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 255 if (thisObject->scriptExecutionContext()) 256 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 257 Base::heapSnapshot(cell, builder); 258 } 259 260 bool JSTestIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 250 261 { 251 262 UNUSED_PARAM(handle); 252 263 UNUSED_PARAM(visitor); 264 UNUSED_PARAM(reason); 253 265 return false; 254 266 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestIndexedSetterThrowingExceptionOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp ¶
r233122 r235271 29 29 #include "JSDOMOperation.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 31 32 #include "URL.h" 32 33 #include <JavaScriptCore/FunctionPrototype.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 33 35 #include <JavaScriptCore/JSCInlines.h> 34 36 #include <JavaScriptCore/PropertyNameArray.h> … … 279 281 } 280 282 281 bool JSTestIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 283 void JSTestIndexedSetterWithIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 284 { 285 auto* thisObject = jsCast<JSTestIndexedSetterWithIdentifier*>(cell); 286 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 287 if (thisObject->scriptExecutionContext()) 288 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 289 Base::heapSnapshot(cell, builder); 290 } 291 292 bool JSTestIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 282 293 { 283 294 UNUSED_PARAM(handle); 284 295 UNUSED_PARAM(visitor); 296 UNUSED_PARAM(reason); 285 297 return false; 286 298 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestIndexedSetterWithIdentifierOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp ¶
r233122 r235271 33 33 #include "JSDOMOperation.h" 34 34 #include "JSDOMWrapperCache.h" 35 #include "ScriptExecutionContext.h" 35 36 #include "TestSupplemental.h" 37 #include "URL.h" 36 38 #include <JavaScriptCore/FunctionPrototype.h> 39 #include <JavaScriptCore/HeapSnapshotBuilder.h> 37 40 #include <JavaScriptCore/JSCInlines.h> 38 41 #include <wtf/GetPtr.h> … … 985 988 #endif 986 989 987 bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 990 void JSTestInterface::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 991 { 992 auto* thisObject = jsCast<JSTestInterface*>(cell); 993 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 994 if (thisObject->scriptExecutionContext()) 995 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 996 Base::heapSnapshot(cell, builder); 997 } 998 999 bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 988 1000 { 989 1001 auto* jsTestInterface = jsCast<JSTestInterface*>(handle.slot()->asCell()); 990 if (jsTestInterface->wrapped().hasPendingActivity()) 1002 if (jsTestInterface->wrapped().hasPendingActivity()) { 1003 if (UNLIKELY(reason)) 1004 *reason = "ActiveDOMObject with pending activity"; 991 1005 return true; 1006 } 992 1007 UNUSED_PARAM(visitor); 1008 UNUSED_PARAM(reason); 993 1009 return false; 994 1010 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h ¶
r219302 r235271 54 54 55 55 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 56 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 56 57 57 58 // Custom attributes … … 84 85 class JSTestInterfaceOwner : public JSC::WeakHandleOwner { 85 86 public: 86 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );87 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 87 88 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 88 89 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 178 181 } 179 182 180 bool JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 183 void JSTestInterfaceLeadingUnderscore::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 184 { 185 auto* thisObject = jsCast<JSTestInterfaceLeadingUnderscore*>(cell); 186 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 187 if (thisObject->scriptExecutionContext()) 188 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 189 Base::heapSnapshot(cell, builder); 190 } 191 192 bool JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 181 193 { 182 194 UNUSED_PARAM(handle); 183 195 UNUSED_PARAM(visitor); 196 UNUSED_PARAM(reason); 184 197 return false; 185 198 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestInterfaceLeadingUnderscore(JSC::Structure*, JSDOMGlobalObject&, Ref<TestInterfaceLeadingUnderscore>&&); … … 58 59 class JSTestInterfaceLeadingUnderscoreOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp ¶
r233122 r235271 28 28 #include "JSDOMOperation.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/BuiltinNames.h> 31 33 #include <JavaScriptCore/FunctionPrototype.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 35 #include <JavaScriptCore/JSCInlines.h> 33 36 #include <wtf/GetPtr.h> … … 231 234 } 232 235 233 bool JSTestIterableOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 236 void JSTestIterable::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 237 { 238 auto* thisObject = jsCast<JSTestIterable*>(cell); 239 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 240 if (thisObject->scriptExecutionContext()) 241 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 242 Base::heapSnapshot(cell, builder); 243 } 244 245 bool JSTestIterableOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 234 246 { 235 247 UNUSED_PARAM(handle); 236 248 UNUSED_PARAM(visitor); 249 UNUSED_PARAM(reason); 237 250 return false; 238 251 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestIterable(JSC::Structure*, JSDOMGlobalObject&, Ref<TestIterable>&&); … … 58 59 class JSTestIterableOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp ¶
r233122 r235271 30 30 #include "JSDOMWrapperCache.h" 31 31 #include "JSMediaQueryListListener.h" 32 #include "ScriptExecutionContext.h" 33 #include "URL.h" 32 34 #include <JavaScriptCore/FunctionPrototype.h> 35 #include <JavaScriptCore/HeapSnapshotBuilder.h> 33 36 #include <JavaScriptCore/JSCInlines.h> 34 37 #include <wtf/GetPtr.h> … … 187 190 } 188 191 189 bool JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 192 void JSTestMediaQueryListListener::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 193 { 194 auto* thisObject = jsCast<JSTestMediaQueryListListener*>(cell); 195 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 196 if (thisObject->scriptExecutionContext()) 197 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 198 Base::heapSnapshot(cell, builder); 199 } 200 201 bool JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 190 202 { 191 203 UNUSED_PARAM(handle); 192 204 UNUSED_PARAM(visitor); 205 UNUSED_PARAM(reason); 193 206 return false; 194 207 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestMediaQueryListListener(JSC::Structure*, JSDOMGlobalObject&, Ref<TestMediaQueryListListener>&&); … … 58 59 class JSTestMediaQueryListListenerOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 30 31 #include "URL.h" 31 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 34 #include <JavaScriptCore/JSCInlines.h> 33 35 #include <JavaScriptCore/PropertyNameArray.h> … … 313 315 } 314 316 315 bool JSTestNamedAndIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 317 void JSTestNamedAndIndexedSetterNoIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 318 { 319 auto* thisObject = jsCast<JSTestNamedAndIndexedSetterNoIdentifier*>(cell); 320 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 321 if (thisObject->scriptExecutionContext()) 322 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 323 Base::heapSnapshot(cell, builder); 324 } 325 326 bool JSTestNamedAndIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 316 327 { 317 328 UNUSED_PARAM(handle); 318 329 UNUSED_PARAM(visitor); 330 UNUSED_PARAM(reason); 319 331 return false; 320 332 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedAndIndexedSetterNoIdentifierOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 30 31 #include "URL.h" 31 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 34 #include <JavaScriptCore/JSCInlines.h> 33 35 #include <JavaScriptCore/PropertyNameArray.h> … … 313 315 } 314 316 315 bool JSTestNamedAndIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 317 void JSTestNamedAndIndexedSetterThrowingException::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 318 { 319 auto* thisObject = jsCast<JSTestNamedAndIndexedSetterThrowingException*>(cell); 320 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 321 if (thisObject->scriptExecutionContext()) 322 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 323 Base::heapSnapshot(cell, builder); 324 } 325 326 bool JSTestNamedAndIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 316 327 { 317 328 UNUSED_PARAM(handle); 318 329 UNUSED_PARAM(visitor); 330 UNUSED_PARAM(reason); 319 331 return false; 320 332 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedAndIndexedSetterThrowingExceptionOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp ¶
r233122 r235271 30 30 #include "JSDOMOperation.h" 31 31 #include "JSDOMWrapperCache.h" 32 #include "ScriptExecutionContext.h" 32 33 #include "URL.h" 33 34 #include <JavaScriptCore/FunctionPrototype.h> 35 #include <JavaScriptCore/HeapSnapshotBuilder.h> 34 36 #include <JavaScriptCore/JSCInlines.h> 35 37 #include <JavaScriptCore/PropertyNameArray.h> … … 367 369 } 368 370 369 bool JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 371 void JSTestNamedAndIndexedSetterWithIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 372 { 373 auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(cell); 374 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 375 if (thisObject->scriptExecutionContext()) 376 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 377 Base::heapSnapshot(cell, builder); 378 } 379 380 bool JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 370 381 { 371 382 UNUSED_PARAM(handle); 372 383 UNUSED_PARAM(visitor); 384 UNUSED_PARAM(reason); 373 385 return false; 374 386 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedAndIndexedSetterWithIdentifierOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp ¶
r233122 r235271 29 29 #include "JSDOMNamedConstructor.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 32 #include "URL.h" 31 33 #include <JavaScriptCore/FunctionPrototype.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 35 #include <JavaScriptCore/JSCInlines.h> 33 36 #include <wtf/GetPtr.h> … … 198 201 } 199 202 200 bool JSTestNamedConstructorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 203 void JSTestNamedConstructor::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 204 { 205 auto* thisObject = jsCast<JSTestNamedConstructor*>(cell); 206 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 207 if (thisObject->scriptExecutionContext()) 208 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 209 Base::heapSnapshot(cell, builder); 210 } 211 212 bool JSTestNamedConstructorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 201 213 { 202 214 auto* jsTestNamedConstructor = jsCast<JSTestNamedConstructor*>(handle.slot()->asCell()); 203 if (jsTestNamedConstructor->wrapped().hasPendingActivity()) 215 if (jsTestNamedConstructor->wrapped().hasPendingActivity()) { 216 if (UNLIKELY(reason)) 217 *reason = "ActiveDOMObject with pending activity"; 204 218 return true; 219 } 205 220 UNUSED_PARAM(visitor); 221 UNUSED_PARAM(reason); 206 222 return false; 207 223 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h ¶
r216198 r235271 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 52 static JSC::JSValue getNamedConstructor(JSC::VM&, JSC::JSGlobalObject*); 53 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 53 54 protected: 54 55 JSTestNamedConstructor(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNamedConstructor>&&); … … 59 60 class JSTestNamedConstructorOwner : public JSC::WeakHandleOwner { 60 61 public: 61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );62 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 62 63 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 63 64 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 226 229 } 227 230 228 bool JSTestNamedDeleterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 231 void JSTestNamedDeleterNoIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 232 { 233 auto* thisObject = jsCast<JSTestNamedDeleterNoIdentifier*>(cell); 234 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 235 if (thisObject->scriptExecutionContext()) 236 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 237 Base::heapSnapshot(cell, builder); 238 } 239 240 bool JSTestNamedDeleterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 229 241 { 230 242 UNUSED_PARAM(handle); 231 243 UNUSED_PARAM(visitor); 244 UNUSED_PARAM(reason); 232 245 return false; 233 246 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h ¶
r217773 r235271 55 55 56 56 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 57 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 57 58 public: 58 59 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 65 66 class JSTestNamedDeleterNoIdentifierOwner : public JSC::WeakHandleOwner { 66 67 public: 67 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 68 69 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 69 70 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 240 243 } 241 244 242 bool JSTestNamedDeleterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 245 void JSTestNamedDeleterThrowingException::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 246 { 247 auto* thisObject = jsCast<JSTestNamedDeleterThrowingException*>(cell); 248 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 249 if (thisObject->scriptExecutionContext()) 250 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 251 Base::heapSnapshot(cell, builder); 252 } 253 254 bool JSTestNamedDeleterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 243 255 { 244 256 UNUSED_PARAM(handle); 245 257 UNUSED_PARAM(visitor); 258 UNUSED_PARAM(reason); 246 259 return false; 247 260 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h ¶
r217773 r235271 55 55 56 56 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 57 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 57 58 public: 58 59 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 65 66 class JSTestNamedDeleterThrowingExceptionOwner : public JSC::WeakHandleOwner { 66 67 public: 67 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 68 69 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 69 70 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp ¶
r233122 r235271 29 29 #include "JSDOMOperation.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 32 #include "URL.h" 31 33 #include <JavaScriptCore/FunctionPrototype.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 35 #include <JavaScriptCore/JSCInlines.h> 33 36 #include <wtf/GetPtr.h> … … 257 260 } 258 261 259 bool JSTestNamedDeleterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 262 void JSTestNamedDeleterWithIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 263 { 264 auto* thisObject = jsCast<JSTestNamedDeleterWithIdentifier*>(cell); 265 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 266 if (thisObject->scriptExecutionContext()) 267 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 268 Base::heapSnapshot(cell, builder); 269 } 270 271 bool JSTestNamedDeleterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 260 272 { 261 273 UNUSED_PARAM(handle); 262 274 UNUSED_PARAM(visitor); 275 UNUSED_PARAM(reason); 263 276 return false; 264 277 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h ¶
r217773 r235271 55 55 56 56 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 57 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 57 58 public: 58 59 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 65 66 class JSTestNamedDeleterWithIdentifierOwner : public JSC::WeakHandleOwner { 66 67 public: 67 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 68 69 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 69 70 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 30 31 #include "URL.h" 31 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 34 #include <JavaScriptCore/JSCInlines.h> 33 35 #include <JavaScriptCore/PropertyNameArray.h> … … 244 246 } 245 247 246 bool JSTestNamedDeleterWithIndexedGetterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 248 void JSTestNamedDeleterWithIndexedGetter::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 249 { 250 auto* thisObject = jsCast<JSTestNamedDeleterWithIndexedGetter*>(cell); 251 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 252 if (thisObject->scriptExecutionContext()) 253 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 254 Base::heapSnapshot(cell, builder); 255 } 256 257 bool JSTestNamedDeleterWithIndexedGetterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 247 258 { 248 259 UNUSED_PARAM(handle); 249 260 UNUSED_PARAM(visitor); 261 UNUSED_PARAM(reason); 250 262 return false; 251 263 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h ¶
r217773 r235271 55 55 56 56 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 57 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 57 58 public: 58 59 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 65 66 class JSTestNamedDeleterWithIndexedGetterOwner : public JSC::WeakHandleOwner { 66 67 public: 67 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 68 69 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 69 70 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 205 208 } 206 209 207 bool JSTestNamedGetterCallWithOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 210 void JSTestNamedGetterCallWith::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 211 { 212 auto* thisObject = jsCast<JSTestNamedGetterCallWith*>(cell); 213 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 214 if (thisObject->scriptExecutionContext()) 215 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 216 Base::heapSnapshot(cell, builder); 217 } 218 219 bool JSTestNamedGetterCallWithOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 208 220 { 209 221 UNUSED_PARAM(handle); 210 222 UNUSED_PARAM(visitor); 223 UNUSED_PARAM(reason); 211 224 return false; 212 225 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterCallWith.h ¶
r218967 r235271 53 53 54 54 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 55 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 55 56 public: 56 57 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 63 64 class JSTestNamedGetterCallWithOwner : public JSC::WeakHandleOwner { 64 65 public: 65 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );66 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 66 67 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 67 68 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 205 208 } 206 209 207 bool JSTestNamedGetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 210 void JSTestNamedGetterNoIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 211 { 212 auto* thisObject = jsCast<JSTestNamedGetterNoIdentifier*>(cell); 213 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 214 if (thisObject->scriptExecutionContext()) 215 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 216 Base::heapSnapshot(cell, builder); 217 } 218 219 bool JSTestNamedGetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 208 220 { 209 221 UNUSED_PARAM(handle); 210 222 UNUSED_PARAM(visitor); 223 UNUSED_PARAM(reason); 211 224 return false; 212 225 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h ¶
r218967 r235271 53 53 54 54 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 55 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 55 56 public: 56 57 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 63 64 class JSTestNamedGetterNoIdentifierOwner : public JSC::WeakHandleOwner { 64 65 public: 65 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );66 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 66 67 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 67 68 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp ¶
r233122 r235271 29 29 #include "JSDOMOperation.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 32 #include "URL.h" 31 33 #include <JavaScriptCore/FunctionPrototype.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 35 #include <JavaScriptCore/JSCInlines.h> 33 36 #include <wtf/GetPtr.h> … … 233 236 } 234 237 235 bool JSTestNamedGetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 238 void JSTestNamedGetterWithIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 239 { 240 auto* thisObject = jsCast<JSTestNamedGetterWithIdentifier*>(cell); 241 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 242 if (thisObject->scriptExecutionContext()) 243 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 244 Base::heapSnapshot(cell, builder); 245 } 246 247 bool JSTestNamedGetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 236 248 { 237 249 UNUSED_PARAM(handle); 238 250 UNUSED_PARAM(visitor); 251 UNUSED_PARAM(reason); 239 252 return false; 240 253 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h ¶
r218967 r235271 53 53 54 54 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 55 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 55 56 public: 56 57 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 63 64 class JSTestNamedGetterWithIdentifierOwner : public JSC::WeakHandleOwner { 64 65 public: 65 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );66 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 66 67 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 67 68 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 267 270 } 268 271 269 bool JSTestNamedSetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 272 void JSTestNamedSetterNoIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 273 { 274 auto* thisObject = jsCast<JSTestNamedSetterNoIdentifier*>(cell); 275 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 276 if (thisObject->scriptExecutionContext()) 277 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 278 Base::heapSnapshot(cell, builder); 279 } 280 281 bool JSTestNamedSetterNoIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 270 282 { 271 283 UNUSED_PARAM(handle); 272 284 UNUSED_PARAM(visitor); 285 UNUSED_PARAM(reason); 273 286 return false; 274 287 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedSetterNoIdentifierOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 267 270 } 268 271 269 bool JSTestNamedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 272 void JSTestNamedSetterThrowingException::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 273 { 274 auto* thisObject = jsCast<JSTestNamedSetterThrowingException*>(cell); 275 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 276 if (thisObject->scriptExecutionContext()) 277 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 278 Base::heapSnapshot(cell, builder); 279 } 280 281 bool JSTestNamedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 270 282 { 271 283 UNUSED_PARAM(handle); 272 284 UNUSED_PARAM(visitor); 285 UNUSED_PARAM(reason); 273 286 return false; 274 287 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedSetterThrowingExceptionOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp ¶
r233122 r235271 29 29 #include "JSDOMOperation.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 32 #include "URL.h" 31 33 #include <JavaScriptCore/FunctionPrototype.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 35 #include <JavaScriptCore/JSCInlines.h> 33 36 #include <wtf/GetPtr.h> … … 298 301 } 299 302 300 bool JSTestNamedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 303 void JSTestNamedSetterWithIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 304 { 305 auto* thisObject = jsCast<JSTestNamedSetterWithIdentifier*>(cell); 306 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 307 if (thisObject->scriptExecutionContext()) 308 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 309 Base::heapSnapshot(cell, builder); 310 } 311 312 bool JSTestNamedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 301 313 { 302 314 UNUSED_PARAM(handle); 303 315 UNUSED_PARAM(visitor); 316 UNUSED_PARAM(reason); 304 317 return false; 305 318 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedSetterWithIdentifierOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp ¶
r233122 r235271 30 30 #include "JSDOMOperation.h" 31 31 #include "JSDOMWrapperCache.h" 32 #include "ScriptExecutionContext.h" 32 33 #include "URL.h" 33 34 #include <JavaScriptCore/FunctionPrototype.h> 35 #include <JavaScriptCore/HeapSnapshotBuilder.h> 34 36 #include <JavaScriptCore/JSCInlines.h> 35 37 #include <JavaScriptCore/PropertyNameArray.h> … … 341 343 } 342 344 343 bool JSTestNamedSetterWithIndexedGetterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 345 void JSTestNamedSetterWithIndexedGetter::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 346 { 347 auto* thisObject = jsCast<JSTestNamedSetterWithIndexedGetter*>(cell); 348 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 349 if (thisObject->scriptExecutionContext()) 350 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 351 Base::heapSnapshot(cell, builder); 352 } 353 354 bool JSTestNamedSetterWithIndexedGetterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 344 355 { 345 356 UNUSED_PARAM(handle); 346 357 UNUSED_PARAM(visitor); 358 UNUSED_PARAM(reason); 347 359 return false; 348 360 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h ¶
r219622 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedSetterWithIndexedGetterOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp ¶
r233122 r235271 30 30 #include "JSDOMOperation.h" 31 31 #include "JSDOMWrapperCache.h" 32 #include "ScriptExecutionContext.h" 32 33 #include "URL.h" 33 34 #include <JavaScriptCore/FunctionPrototype.h> 35 #include <JavaScriptCore/HeapSnapshotBuilder.h> 34 36 #include <JavaScriptCore/JSCInlines.h> 35 37 #include <JavaScriptCore/PropertyNameArray.h> … … 391 393 } 392 394 393 bool JSTestNamedSetterWithIndexedGetterAndSetterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 395 void JSTestNamedSetterWithIndexedGetterAndSetter::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 396 { 397 auto* thisObject = jsCast<JSTestNamedSetterWithIndexedGetterAndSetter*>(cell); 398 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 399 if (thisObject->scriptExecutionContext()) 400 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 401 Base::heapSnapshot(cell, builder); 402 } 403 404 bool JSTestNamedSetterWithIndexedGetterAndSetterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 394 405 { 395 406 UNUSED_PARAM(handle); 396 407 UNUSED_PARAM(visitor); 408 UNUSED_PARAM(reason); 397 409 return false; 398 410 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h ¶
r219622 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedSetterWithIndexedGetterAndSetterOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp ¶
r233122 r235271 28 28 #include "JSDOMExceptionHandling.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 254 257 } 255 258 256 bool JSTestNamedSetterWithOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 259 void JSTestNamedSetterWithOverrideBuiltins::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 260 { 261 auto* thisObject = jsCast<JSTestNamedSetterWithOverrideBuiltins*>(cell); 262 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 263 if (thisObject->scriptExecutionContext()) 264 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 265 Base::heapSnapshot(cell, builder); 266 } 267 268 bool JSTestNamedSetterWithOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 257 269 { 258 270 UNUSED_PARAM(handle); 259 271 UNUSED_PARAM(visitor); 272 UNUSED_PARAM(reason); 260 273 return false; 261 274 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpure | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedSetterWithOverrideBuiltinsOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp ¶
r233122 r235271 30 30 #include "JSDOMOperation.h" 31 31 #include "JSDOMWrapperCache.h" 32 #include "ScriptExecutionContext.h" 33 #include "URL.h" 32 34 #include <JavaScriptCore/FunctionPrototype.h> 35 #include <JavaScriptCore/HeapSnapshotBuilder.h> 33 36 #include <JavaScriptCore/JSCInlines.h> 34 37 #include <wtf/GetPtr.h> … … 336 339 } 337 340 338 bool JSTestNamedSetterWithUnforgablePropertiesOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 341 void JSTestNamedSetterWithUnforgableProperties::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 342 { 343 auto* thisObject = jsCast<JSTestNamedSetterWithUnforgableProperties*>(cell); 344 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 345 if (thisObject->scriptExecutionContext()) 346 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 347 Base::heapSnapshot(cell, builder); 348 } 349 350 bool JSTestNamedSetterWithUnforgablePropertiesOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 339 351 { 340 352 UNUSED_PARAM(handle); 341 353 UNUSED_PARAM(visitor); 354 UNUSED_PARAM(reason); 342 355 return false; 343 356 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::HasStaticPropertyTable | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedSetterWithUnforgablePropertiesOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp ¶
r233122 r235271 30 30 #include "JSDOMOperation.h" 31 31 #include "JSDOMWrapperCache.h" 32 #include "ScriptExecutionContext.h" 33 #include "URL.h" 32 34 #include <JavaScriptCore/FunctionPrototype.h> 35 #include <JavaScriptCore/HeapSnapshotBuilder.h> 33 36 #include <JavaScriptCore/JSCInlines.h> 34 37 #include <wtf/GetPtr.h> … … 323 326 } 324 327 325 bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 328 void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 329 { 330 auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(cell); 331 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 332 if (thisObject->scriptExecutionContext()) 333 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 334 Base::heapSnapshot(cell, builder); 335 } 336 337 bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 326 338 { 327 339 UNUSED_PARAM(handle); 328 340 UNUSED_PARAM(visitor); 341 UNUSED_PARAM(reason); 329 342 return false; 330 343 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h ¶
r217773 r235271 56 56 57 57 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 public: 59 60 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpure | JSC::HasStaticPropertyTable | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 66 67 class JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner : public JSC::WeakHandleOwner { 67 68 public: 68 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 69 70 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 70 71 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp ¶
r233122 r235271 35 35 #include "RuntimeEnabledFeatures.h" 36 36 #include "ScriptExecutionContext.h" 37 #include "URL.h" 37 38 #include <JavaScriptCore/BuiltinNames.h> 39 #include <JavaScriptCore/HeapSnapshotBuilder.h> 38 40 #include <JavaScriptCore/JSCInlines.h> 39 41 #include <JavaScriptCore/ObjectConstructor.h> … … 413 415 } 414 416 417 void JSTestNode::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 418 { 419 auto* thisObject = jsCast<JSTestNode*>(cell); 420 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 421 if (thisObject->scriptExecutionContext()) 422 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 423 Base::heapSnapshot(cell, builder); 424 } 425 415 426 #if ENABLE(BINDING_INTEGRITY) 416 427 #if PLATFORM(WIN) -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h ¶
r230831 r235271 50 50 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 51 51 static JSC::JSObject* serialize(JSC::ExecState&, JSTestNode& thisObject, JSDOMGlobalObject&, JSC::ThrowScope&); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 TestNode& wrapped() const 53 54 { -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp ¶
r233122 r235271 83 83 #include <JavaScriptCore/BuiltinNames.h> 84 84 #include <JavaScriptCore/FunctionPrototype.h> 85 #include <JavaScriptCore/HeapSnapshotBuilder.h> 85 86 #include <JavaScriptCore/IteratorOperations.h> 86 87 #include <JavaScriptCore/JSArray.h> … … 8390 8391 } 8391 8392 8392 bool JSTestObjOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 8393 void JSTestObj::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 8394 { 8395 auto* thisObject = jsCast<JSTestObj*>(cell); 8396 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 8397 if (thisObject->scriptExecutionContext()) 8398 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 8399 Base::heapSnapshot(cell, builder); 8400 } 8401 8402 bool JSTestObjOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 8393 8403 { 8394 8404 UNUSED_PARAM(handle); 8395 8405 UNUSED_PARAM(visitor); 8406 UNUSED_PARAM(reason); 8396 8407 return false; 8397 8408 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h ¶
r231839 r235271 63 63 static void visitChildren(JSCell*, JSC::SlotVisitor&); 64 64 65 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 65 66 66 67 // Custom attributes … … 85 86 class JSTestObjOwner : public JSC::WeakHandleOwner { 86 87 public: 87 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );88 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 88 89 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 89 90 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp ¶
r233122 r235271 32 32 #include "JSDOMExceptionHandling.h" 33 33 #include "JSDOMWrapperCache.h" 34 #include "ScriptExecutionContext.h" 35 #include "URL.h" 34 36 #include <JavaScriptCore/FunctionPrototype.h> 37 #include <JavaScriptCore/HeapSnapshotBuilder.h> 35 38 #include <JavaScriptCore/JSCInlines.h> 36 39 #include <wtf/GetPtr.h> … … 250 253 } 251 254 252 bool JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 255 void JSTestOverloadedConstructors::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 256 { 257 auto* thisObject = jsCast<JSTestOverloadedConstructors*>(cell); 258 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 259 if (thisObject->scriptExecutionContext()) 260 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 261 Base::heapSnapshot(cell, builder); 262 } 263 264 bool JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 253 265 { 254 266 UNUSED_PARAM(handle); 255 267 UNUSED_PARAM(visitor); 268 UNUSED_PARAM(reason); 256 269 return false; 257 270 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestOverloadedConstructors(JSC::Structure*, JSDOMGlobalObject&, Ref<TestOverloadedConstructors>&&); … … 58 59 class JSTestOverloadedConstructorsOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp ¶
r233122 r235271 29 29 #include "JSDOMExceptionHandling.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 32 #include "URL.h" 31 33 #include <JavaScriptCore/FunctionPrototype.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 35 #include <JavaScriptCore/IteratorOperations.h> 33 36 #include <JavaScriptCore/JSArray.h> … … 206 209 } 207 210 208 bool JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 211 void JSTestOverloadedConstructorsWithSequence::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 212 { 213 auto* thisObject = jsCast<JSTestOverloadedConstructorsWithSequence*>(cell); 214 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 215 if (thisObject->scriptExecutionContext()) 216 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 217 Base::heapSnapshot(cell, builder); 218 } 219 220 bool JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 209 221 { 210 222 UNUSED_PARAM(handle); 211 223 UNUSED_PARAM(visitor); 224 UNUSED_PARAM(reason); 212 225 return false; 213 226 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestOverloadedConstructorsWithSequence(JSC::Structure*, JSDOMGlobalObject&, Ref<TestOverloadedConstructorsWithSequence>&&); … … 58 59 class JSTestOverloadedConstructorsWithSequenceOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp ¶
r233122 r235271 32 32 #include "JSDOMWrapperCache.h" 33 33 #include "JSNode.h" 34 #include "ScriptExecutionContext.h" 35 #include "URL.h" 34 36 #include <JavaScriptCore/FunctionPrototype.h> 37 #include <JavaScriptCore/HeapSnapshotBuilder.h> 35 38 #include <JavaScriptCore/JSCInlines.h> 36 39 #include <wtf/GetPtr.h> … … 236 239 } 237 240 238 bool JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 241 void JSTestOverrideBuiltins::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 242 { 243 auto* thisObject = jsCast<JSTestOverrideBuiltins*>(cell); 244 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 245 if (thisObject->scriptExecutionContext()) 246 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 247 Base::heapSnapshot(cell, builder); 248 } 249 250 bool JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 239 251 { 240 252 UNUSED_PARAM(handle); 241 253 UNUSED_PARAM(visitor); 254 UNUSED_PARAM(reason); 242 255 return false; 243 256 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h ¶
r217773 r235271 53 53 54 54 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 55 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 55 56 public: 56 57 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpure | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 63 64 class JSTestOverrideBuiltinsOwner : public JSC::WeakHandleOwner { 64 65 public: 65 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );66 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 66 67 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 67 68 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.cpp ¶
r233122 r235271 27 27 #include "JSDOMWrapperCache.h" 28 28 #include "JSPluginElementFunctions.h" 29 #include "ScriptExecutionContext.h" 30 #include "URL.h" 29 31 #include <JavaScriptCore/FunctionPrototype.h> 32 #include <JavaScriptCore/HeapSnapshotBuilder.h> 30 33 #include <JavaScriptCore/JSCInlines.h> 31 34 #include <wtf/GetPtr.h> … … 209 212 } 210 213 211 bool JSTestPluginInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 214 void JSTestPluginInterface::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 215 { 216 auto* thisObject = jsCast<JSTestPluginInterface*>(cell); 217 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 218 if (thisObject->scriptExecutionContext()) 219 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 220 Base::heapSnapshot(cell, builder); 221 } 222 223 bool JSTestPluginInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 212 224 { 213 225 UNUSED_PARAM(handle); 214 226 UNUSED_PARAM(visitor); 227 UNUSED_PARAM(reason); 215 228 return false; 216 229 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.h ¶
r231839 r235271 57 57 58 58 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 59 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 59 60 public: 60 61 static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetCallData | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; … … 67 68 class JSTestPluginInterfaceOwner : public JSC::WeakHandleOwner { 68 69 public: 69 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );70 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 70 71 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 71 72 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp ¶
r233122 r235271 34 34 #include "JSDOMGlobalObject.h" 35 35 #include "JSDOMWrapperCache.h" 36 #include "ScriptExecutionContext.h" 37 #include "URL.h" 38 #include <JavaScriptCore/HeapSnapshotBuilder.h> 36 39 #include <JavaScriptCore/JSCInlines.h> 37 40 #include <wtf/GetPtr.h> … … 286 289 } 287 290 291 void JSTestPromiseRejectionEvent::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 292 { 293 auto* thisObject = jsCast<JSTestPromiseRejectionEvent*>(cell); 294 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 295 if (thisObject->scriptExecutionContext()) 296 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 297 Base::heapSnapshot(cell, builder); 298 } 299 288 300 #if ENABLE(BINDING_INTEGRITY) 289 301 #if PLATFORM(WIN) -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h ¶
r230831 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 TestPromiseRejectionEvent& wrapped() const 53 54 { -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp ¶
r233122 r235271 36 36 #include "JSTestSerializationIndirectInheritance.h" 37 37 #include "JSTestSerializationInheritFinal.h" 38 #include "ScriptExecutionContext.h" 39 #include "URL.h" 38 40 #include <JavaScriptCore/FunctionPrototype.h> 41 #include <JavaScriptCore/HeapSnapshotBuilder.h> 39 42 #include <JavaScriptCore/JSCInlines.h> 40 43 #include <JavaScriptCore/ObjectConstructor.h> … … 543 546 } 544 547 545 bool JSTestSerializationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 548 void JSTestSerialization::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 549 { 550 auto* thisObject = jsCast<JSTestSerialization*>(cell); 551 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 552 if (thisObject->scriptExecutionContext()) 553 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 554 Base::heapSnapshot(cell, builder); 555 } 556 557 bool JSTestSerializationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 546 558 { 547 559 UNUSED_PARAM(handle); 548 560 UNUSED_PARAM(visitor); 561 UNUSED_PARAM(reason); 549 562 return false; 550 563 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.h ¶
r218342 r235271 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 52 static JSC::JSObject* serialize(JSC::ExecState&, JSTestSerialization& thisObject, JSDOMGlobalObject&, JSC::ThrowScope&); 53 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 53 54 protected: 54 55 JSTestSerialization(JSC::Structure*, JSDOMGlobalObject&, Ref<TestSerialization>&&); … … 59 60 class JSTestSerializationOwner : public JSC::WeakHandleOwner { 60 61 public: 61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );62 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 62 63 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 63 64 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp ¶
r233122 r235271 26 26 #include "JSDOMExceptionHandling.h" 27 27 #include "JSDOMWrapperCache.h" 28 #include "ScriptExecutionContext.h" 29 #include "URL.h" 30 #include <JavaScriptCore/HeapSnapshotBuilder.h> 28 31 #include <JavaScriptCore/JSCInlines.h> 29 32 #include <wtf/GetPtr.h> … … 147 150 } 148 151 152 void JSTestSerializationIndirectInheritance::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 153 { 154 auto* thisObject = jsCast<JSTestSerializationIndirectInheritance*>(cell); 155 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 156 if (thisObject->scriptExecutionContext()) 157 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 158 Base::heapSnapshot(cell, builder); 159 } 160 149 161 150 162 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h ¶
r230831 r235271 49 49 50 50 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 51 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 51 52 TestSerializationIndirectInheritance& wrapped() const 52 53 { -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp ¶
r233122 r235271 29 29 #include "JSDOMOperation.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 32 #include "URL.h" 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <JavaScriptCore/ObjectConstructor.h> … … 222 225 } 223 226 224 225 } 227 void JSTestSerializationInherit::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 228 { 229 auto* thisObject = jsCast<JSTestSerializationInherit*>(cell); 230 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 231 if (thisObject->scriptExecutionContext()) 232 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 233 Base::heapSnapshot(cell, builder); 234 } 235 236 237 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.h ¶
r230831 r235271 50 50 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 51 51 static JSC::JSObject* serialize(JSC::ExecState&, JSTestSerializationInherit& thisObject, JSDOMGlobalObject&, JSC::ThrowScope&); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 TestSerializationInherit& wrapped() const 53 54 { -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp ¶
r233122 r235271 29 29 #include "JSDOMOperation.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 32 #include "URL.h" 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <JavaScriptCore/ObjectConstructor.h> … … 256 259 } 257 260 258 259 } 261 void JSTestSerializationInheritFinal::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 262 { 263 auto* thisObject = jsCast<JSTestSerializationInheritFinal*>(cell); 264 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 265 if (thisObject->scriptExecutionContext()) 266 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 267 Base::heapSnapshot(cell, builder); 268 } 269 270 271 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.h ¶
r230831 r235271 50 50 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 51 51 static JSC::JSObject* serialize(JSC::ExecState&, JSTestSerializationInheritFinal& thisObject, JSDOMGlobalObject&, JSC::ThrowScope&); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 TestSerializationInheritFinal& wrapped() const 53 54 { -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp ¶
r233122 r235271 36 36 #include "JSDOMWrapperCache.h" 37 37 #include "JSMessagePort.h" 38 #include "ScriptExecutionContext.h" 38 39 #include "SerializedScriptValue.h" 40 #include "URL.h" 39 41 #include <JavaScriptCore/FunctionPrototype.h> 42 #include <JavaScriptCore/HeapSnapshotBuilder.h> 40 43 #include <JavaScriptCore/JSArray.h> 41 44 #include <JavaScriptCore/JSCInlines.h> … … 346 349 } 347 350 348 bool JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 351 void JSTestSerializedScriptValueInterface::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 352 { 353 auto* thisObject = jsCast<JSTestSerializedScriptValueInterface*>(cell); 354 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 355 if (thisObject->scriptExecutionContext()) 356 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 357 Base::heapSnapshot(cell, builder); 358 } 359 360 bool JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 349 361 { 350 362 UNUSED_PARAM(handle); 351 363 UNUSED_PARAM(visitor); 364 UNUSED_PARAM(reason); 352 365 return false; 353 366 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h ¶
r216198 r235271 56 56 static void visitChildren(JSCell*, JSC::SlotVisitor&); 57 57 58 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 58 59 protected: 59 60 JSTestSerializedScriptValueInterface(JSC::Structure*, JSDOMGlobalObject&, Ref<TestSerializedScriptValueInterface>&&); … … 64 65 class JSTestSerializedScriptValueInterfaceOwner : public JSC::WeakHandleOwner { 65 66 public: 66 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );67 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 67 68 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 68 69 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifier.cpp ¶
r233122 r235271 28 28 #include "JSDOMOperation.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 180 183 } 181 184 182 bool JSTestStringifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 185 void JSTestStringifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 186 { 187 auto* thisObject = jsCast<JSTestStringifier*>(cell); 188 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 189 if (thisObject->scriptExecutionContext()) 190 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 191 Base::heapSnapshot(cell, builder); 192 } 193 194 bool JSTestStringifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 183 195 { 184 196 UNUSED_PARAM(handle); 185 197 UNUSED_PARAM(visitor); 198 UNUSED_PARAM(reason); 186 199 return false; 187 200 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifier.h ¶
r218789 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestStringifier(JSC::Structure*, JSDOMGlobalObject&, Ref<TestStringifier>&&); … … 58 59 class JSTestStringifierOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp ¶
r233122 r235271 28 28 #include "JSDOMOperation.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 180 183 } 181 184 182 bool JSTestStringifierAnonymousOperationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 185 void JSTestStringifierAnonymousOperation::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 186 { 187 auto* thisObject = jsCast<JSTestStringifierAnonymousOperation*>(cell); 188 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 189 if (thisObject->scriptExecutionContext()) 190 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 191 Base::heapSnapshot(cell, builder); 192 } 193 194 bool JSTestStringifierAnonymousOperationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 183 195 { 184 196 UNUSED_PARAM(handle); 185 197 UNUSED_PARAM(visitor); 198 UNUSED_PARAM(reason); 186 199 return false; 187 200 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h ¶
r218789 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestStringifierAnonymousOperation(JSC::Structure*, JSDOMGlobalObject&, Ref<TestStringifierAnonymousOperation>&&); … … 58 59 class JSTestStringifierAnonymousOperationOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp ¶
r233122 r235271 28 28 #include "JSDOMOperation.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 195 198 } 196 199 197 bool JSTestStringifierNamedOperationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 200 void JSTestStringifierNamedOperation::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 201 { 202 auto* thisObject = jsCast<JSTestStringifierNamedOperation*>(cell); 203 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 204 if (thisObject->scriptExecutionContext()) 205 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 206 Base::heapSnapshot(cell, builder); 207 } 208 209 bool JSTestStringifierNamedOperationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 198 210 { 199 211 UNUSED_PARAM(handle); 200 212 UNUSED_PARAM(visitor); 213 UNUSED_PARAM(reason); 201 214 return false; 202 215 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierNamedOperation.h ¶
r218789 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestStringifierNamedOperation(JSC::Structure*, JSDOMGlobalObject&, Ref<TestStringifierNamedOperation>&&); … … 58 59 class JSTestStringifierNamedOperationOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp ¶
r233122 r235271 28 28 #include "JSDOMOperation.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 195 198 } 196 199 197 bool JSTestStringifierOperationImplementedAsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 200 void JSTestStringifierOperationImplementedAs::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 201 { 202 auto* thisObject = jsCast<JSTestStringifierOperationImplementedAs*>(cell); 203 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 204 if (thisObject->scriptExecutionContext()) 205 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 206 Base::heapSnapshot(cell, builder); 207 } 208 209 bool JSTestStringifierOperationImplementedAsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 198 210 { 199 211 UNUSED_PARAM(handle); 200 212 UNUSED_PARAM(visitor); 213 UNUSED_PARAM(reason); 201 214 return false; 202 215 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h ¶
r218789 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestStringifierOperationImplementedAs(JSC::Structure*, JSDOMGlobalObject&, Ref<TestStringifierOperationImplementedAs>&&); … … 58 59 class JSTestStringifierOperationImplementedAsOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp ¶
r233122 r235271 28 28 #include "JSDOMOperation.h" 29 29 #include "JSDOMWrapperCache.h" 30 #include "ScriptExecutionContext.h" 31 #include "URL.h" 30 32 #include <JavaScriptCore/FunctionPrototype.h> 33 #include <JavaScriptCore/HeapSnapshotBuilder.h> 31 34 #include <JavaScriptCore/JSCInlines.h> 32 35 #include <wtf/GetPtr.h> … … 180 183 } 181 184 182 bool JSTestStringifierOperationNamedToStringOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 185 void JSTestStringifierOperationNamedToString::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 186 { 187 auto* thisObject = jsCast<JSTestStringifierOperationNamedToString*>(cell); 188 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 189 if (thisObject->scriptExecutionContext()) 190 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 191 Base::heapSnapshot(cell, builder); 192 } 193 194 bool JSTestStringifierOperationNamedToStringOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 183 195 { 184 196 UNUSED_PARAM(handle); 185 197 UNUSED_PARAM(visitor); 198 UNUSED_PARAM(reason); 186 199 return false; 187 200 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h ¶
r218789 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestStringifierOperationNamedToString(JSC::Structure*, JSDOMGlobalObject&, Ref<TestStringifierOperationNamedToString>&&); … … 58 59 class JSTestStringifierOperationNamedToStringOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp ¶
r233122 r235271 29 29 #include "JSDOMOperation.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 32 #include "URL.h" 31 33 #include <JavaScriptCore/FunctionPrototype.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 35 #include <JavaScriptCore/JSCInlines.h> 33 36 #include <wtf/GetPtr.h> … … 202 205 } 203 206 204 bool JSTestStringifierReadOnlyAttributeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 207 void JSTestStringifierReadOnlyAttribute::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 208 { 209 auto* thisObject = jsCast<JSTestStringifierReadOnlyAttribute*>(cell); 210 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 211 if (thisObject->scriptExecutionContext()) 212 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 213 Base::heapSnapshot(cell, builder); 214 } 215 216 bool JSTestStringifierReadOnlyAttributeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 205 217 { 206 218 UNUSED_PARAM(handle); 207 219 UNUSED_PARAM(visitor); 220 UNUSED_PARAM(reason); 208 221 return false; 209 222 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h ¶
r218789 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestStringifierReadOnlyAttribute(JSC::Structure*, JSDOMGlobalObject&, Ref<TestStringifierReadOnlyAttribute>&&); … … 58 59 class JSTestStringifierReadOnlyAttributeOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp ¶
r233122 r235271 29 29 #include "JSDOMOperation.h" 30 30 #include "JSDOMWrapperCache.h" 31 #include "ScriptExecutionContext.h" 32 #include "URL.h" 31 33 #include <JavaScriptCore/FunctionPrototype.h> 34 #include <JavaScriptCore/HeapSnapshotBuilder.h> 32 35 #include <JavaScriptCore/JSCInlines.h> 33 36 #include <wtf/GetPtr.h> … … 220 223 } 221 224 222 bool JSTestStringifierReadWriteAttributeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 225 void JSTestStringifierReadWriteAttribute::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 226 { 227 auto* thisObject = jsCast<JSTestStringifierReadWriteAttribute*>(cell); 228 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 229 if (thisObject->scriptExecutionContext()) 230 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 231 Base::heapSnapshot(cell, builder); 232 } 233 234 bool JSTestStringifierReadWriteAttributeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 223 235 { 224 236 UNUSED_PARAM(handle); 225 237 UNUSED_PARAM(visitor); 238 UNUSED_PARAM(reason); 226 239 return false; 227 240 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h ¶
r218789 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 protected: 53 54 JSTestStringifierReadWriteAttribute(JSC::Structure*, JSDOMGlobalObject&, Ref<TestStringifierReadWriteAttribute>&&); … … 58 59 class JSTestStringifierReadWriteAttributeOwner : public JSC::WeakHandleOwner { 59 60 public: 60 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );61 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 61 62 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 62 63 }; -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp ¶
r233122 r235271 44 44 #include "JSTestEventTarget.h" 45 45 #include "JSTestSubObj.h" 46 #include "ScriptExecutionContext.h" 46 47 #include "SerializedScriptValue.h" 48 #include "URL.h" 47 49 #include <JavaScriptCore/FunctionPrototype.h> 50 #include <JavaScriptCore/HeapSnapshotBuilder.h> 48 51 #include <JavaScriptCore/JSArray.h> 49 52 #include <JavaScriptCore/JSCInlines.h> … … 742 745 } 743 746 744 bool JSTestTypedefsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 747 void JSTestTypedefs::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) 748 { 749 auto* thisObject = jsCast<JSTestTypedefs*>(cell); 750 builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); 751 if (thisObject->scriptExecutionContext()) 752 builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data())); 753 Base::heapSnapshot(cell, builder); 754 } 755 756 bool JSTestTypedefsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) 745 757 { 746 758 UNUSED_PARAM(handle); 747 759 UNUSED_PARAM(visitor); 760 UNUSED_PARAM(reason); 748 761 return false; 749 762 } -
TabularUnified trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h ¶
r216198 r235271 50 50 51 51 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); 52 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); 52 53 public: 53 54 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags; … … 60 61 class JSTestTypedefsOwner : public JSC::WeakHandleOwner { 61 62 public: 62 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor& );63 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); 63 64 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); 64 65 }; -
TabularUnified trunk/Source/WebCore/dom/Document.idl ¶
r231849 r235271 36 36 ConstructorCallWith=Document, 37 37 CustomToJSObject, 38 CustomHeapSnapshot, 38 39 DOMJIT, 39 40 ExportMacro=WEBCORE_EXPORT, -
TabularUnified trunk/Source/WebCore/page/DOMWindow.idl ¶
r235050 r235271 34 34 CustomGetOwnPropertySlot, 35 35 CustomGetPrototype, 36 CustomHeapSnapshot, 36 37 CustomPreventExtensions, 37 38 CustomProxyToJSObject, -
TabularUnified trunk/Source/WebInspectorUI/ChangeLog ¶
r235257 r235271 1 2018-08-23 Simon Fraser <simon.fraser@apple.com> 2 3 Add support for dumping GC heap snapshots, and a viewer 4 https://bugs.webkit.org/show_bug.cgi?id=186416 5 6 Reviewed by Joseph Pecoraro. 7 8 Make a way to dump information about the GC heap that is useful for looking for leaked 9 or abandoned objects. This dump is obtained (on Apple platforms) via: 10 notifyutil -p com.apple.WebKit.dumpGCHeap 11 which writes a JSON file to /tmp which can then be loaded into the viewer in Tools/GCHeapInspector. 12 13 This leverages the heap snapshot used by Web Inspector, adding an alternate format for 14 the snapshot JSON that adds additional data about objects and why they are GC roots. 15 16 The generated bindings code is changed to include the output root reason from isReachableFromOpaqueRoots(), 17 and to implement heapSnapshot() which provides the address of the wrapped object. A new IDL attribute, 18 CustomHeapSnapshot, is used to allow custom heapSnapshot() implementations for classes like JSDocument 19 that need to decorate the heap snapshot cell data with things like the document URL. 20 21 GCController registers a notifyutil callback which gathers the debug heap snapshot, and dumps it 22 to a file in /tmp. The file path is printed out to the system log. 23 24 * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js: 25 (HeapSnapshot): 26 1 27 2018-08-23 Brian Burg <bburg@apple.com> 2 28 -
TabularUnified trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js ¶
r230831 r235271 83 83 snapshotDataString = null; 84 84 85 let {version, nodes, nodeClassNames, edges, edgeTypes, edgeNames} = json;85 let {version, type, nodes, nodeClassNames, edges, edgeTypes, edgeNames} = json; 86 86 console.assert(version === 1, "Expect JavaScriptCore Heap Snapshot version 1"); 87 console.assert(!type || type === "Inspector", "Expect an Inspector Heap Snapshot"); 87 88 88 89 this._nodes = nodes; -
TabularUnified trunk/Tools/ChangeLog ¶
r235259 r235271 1 2018-08-23 Simon Fraser <simon.fraser@apple.com> 2 3 Add support for dumping GC heap snapshots, and a viewer 4 https://bugs.webkit.org/show_bug.cgi?id=186416 5 6 Reviewed by Joseph Pecoraro. 7 8 Add a viewer for GC heap snapshots. A snapshot JSON file can be dragged into this 9 page for inspection (or set via the 'filename' URL parameter). 10 11 For now, this page shows all objects, all roots, and the shortest path from a root 12 to all HTMLDocuments and Windows. 13 14 * GCHeapInspector/gc-heap-inspector.html: Added. 15 * GCHeapInspector/heap-analysis/HeapSnapshot.js: Copied from Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js. 16 * GCHeapInspector/script/interface.js: Added. 17 1 18 2018-08-23 Alex Christensen <achristensen@webkit.org> 2 19 -
TabularUnified trunk/Tools/GCHeapInspector/heap-analysis/HeapSnapshot.js ¶
r235269 r235271 31 31 32 32 // nodes 33 // [<0:id>, <1:size>, <2:classNameTableIndex>, <3:internal> ]34 const nodeFieldCount = 4;33 // [<0:id>, <1:size>, <2:classNameTableIndex>, <3:internal>, <4:labelIndex>, <5:address>, <6:wrapped address>] 34 let nodeFieldCount = 7; 35 35 const nodeIdOffset = 0; 36 36 const nodeSizeOffset = 1; 37 37 const nodeClassNameOffset = 2; 38 38 const nodeInternalOffset = 3; 39 const nodeLabelOffset = 4; 40 const nodeAddressOffset = 5; 41 const nodeWrappedAddressOffset = 6; 39 42 40 43 // edges … … 45 48 const edgeTypeOffset = 2; 46 49 const edgeDataOffset = 3; 50 51 // roots 52 // [<0:id>, <1:labelIndex>] 53 let rootFieldCount = 3; 54 const rootIdOffset = 0; 55 const rootLabelOffset = 1; 56 const reachabilityReasonOffset = 2; 47 57 48 58 // Other constants. … … 83 93 snapshotDataString = null; 84 94 85 let {version, nodes, nodeClassNames, edges, edgeTypes, edgeNames} = json;95 let {version, type, nodes, nodeClassNames, edges, edgeTypes, edgeNames, roots, labels} = json; 86 96 console.assert(version === 1, "Expect JavaScriptCore Heap Snapshot version 1"); 97 console.assert(type === "GCDebugging", "Expect a GCDebugging-type snapshot"); 87 98 88 99 this._nodes = nodes; 89 100 this._nodeCount = nodes.length / nodeFieldCount; 101 102 this._roots = roots; 103 this._rootCount = roots.length / rootFieldCount; 90 104 91 105 this._edges = edges; … … 95 109 this._edgeNamesTable = edgeNames; 96 110 this._nodeClassNamesTable = nodeClassNames; 111 this._labelsTable = labels; 97 112 98 113 this._totalSize = 0; … … 108 123 } 109 124 125 this._rootIdentifierToReasons = new Map; // <node identifier> => Set of root reasons 126 for (let rootIndex = 0; rootIndex < roots.length; rootIndex += rootFieldCount) { 127 let rootOrdinal = rootIndex / rootFieldCount; 128 let rootIdentifier = roots[rootIndex + rootIdOffset]; 129 let rootReasonIndex = roots[rootIndex + rootLabelOffset]; 130 let rootReachabilityIndex = roots[rootIndex + reachabilityReasonOffset]; 131 132 let existingReasons = this._rootIdentifierToReasons.get(rootIdentifier); 133 if (existingReasons) { 134 existingReasons.add(rootReasonIndex); 135 existingReasons.add(rootReachabilityIndex); 136 } else 137 this._rootIdentifierToReasons.set(rootIdentifier, new Set([rootReasonIndex, rootReachabilityIndex])); 138 } 139 110 140 // FIXME: Replace toIdentifier and fromIdentifier in edges with nodeIndex to reduce hash lookups? 111 141 … … 137 167 this._categories = categories; 138 168 } 169 170 get proxyObjectId() { return this._proxyObjectId; } 171 get identifier() { return this._identifier; } 172 get title() { return this._title; } 173 get totalSize() { return this._totalSize; } 174 get totalObjectCount() { return this._totalObjectCount; } 175 get liveSize() { return this._liveSize; } 176 get categories() { return this._categories; } 177 get invalid() { return this._proxyObjectId === 0; } 139 178 140 179 // Static … … 264 303 // node is either a gcRoot or only reachable via Internal nodes. 265 304 266 let paths = this._gcRootPath es(nodeIdentifier);305 let paths = this._gcRootPaths(nodeIdentifier); 267 306 if (!paths.length) 268 307 return []; … … 288 327 return this.serializeEdge(component.edge); 289 328 }); 329 } 330 331 rootNodes() 332 { 333 let rootNodeIndexSet = new Set; 334 335 // Identifiers can occur multiple times in the roots list. 336 for (let rootIndex = 0; rootIndex < this._roots.length; rootIndex += rootFieldCount) { 337 let rootOrdinal = rootIndex / rootFieldCount; 338 let rootIdentifier = this._roots[rootIndex + rootIdOffset]; 339 340 let toNodeOrdinal = this._nodeIdentifierToOrdinal.get(rootIdentifier); 341 let toNodeIndex = toNodeOrdinal * nodeFieldCount; 342 343 rootNodeIndexSet.add(toNodeIndex); 344 } 345 346 return Array.from(rootNodeIndexSet.values()).map(this.serializeNode, this); 347 } 348 349 reasonNamesForRoot(rootIdentifier) 350 { 351 let reasonIndexes = this._rootIdentifierToReasons.get(rootIdentifier); 352 if (!reasonIndexes) 353 return []; 354 return Array.from(reasonIndexes).map(this.labelForIndex, this).filter(a => a != 0) 290 355 } 291 356 … … 408 473 serializeNode(nodeIndex) 409 474 { 410 console.assert((nodeIndex % nodeFieldCount) === 0, "Invalid nodeIndex to serialize ");475 console.assert((nodeIndex % nodeFieldCount) === 0, "Invalid nodeIndex to serialize: " + nodeIndex); 411 476 412 477 let nodeIdentifier = this._nodes[nodeIndex + nodeIdOffset]; … … 419 484 let dominatorNodeIdentifier = this._nodes[dominatorNodeIndex + nodeIdOffset]; 420 485 421 return{486 let result = { 422 487 id: nodeIdentifier, 423 488 className: this._nodeClassNamesTable[this._nodes[nodeIndex + nodeClassNameOffset]], … … 426 491 internal: this._nodes[nodeIndex + nodeInternalOffset] ? true : false, 427 492 gcRoot: this._nodeOrdinalIsGCRoot[nodeOrdinal] ? true : false, 493 markedRoot : this._rootIdentifierToReasons.has(nodeIdentifier), 428 494 dead: this._nodeOrdinalIsDead[nodeOrdinal] ? true : false, 495 address: this._nodes[nodeIndex + nodeAddressOffset], 496 label: this._labelsTable[this._nodes[nodeIndex + nodeLabelOffset]], 429 497 dominatorNodeIdentifier, 430 498 hasChildren, 431 499 }; 500 501 let wrappedAddr = this._nodes[nodeIndex + nodeWrappedAddressOffset]; 502 if (wrappedAddr !== "0x0") 503 result.wrappedAddress = wrappedAddr; 504 505 return result; 506 } 507 508 labelForIndex(index) 509 { 510 return this._labelsTable[index]; 432 511 } 433 512 … … 714 793 } 715 794 716 _gcRootPath es(nodeIdentifier)795 _gcRootPaths(nodeIdentifier) 717 796 { 718 797 let targetNodeOrdinal = this._nodeIdentifierToOrdinal.get(nodeIdentifier); … … 751 830 let fromNodeOrdinal = this._incomingNodes[incomingEdgeIndex]; 752 831 let fromNodeIndex = fromNodeOrdinal * nodeFieldCount; 753 let fromNodeIsInternal = this._nodes[fromNodeIndex + nodeInternalOffset];754 if (fromNodeIsInternal)755 continue;832 // let fromNodeIsInternal = this._nodes[fromNodeIndex + nodeInternalOffset]; 833 // if (fromNodeIsInternal) 834 // continue; 756 835 757 836 let edgeIndex = this._incomingEdges[incomingEdgeIndex]; … … 769 848 } 770 849 }; 771 772 HeapSnapshotDiff = class HeapSnapshotDiff773 {774 constructor(objectId, snapshot1, snapshot2)775 {776 this._objectId = objectId;777 778 this._snapshot1 = snapshot1;779 this._snapshot2 = snapshot2;780 781 this._totalSize = 0;782 this._addedNodeIdentifiers = new Set;783 784 let known = new Map;785 for (let nodeIndex = 0; nodeIndex < this._snapshot1._nodes.length; nodeIndex += nodeFieldCount) {786 let nodeIdentifier = this._snapshot1._nodes[nodeIndex + nodeIdOffset];787 known.set(nodeIdentifier, nodeIndex);788 }789 790 for (let nodeIndex = 0; nodeIndex < this._snapshot2._nodes.length; nodeIndex += nodeFieldCount) {791 let nodeIdentifier = this._snapshot2._nodes[nodeIndex + nodeIdOffset];792 let existed = known.delete(nodeIdentifier);793 if (!existed) {794 this._addedNodeIdentifiers.add(nodeIdentifier);795 this._totalSize += this._snapshot2._nodes[nodeIndex + nodeSizeOffset];796 }797 }798 799 let {liveSize, categories} = HeapSnapshot.updateCategoriesAndMetadata(this._snapshot2, (nodeIdentifier) => this._addedNodeIdentifiers.has(nodeIdentifier));800 this._categories = categories;801 }802 803 // Worker Methods804 805 allocationBucketCounts(bucketSizes)806 {807 return HeapSnapshot.allocationBucketCounts(this._snapshot2, bucketSizes, (nodeIdentifier) => this._addedNodeIdentifiers.has(nodeIdentifier));808 }809 810 instancesWithClassName(className)811 {812 return HeapSnapshot.instancesWithClassName(this._snapshot2, className, (nodeIdentifier) => this._addedNodeIdentifiers.has(nodeIdentifier));813 }814 815 update()816 {817 return HeapSnapshot.updateCategoriesAndMetadata(this._snapshot2, (nodeIdentifier) => this._addedNodeIdentifiers.has(nodeIdentifier));818 }819 820 nodeWithIdentifier(nodeIdentifier) { return this._snapshot2.nodeWithIdentifier(nodeIdentifier); }821 shortestGCRootPath(nodeIdentifier) { return this._snapshot2.shortestGCRootPath(nodeIdentifier); }822 dominatedNodes(nodeIdentifier) { return this._snapshot2.dominatedNodes(nodeIdentifier); }823 retainedNodes(nodeIdentifier) { return this._snapshot2.retainedNodes(nodeIdentifier); }824 retainers(nodeIdentifier) { return this._snapshot2.retainers(nodeIdentifier); }825 826 // Public827 828 serialize()829 {830 return {831 snapshot1: this._snapshot1.serialize(),832 snapshot2: this._snapshot2.serialize(),833 totalSize: this._totalSize,834 totalObjectCount: this._addedNodeIdentifiers.size,835 categories: this._categories,836 };837 }838 };
Note:
See TracChangeset
for help on using the changeset viewer.