Refactor opaque root logic in WebCore in preparation for Node GC optimizations
https://bugs.webkit.org/show_bug.cgi?id=240998
Reviewed by Geoffrey Garen.
Refactor opaque root logic in WebCore in preparation for Node GC optimizations.
Introduce addWebCoreOpaqueRoot() / containsWebCoreOpaqueRoot() functions for
WebCore to deal with opaque roots, instead of interacting with the SlotVisitor
directly. This introduce a nice central point in WebCore where we will be
able to set / check flags on Node to speed up GC.
Also introduce a WebCoreOpaqueRoot type to replace void* as type of opaque
roots in WebCore. This is useful because we will need to know whether an
opaque root in a Node or not in a future patch.
There is no expected behavior change from this patch, this is just pure
refactoring to make it a lot easier for us to optimize Node gargabe collection.
- Source/WebCore/Modules/fetch/FetchRequest.cpp:
(WebCore::root):
- Source/WebCore/Modules/fetch/FetchRequest.h:
- Source/WebCore/Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::opaqueRoot):
(WebCore::root):
- Source/WebCore/Modules/indexeddb/IDBIndex.h:
- Source/WebCore/Modules/indexeddb/IDBIndex.idl:
- Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::visitReferencedIndexes const):
(WebCore::root):
- Source/WebCore/Modules/indexeddb/IDBObjectStore.h:
- Source/WebCore/Modules/indexeddb/IDBRequest.cpp:
(WebCore::root):
- Source/WebCore/Modules/indexeddb/IDBRequest.h:
- Source/WebCore/Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::visitReferencedObjectStores const):
- Source/WebCore/Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::opaqueRoot):
- Source/WebCore/Modules/mediasource/SourceBuffer.h:
- Source/WebCore/Modules/mediasource/SourceBufferList.cpp:
(WebCore::root):
- Source/WebCore/Modules/mediasource/SourceBufferList.h:
- Source/WebCore/Modules/remoteplayback/RemotePlayback.cpp:
(WebCore::RemotePlayback::opaqueRootConcurrently const):
- Source/WebCore/Modules/remoteplayback/RemotePlayback.h:
- Source/WebCore/Modules/webaudio/AudioBuffer.cpp:
(WebCore::root):
- Source/WebCore/Modules/webaudio/AudioBuffer.h:
- Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp:
(WebCore::AudioWorkletGlobalScope::visitProcessors):
- Source/WebCore/Modules/webaudio/AudioWorkletProcessor.cpp:
(WebCore::root):
- Source/WebCore/Modules/webaudio/AudioWorkletProcessor.h:
- Source/WebCore/Modules/webxr/WebXRSession.cpp:
(WebCore::root):
- Source/WebCore/Modules/webxr/WebXRSession.h:
- Source/WebCore/Sources.txt:
- Source/WebCore/WebCore.xcodeproj/project.pbxproj:
- Source/WebCore/bindings/js/JSAbortSignalCustom.cpp:
(WebCore::JSAbortSignalOwner::isReachableFromOpaqueRoots):
- Source/WebCore/bindings/js/JSAttrCustom.cpp:
(WebCore::JSAttr::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSAudioBufferSourceNodeCustom.cpp:
(WebCore::JSAudioBufferSourceNode::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSCSSRuleCustom.cpp:
(WebCore::JSCSSRule::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSCSSRuleCustom.h:
(WebCore::root):
- Source/WebCore/bindings/js/JSCSSRuleListCustom.cpp:
(WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
- Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::root):
(WebCore::JSCSSStyleDeclaration::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.h:
- Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
(WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSDOMQuadCustom.cpp:
(WebCore::JSDOMQuad::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
- Source/WebCore/bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSFetchEventCustom.cpp:
(WebCore::JSFetchEvent::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSHTMLTemplateElementCustom.cpp:
(WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSIDBCursorCustom.cpp:
(WebCore::JSIDBCursor::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSIDBIndexCustom.cpp: Removed.
(WebCore::JSIDBIndex::visitAdditionalChildren): Deleted.
- Source/WebCore/bindings/js/JSIntersectionObserverCustom.cpp:
(WebCore::JSIntersectionObserver::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSIntersectionObserverEntryCustom.cpp:
(WebCore::JSIntersectionObserverEntry::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSMediaListCustom.h:
(WebCore::root):
- Source/WebCore/bindings/js/JSMessageChannelCustom.cpp:
(WebCore::JSMessageChannel::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSNavigatorCustom.cpp:
(WebCore::JSNavigator::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSNodeCustom.cpp:
(WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
(WebCore::JSNode::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSNodeCustom.h:
(WebCore::root):
- Source/WebCore/bindings/js/JSNodeIteratorCustom.cpp:
(WebCore::JSNodeIterator::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSNodeListCustom.cpp:
(WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
- Source/WebCore/bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp:
(WebCore::root):
(WebCore::JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
(WebCore::JSOffscreenCanvasRenderingContext2D::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSPaintRenderingContext2DCustom.cpp:
(WebCore::root):
(WebCore::JSPaintRenderingContext2DOwner::isReachableFromOpaqueRoots):
(WebCore::JSPaintRenderingContext2D::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSResizeObserverEntryCustom.cpp:
(WebCore::JSResizeObserverEntry::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSSVGViewSpecCustom.cpp:
(WebCore::JSSVGViewSpec::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSServiceWorkerGlobalScopeCustom.cpp:
(WebCore::JSServiceWorkerGlobalScope::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSStyleSheetCustom.cpp:
(WebCore::JSStyleSheet::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSStyleSheetCustom.h:
(WebCore::root):
- Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
(WebCore::JSTextTrackCue::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSTreeWalkerCustom.cpp:
(WebCore::JSTreeWalker::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSUndoItemCustom.cpp:
(WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
- Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::JSWebGL2RenderingContext::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::JSWebGLRenderingContext::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSWebXRSessionCustom.cpp:
(WebCore::JSWebXRSession::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSWorkerNavigatorCustom.cpp:
(WebCore::JSWorkerNavigator::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitAdditionalChildren):
- Source/WebCore/bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitAdditionalChildren):
- Source/WebCore/bindings/js/WebCoreOpaqueRoot.h: Added.
(WebCore::WebCoreOpaqueRoot::WebCoreOpaqueRoot):
(WebCore::WebCoreOpaqueRoot::isNode const):
(WebCore::WebCoreOpaqueRoot::pointer const):
(WebCore::addWebCoreOpaqueRoot):
(WebCore::containsWebCoreOpaqueRoot):
- Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
- Source/WebCore/bindings/scripts/test/JS/JSTestGenerateAddOpaqueRoot.cpp:
(WebCore::JSTestGenerateAddOpaqueRoot::visitChildrenImpl):
- Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
- Source/WebCore/crypto/CryptoKey.cpp:
(WebCore::root):
- Source/WebCore/crypto/CryptoKey.h:
- Source/WebCore/dom/AbortController.cpp:
(WebCore::AbortController::opaqueRoot):
- Source/WebCore/dom/AbortController.h:
- Source/WebCore/dom/AbortController.idl:
- Source/WebCore/dom/AbortSignal.cpp:
(WebCore::root):
- Source/WebCore/dom/AbortSignal.h:
- Source/WebCore/dom/DOMPointReadOnly.cpp:
(WebCore::root):
- Source/WebCore/dom/DOMPointReadOnly.h:
- Source/WebCore/dom/DOMRectReadOnly.cpp:
(WebCore::root):
- Source/WebCore/dom/DOMRectReadOnly.h:
- Source/WebCore/dom/DocumentInlines.h:
(WebCore::Node::opaqueRoot const):
- Source/WebCore/dom/MessagePort.cpp:
(WebCore::root):
- Source/WebCore/dom/MessagePort.h:
- Source/WebCore/dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::isReachableFromOpaqueRoots const):
- Source/WebCore/dom/MutationRecord.cpp:
- Source/WebCore/dom/Node.cpp:
(WebCore::Node::traverseToOpaqueRoot const):
- Source/WebCore/dom/Node.h:
(WebCore::Node::opaqueRoot const): Deleted.
- Source/WebCore/dom/NodeFilter.h:
(WebCore::root):
- Source/WebCore/dom/Range.cpp:
(WebCore::Range::visitNodesConcurrently const):
- Source/WebCore/dom/ScriptExecutionContext.cpp:
(WebCore::root):
- Source/WebCore/dom/ScriptExecutionContext.h:
- Source/WebCore/dom/StaticRange.cpp:
(WebCore::StaticRange::visitNodesConcurrently const):
- Source/WebCore/fileapi/Blob.cpp:
(WebCore::root):
- Source/WebCore/fileapi/Blob.h:
- Source/WebCore/html/CanvasBase.cpp:
(WebCore::root):
- Source/WebCore/html/CanvasBase.h:
- Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::root):
- Source/WebCore/html/HTMLCanvasElement.h:
- Source/WebCore/html/HTMLMediaElement.h:
- Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::addMembersToOpaqueRoots):
- Source/WebCore/html/canvas/WebGLFramebuffer.cpp:
- Source/WebCore/html/canvas/WebGLObject.cpp:
(WebCore::root):
- Source/WebCore/html/canvas/WebGLObject.h:
- Source/WebCore/html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::addMembersToOpaqueRoots):
- Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::addMembersToOpaqueRoots):
(WebCore::root):
- Source/WebCore/html/canvas/WebGLRenderingContextBase.h:
- Source/WebCore/html/canvas/WebGLTransformFeedback.cpp:
(WebCore::WebGLTransformFeedback::addMembersToOpaqueRoots):
- Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp:
(WebCore::WebGLVertexArrayObjectBase::addMembersToOpaqueRoots):
(WebCore::root):
- Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h:
- Source/WebCore/html/track/TrackBase.cpp:
(WebCore::TrackBase::opaqueRoot):
- Source/WebCore/html/track/TrackBase.h:
(WebCore::root):
- Source/WebCore/html/track/TrackListBase.cpp:
(WebCore::TrackListBase::opaqueRoot):
- Source/WebCore/html/track/TrackListBase.h:
(WebCore::root):
- Source/WebCore/page/DOMWindow.cpp:
(WebCore::root):
- Source/WebCore/page/DOMWindow.h:
- Source/WebCore/page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::isReachableFromOpaqueRoots const):
- Source/WebCore/page/NavigatorBase.cpp:
(WebCore::root):
- Source/WebCore/page/NavigatorBase.h:
- Source/WebCore/page/ResizeObserver.cpp:
(WebCore::ResizeObserver::isReachableFromOpaqueRoots const):
- Source/WebCore/workers/WorkerLocation.cpp:
(WebCore::root):
- Source/WebCore/workers/WorkerLocation.h:
(WebCore::WorkerLocation::create):
(WebCore::WorkerLocation::url const):
(WebCore::WorkerLocation::WorkerLocation):
- Source/WebCore/workers/service/ServiceWorkerClients.cpp:
(WebCore::root):
- Source/WebCore/workers/service/ServiceWorkerClients.h:
- Source/WebCore/workers/service/ServiceWorkerRegistration.cpp:
(WebCore::root):
- Source/WebCore/workers/service/ServiceWorkerRegistration.h:
- Source/WebCore/xml/XMLHttpRequestUpload.cpp:
(WebCore::root):
- Source/WebCore/xml/XMLHttpRequestUpload.h:
Canonical link: https://commits.webkit.org/251082@main
|