void JSMessageChannel::visitAdditionalChildren(JSC::SlotVisitor& visitor)
{
    if (MessagePort* port = impl().port1())
        visitor.addOpaqueRoot(port);

    if (MessagePort* port = impl().port2())
        visitor.addOpaqueRoot(port);
}
bool WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor)
{
    auto& wrapper = *JSC::jsCast<JSC::JSArrayBuffer*>(handle.slot()->asCell());
    if (!wrapper.hasCustomProperties())
        return false;
    return visitor.containsOpaqueRoot(wrapper.impl());
}
void AllocatedPlaceholder::visitChildren(JSCell* cell, JSC::SlotVisitor& visitor) {
    Base::visitChildren(cell, visitor);

    AllocatedPlaceholder* object = jsCast<AllocatedPlaceholder*>(cell);

    visitor.append(&object->_instanceStructure);
}
bool JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, JSC::SlotVisitor& visitor, const char**)
{
    JSC::JSAPIWrapperObject* wrapperObject = JSC::jsCast<JSC::JSAPIWrapperObject*>(handle.get().asCell());
    // We use the JSGlobalObject when processing weak handles to prevent the situation where using
    // the same wrapped object in multiple global objects keeps all of the global objects alive.
    if (!wrapperObject->wrappedObject())
        return false;
    return JSC::Heap::isMarked(wrapperObject->structure()->globalObject()) && visitor.containsOpaqueRoot(wrapperObject->wrappedObject());
}
void JSSVGElementInstance::visitChildren(JSC::JSCell* cell, JSC::SlotVisitor& visitor)
{
    JSSVGElementInstance* thisObject = static_cast<JSSVGElementInstance*>(cell);
    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
    COMPILE_ASSERT(StructureFlags & JSC::OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
    Base::visitChildren(thisObject, visitor);
    visitor.addOpaqueRoot(root(thisObject->impl()->correspondingElement()));
}
void JSSVGElementInstance::visitChildren(JSC::JSCell* cell, JSC::SlotVisitor& visitor)
{
    JSSVGElementInstance* thisObject = JSC::jsCast<JSSVGElementInstance*>(cell);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    COMPILE_ASSERT(StructureFlags & JSC::OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
    // Skip JSEventTarget::visitChildren because event listener registration is
    // forwarded to the corresponding element.
    JSEventTarget::Base::visitChildren(thisObject, visitor);
    visitor.addOpaqueRoot(root(thisObject->impl().correspondingElement()));
}
void JSCryptoKeyPair::visitAdditionalChildren(JSC::SlotVisitor& visitor)
{
    visitor.addOpaqueRoot(impl().publicKey());
    visitor.addOpaqueRoot(impl().privateKey());
}
void JSTreeWalker::visitAdditionalChildren(JSC::SlotVisitor& visitor)
{
    if (NodeFilter* filter = impl().filter())
        visitor.addOpaqueRoot(filter);
}
void JSSVGElementInstance::visitAdditionalChildren(JSC::SlotVisitor& visitor)
{
    visitor.addOpaqueRoot(root(impl().correspondingElement()));
}
void JSStyleSheet::visitAdditionalChildren(JSC::SlotVisitor& visitor)
{
    visitor.addOpaqueRoot(root(&impl()));
}
void JSHTMLTemplateElement::visitAdditionalChildren(JSC::SlotVisitor& visitor)
{
    if (auto* content = wrapped().contentIfAvailable())
        visitor.addOpaqueRoot(root(content));
}