[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 67/73: Bug 1777574, automate CC zone handling, r=mccr8 a=RyanVM



This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch geckoview-102.3.0esr-12.0-1
in repository tor-browser.

commit 7a4366e13b36f3012b90eef6b871a0eb393ef05b
Author: Olli Pettay <Olli.Pettay@xxxxxxxxxxx>
AuthorDate: Tue Sep 6 22:04:25 2022 +0000

    Bug 1777574, automate CC zone handling, r=mccr8 a=RyanVM
    
    Differential Revision: https://phabricator.services.mozilla.com/D156605
---
 accessible/aom/AccessibleNode.h                    |   2 +-
 devtools/shared/heapsnapshot/DominatorTree.h       |   2 +-
 devtools/shared/heapsnapshot/HeapSnapshot.h        |   2 +-
 docshell/base/BrowsingContextGroup.h               |   2 +-
 docshell/base/WindowContext.cpp                    |   4 +-
 docshell/base/WindowContext.h                      |   2 +-
 docshell/shistory/ChildSHistory.cpp                |   4 +-
 docshell/shistory/ChildSHistory.h                  |   2 +-
 dom/animation/AnimationEffect.cpp                  |   4 +-
 dom/animation/AnimationEffect.h                    |   2 +-
 dom/animation/AnimationTimeline.cpp                |   4 +-
 dom/animation/AnimationTimeline.h                  |   2 +-
 dom/animation/CSSPseudoElement.h                   |   2 +-
 dom/base/AbstractRange.cpp                         |   4 +-
 dom/base/AbstractRange.h                           |   2 +-
 dom/base/Attr.cpp                                  |   4 +-
 dom/base/Attr.h                                    |   2 +-
 dom/base/BarProps.h                                |   2 +-
 dom/base/CharacterData.cpp                         |   6 +-
 dom/base/CharacterData.h                           |   4 +-
 dom/base/Crypto.h                                  |   2 +-
 dom/base/CustomElementRegistry.cpp                 |   2 +-
 dom/base/DOMImplementation.h                       |   2 +-
 dom/base/DOMIntersectionObserver.h                 |   2 +-
 dom/base/DOMMatrix.h                               |   2 +-
 dom/base/DOMParser.h                               |   2 +-
 dom/base/DOMPoint.h                                |   2 +-
 dom/base/DOMQuad.h                                 |   2 +-
 dom/base/DOMRect.h                                 |   4 +-
 dom/base/DOMStringList.h                           |   2 +-
 dom/base/External.h                                |   2 +-
 dom/base/FormData.cpp                              |   4 +-
 dom/base/FormData.h                                |   2 +-
 dom/base/FragmentOrElement.cpp                     |   6 +-
 dom/base/FragmentOrElement.h                       |   2 +-
 dom/base/IdleDeadline.h                            |   2 +-
 dom/base/IntlUtils.h                               |   2 +-
 dom/base/Location.h                                |   2 +-
 dom/base/Navigator.cpp                             |   4 +-
 dom/base/Navigator.h                               |   2 +-
 dom/base/PlacesWeakCallbackWrapper.h               |   2 +-
 dom/base/ResizeObserver.cpp                        |   4 +-
 dom/base/ResizeObserver.h                          |   6 +-
 dom/base/ScreenLuminance.h                         |   2 +-
 dom/base/Selection.cpp                             |   3 +-
 dom/base/Selection.h                               |   2 +-
 dom/base/StructuredCloneTester.h                   |   2 +-
 dom/base/StyleSheetList.h                          |   2 +-
 dom/base/SubtleCrypto.h                            |   2 +-
 dom/base/TimeoutHandler.cpp                        |   2 +-
 dom/base/nsChildContentList.h                      |   2 +-
 dom/base/nsContentList.cpp                         |   3 +-
 dom/base/nsContentList.h                           |   2 +-
 dom/base/nsDOMAttributeMap.cpp                     |   4 +-
 dom/base/nsDOMAttributeMap.h                       |   2 +-
 dom/base/nsDOMCaretPosition.h                      |   2 +-
 dom/base/nsDOMMutationObserver.h                   |   2 +-
 dom/base/nsDOMTokenList.h                          |   2 +-
 dom/base/nsFrameLoader.h                           |   2 +-
 dom/base/nsHistory.h                               |   2 +-
 dom/base/nsJSEnvironment.cpp                       |   2 +-
 dom/base/nsMimeTypeArray.h                         |   4 +-
 dom/base/nsPluginArray.h                           |   4 +-
 dom/base/nsWindowRoot.cpp                          |   4 +-
 dom/base/nsWindowRoot.h                            |   2 +-
 dom/base/nsWrapperCache.h                          | 186 ++++++++++++++++++---
 dom/bindings/CallbackObject.cpp                    |   2 +-
 dom/bindings/Codegen.py                            |   5 +-
 dom/bindings/SimpleGlobalObject.cpp                |   4 +-
 dom/bindings/SimpleGlobalObject.h                  |   3 +-
 dom/bindings/nsScriptErrorWithStack.cpp            |   2 +-
 dom/bindings/test/TestInterfaceIterableDouble.h    |   2 +-
 .../test/TestInterfaceIterableDoubleUnion.h        |   2 +-
 dom/bindings/test/TestInterfaceIterableSingle.h    |   2 +-
 dom/bindings/test/TestInterfaceMaplike.h           |   2 +-
 dom/bindings/test/TestInterfaceMaplikeJSObject.h   |   2 +-
 dom/bindings/test/TestInterfaceMaplikeObject.h     |   2 +-
 dom/bindings/test/TestInterfaceObservableArray.h   |   2 +-
 dom/bindings/test/TestInterfaceSetlike.h           |   2 +-
 dom/bindings/test/TestInterfaceSetlikeNode.h       |   2 +-
 dom/bindings/test/TestTrialInterface.h             |   2 +-
 .../test/WrapperCachedNonISupportsTestInterface.h  |   2 +-
 dom/cache/Cache.h                                  |   2 +-
 dom/cache/CacheStorage.h                           |   2 +-
 dom/canvas/CanvasGradient.h                        |   2 +-
 dom/canvas/CanvasPath.h                            |   2 +-
 dom/canvas/CanvasPattern.h                         |   2 +-
 dom/canvas/CanvasRenderingContext2D.cpp            |   4 +-
 dom/canvas/CanvasRenderingContext2D.h              |   2 +-
 dom/canvas/ClientWebGLContext.h                    |  26 +--
 dom/canvas/ClientWebGLExtensions.h                 |   2 +-
 dom/canvas/ImageBitmap.h                           |   2 +-
 dom/canvas/ImageBitmapRenderingContext.h           |   2 +-
 dom/canvas/OffscreenCanvasRenderingContext2D.cpp   |  11 +-
 dom/canvas/XRWebGLLayer.h                          |   2 +-
 dom/clients/api/Client.h                           |   2 +-
 dom/clients/api/Clients.h                          |   2 +-
 dom/console/Console.cpp                            |   2 +-
 dom/console/ConsoleInstance.h                      |   2 +-
 dom/credentialmanagement/Credential.h              |   2 +-
 dom/credentialmanagement/CredentialsContainer.h    |   2 +-
 dom/crypto/CryptoKey.h                             |   2 +-
 dom/debugger/DebuggerNotification.h                |   2 +-
 dom/debugger/DebuggerNotificationObserver.h        |   2 +-
 dom/events/ClipboardItem.h                         |   2 +-
 dom/events/CustomEvent.cpp                         |   2 +-
 dom/events/DOMEventTargetHelper.cpp                |   6 +-
 dom/events/DOMEventTargetHelper.h                  |   2 +-
 dom/events/DataTransfer.cpp                        |   3 +-
 dom/events/DataTransfer.h                          |   2 +-
 dom/events/DataTransferItem.h                      |   2 +-
 dom/events/DataTransferItemList.h                  |   2 +-
 dom/events/DeviceMotionEvent.h                     |   4 +-
 dom/events/Event.cpp                               |   6 +-
 dom/events/Event.h                                 |   2 +-
 dom/events/ImageCaptureError.h                     |   2 +-
 dom/events/MessageEvent.cpp                        |   2 +-
 dom/events/PaintRequest.h                          |   4 +-
 dom/events/TextClause.h                            |   2 +-
 dom/events/Touch.h                                 |   2 +-
 dom/events/TouchEvent.h                            |   2 +-
 dom/fetch/Headers.h                                |   2 +-
 dom/fetch/Request.cpp                              |   7 +-
 dom/fetch/Request.h                                |   4 +-
 dom/file/FileList.h                                |   2 +-
 dom/filesystem/Directory.cpp                       |   4 +-
 dom/filesystem/Directory.h                         |   2 +-
 dom/filesystem/compat/FileSystem.h                 |   2 +-
 dom/filesystem/compat/FileSystemDirectoryReader.h  |   2 +-
 dom/filesystem/compat/FileSystemEntry.h            |   2 +-
 dom/flex/Flex.h                                    |   2 +-
 dom/flex/FlexItemValues.h                          |   2 +-
 dom/flex/FlexLineValues.h                          |   2 +-
 dom/fs/FileSystemDirectoryIterator.h               |   2 +-
 dom/fs/FileSystemHandle.h                          |   2 +-
 dom/fs/FileSystemSyncAccessHandle.h                |   2 +-
 dom/gamepad/Gamepad.h                              |   2 +-
 dom/gamepad/GamepadButton.h                        |   2 +-
 dom/gamepad/GamepadHapticActuator.h                |   2 +-
 dom/gamepad/GamepadLightIndicator.h                |   2 +-
 dom/geolocation/Geolocation.h                      |   2 +-
 dom/geolocation/GeolocationCoordinates.h           |   2 +-
 dom/geolocation/GeolocationPosition.h              |   2 +-
 dom/geolocation/GeolocationPositionError.h         |   2 +-
 dom/grid/Grid.h                                    |   2 +-
 dom/grid/GridArea.h                                |   2 +-
 dom/grid/GridDimension.h                           |   2 +-
 dom/grid/GridLine.h                                |   2 +-
 dom/grid/GridLines.h                               |   2 +-
 dom/grid/GridTrack.h                               |   2 +-
 dom/grid/GridTracks.h                              |   2 +-
 dom/html/ElementInternals.cpp                      |   4 +-
 dom/html/ElementInternals.h                        |   4 +-
 dom/html/HTMLAllCollection.h                       |   2 +-
 dom/html/HTMLCanvasElement.h                       |   2 +-
 dom/html/HTMLOptionsCollection.h                   |   4 +-
 dom/html/HTMLTableElement.cpp                      |   4 +-
 dom/html/MediaError.h                              |   2 +-
 dom/html/TimeRanges.h                              |   2 +-
 dom/html/ValidityState.h                           |   2 +-
 dom/html/nsDOMStringMap.cpp                        |   4 +-
 dom/html/nsDOMStringMap.h                          |   2 +-
 dom/indexedDB/IDBCursor.cpp                        |   4 +-
 dom/indexedDB/IDBIndex.cpp                         |   2 +-
 dom/indexedDB/IDBKeyRange.cpp                      |   2 +-
 dom/indexedDB/IDBObjectStore.cpp                   |   2 +-
 dom/indexedDB/IDBRequest.cpp                       |   2 +-
 dom/ipc/WindowGlobalChild.h                        |   2 +-
 dom/ipc/jsactor/JSActor.cpp                        |   4 +-
 dom/ipc/jsactor/JSActor.h                          |   2 +-
 dom/ipc/jsactor/JSProcessActorChild.cpp            |   3 -
 dom/ipc/jsactor/JSProcessActorChild.h              |   3 +-
 dom/ipc/jsactor/JSProcessActorParent.cpp           |   3 -
 dom/ipc/jsactor/JSProcessActorParent.h             |   3 +-
 dom/ipc/jsactor/JSWindowActorChild.cpp             |   3 -
 dom/ipc/jsactor/JSWindowActorChild.h               |   3 +-
 dom/ipc/jsactor/JSWindowActorParent.cpp            |   3 -
 dom/ipc/jsactor/JSWindowActorParent.h              |   3 +-
 dom/locks/Lock.h                                   |   2 +-
 dom/locks/LockManager.h                            |   2 +-
 dom/media/GetUserMediaRequest.h                    |   2 +-
 dom/media/MediaDeviceInfo.h                        |   2 +-
 dom/media/MediaStreamError.h                       |   2 +-
 dom/media/VideoPlaybackQuality.h                   |   2 +-
 dom/media/eme/MediaKeyStatusMap.h                  |   2 +-
 dom/media/eme/MediaKeySystemAccess.h               |   2 +-
 dom/media/eme/MediaKeys.cpp                        |   3 +-
 dom/media/eme/MediaKeys.h                          |   2 +-
 dom/media/mediacapabilities/MediaCapabilities.h    |   2 +-
 dom/media/mediasession/MediaMetadata.h             |   2 +-
 dom/media/mediasession/MediaSession.cpp            |   3 +-
 dom/media/mediasession/MediaSession.h              |   2 +-
 dom/media/webaudio/AudioListener.h                 |   2 +-
 dom/media/webaudio/AudioParam.cpp                  |   4 +-
 dom/media/webaudio/AudioParam.h                    |   2 +-
 dom/media/webaudio/AudioParamMap.h                 |   2 +-
 dom/media/webaudio/AudioWorkletProcessor.h         |   2 +-
 dom/media/webaudio/PeriodicWave.h                  |   2 +-
 dom/media/webrtc/RTCCertificate.h                  |   2 +-
 dom/media/webrtc/RTCIdentityProviderRegistrar.h    |   2 +-
 dom/media/webrtc/jsapi/PeerConnectionImpl.cpp      |   3 +-
 dom/media/webrtc/jsapi/PeerConnectionImpl.h        |   2 +-
 dom/media/webrtc/jsapi/RTCRtpReceiver.h            |   2 +-
 dom/media/webrtc/jsapi/RTCRtpSender.h              |   2 +-
 dom/media/webrtc/jsapi/RTCRtpTransceiver.cpp       |   3 +-
 dom/media/webrtc/jsapi/RTCRtpTransceiver.h         |   2 +-
 dom/media/webrtc/jsapi/RTCStatsReport.h            |   2 +-
 dom/media/webspeech/recognition/SpeechGrammar.h    |   2 +-
 .../webspeech/recognition/SpeechGrammarList.h      |   2 +-
 .../recognition/SpeechRecognitionAlternative.h     |   2 +-
 .../recognition/SpeechRecognitionResult.h          |   2 +-
 .../recognition/SpeechRecognitionResultList.h      |   2 +-
 dom/media/webspeech/synth/SpeechSynthesisVoice.h   |   2 +-
 dom/media/webvtt/TextTrackCueList.h                |   2 +-
 dom/media/webvtt/TextTrackRegion.h                 |   2 +-
 dom/messagechannel/MessageChannel.h                |   2 +-
 dom/midi/MIDIInputMap.h                            |   2 +-
 dom/midi/MIDIOutputMap.h                           |   2 +-
 dom/payments/PaymentAddress.h                      |   2 +-
 dom/performance/EventCounts.h                      |   2 +-
 dom/performance/PerformanceEntry.h                 |   2 +-
 dom/performance/PerformanceNavigation.h            |   2 +-
 dom/performance/PerformanceObserver.cpp            |   3 +-
 dom/performance/PerformanceObserver.h              |   2 +-
 dom/performance/PerformanceObserverEntryList.h     |   2 +-
 dom/performance/PerformanceServerTiming.h          |   2 +-
 dom/performance/PerformanceTiming.h                |   2 +-
 dom/permission/Permissions.h                       |   2 +-
 dom/promise/Promise.cpp                            |   4 +-
 dom/push/PushManager.h                             |   2 +-
 dom/push/PushSubscription.h                        |   2 +-
 dom/quota/StorageManager.h                         |   2 +-
 dom/reporting/Report.h                             |   2 +-
 dom/reporting/ReportBody.h                         |   2 +-
 dom/reporting/ReportingObserver.cpp                |   3 +-
 dom/reporting/ReportingObserver.h                  |   2 +-
 dom/reporting/TestingDeprecatedInterface.h         |   2 +-
 dom/security/featurepolicy/FeaturePolicy.h         |   2 +-
 dom/security/sanitizer/Sanitizer.h                 |   2 +-
 dom/serviceworkers/NavigationPreloadManager.h      |   2 +-
 dom/serviceworkers/ServiceWorkerEvents.cpp         |   2 +-
 dom/serviceworkers/ServiceWorkerEvents.h           |   2 +-
 dom/storage/Storage.h                              |   2 +-
 dom/streams/ByteLengthQueuingStrategy.h            |   2 +-
 dom/streams/CountQueuingStrategy.h                 |   4 +-
 dom/streams/ReadableStreamBYOBReader.h             |   2 +-
 dom/streams/ReadableStreamDefaultReader.h          |   2 +-
 dom/streams/TransformStream.h                      |   2 +-
 dom/streams/TransformStreamDefaultController.h     |   2 +-
 dom/svg/SVGMatrix.h                                |   2 +-
 dom/system/IOUtils.h                               |   2 +-
 dom/u2f/U2F.cpp                                    |   3 +-
 dom/u2f/U2F.h                                      |   4 +-
 dom/url/URL.h                                      |   2 +-
 dom/url/URLSearchParams.h                          |   2 +-
 dom/vr/VRDisplay.h                                 |   4 +-
 dom/vr/XRFrame.h                                   |   2 +-
 dom/vr/XRInputSource.h                             |   2 +-
 dom/vr/XRInputSourceArray.h                        |   2 +-
 dom/vr/XRPose.h                                    |   2 +-
 dom/vr/XRRenderState.h                             |   2 +-
 dom/vr/XRViewport.h                                |   2 +-
 dom/webgpu/Buffer.h                                |   3 +-
 dom/webgpu/CanvasContext.h                         |   2 +-
 dom/webgpu/ObjectModel.h                           |  14 +-
 dom/webscheduling/WebTaskScheduler.h               |   2 +-
 dom/workers/WorkerLocation.h                       |   2 +-
 dom/workers/WorkerNavigator.h                      |   2 +-
 dom/worklet/Worklet.cpp                            |   4 +-
 dom/worklet/Worklet.h                              |   2 +-
 dom/worklet/WorkletGlobalScope.cpp                 |   4 +-
 dom/worklet/WorkletGlobalScope.h                   |   3 +-
 dom/xhr/XMLHttpRequestMainThread.cpp               |   2 +-
 dom/xslt/xpath/XPathResult.cpp                     |   3 +-
 dom/xslt/xpath/XPathResult.h                       |   2 +-
 dom/xslt/xslt/txMozillaXSLTProcessor.h             |   4 +-
 gfx/layers/apz/util/CheckerboardReportService.h    |   2 +-
 intl/l10n/FileSource.h                             |   2 +-
 intl/l10n/FluentBundle.h                           |   4 +-
 intl/l10n/FluentResource.h                         |   2 +-
 intl/l10n/L10nRegistry.h                           |   6 +-
 intl/l10n/Localization.h                           |   4 +-
 js/loader/ModuleLoadRequest.cpp                    |   2 +-
 js/xpconnect/loader/PrecompiledScript.h            |   2 +-
 js/xpconnect/src/Sandbox.cpp                       |   4 +-
 js/xpconnect/src/SandboxPrivate.h                  |   4 +-
 layout/style/CSSKeyframeRule.cpp                   |   4 +-
 layout/style/CSSRuleList.h                         |   2 +-
 layout/style/MediaList.h                           |   2 +-
 layout/style/Rule.h                                |   2 +-
 layout/style/StyleSheet.cpp                        |   4 +-
 layout/style/StyleSheet.h                          |   2 +-
 layout/style/nsComputedDOMStyle.cpp                |   4 +-
 layout/style/nsComputedDOMStyle.h                  |   2 +-
 layout/style/nsDOMCSSAttrDeclaration.h             |   2 +-
 layout/xul/tree/nsTreeColumns.cpp                  |   3 +-
 layout/xul/tree/nsTreeColumns.h                    |   4 +-
 layout/xul/tree/nsTreeContentView.h                |   4 +-
 storage/mozStorageAsyncStatementParams.h           |   2 +-
 storage/mozStorageStatementParams.h                |   2 +-
 storage/mozStorageStatementRow.h                   |   2 +-
 toolkit/components/extensions/DocumentObserver.h   |   2 +-
 toolkit/components/extensions/MatchPattern.h       |   4 +-
 .../extensions/WebExtensionContentScript.h         |   2 +-
 toolkit/components/extensions/WebExtensionPolicy.h |   2 +-
 .../extensions/webidl-api/ExtensionAlarms.h        |   2 +-
 .../extensions/webidl-api/ExtensionMockAPI.h       |   2 +-
 .../extensions/webidl-api/ExtensionPort.cpp        |   4 +-
 .../extensions/webidl-api/ExtensionPort.h          |   2 +-
 .../extensions/webidl-api/ExtensionRuntime.h       |   2 +-
 .../extensions/webidl-api/ExtensionTest.h          |   2 +-
 .../extensions/webrequest/ChannelWrapper.cpp       |   4 -
 .../extensions/webrequest/ChannelWrapper.h         |   3 +-
 toolkit/components/glean/bindings/Category.h       |   2 +-
 toolkit/components/glean/bindings/Glean.h          |   2 +-
 toolkit/components/glean/bindings/GleanPings.h     |   2 +-
 .../components/glean/bindings/private/Labeled.h    |   2 +-
 .../components/sessionstore/SessionStoreFormData.h |   2 +-
 .../sessionstore/SessionStoreScrollData.h          |   2 +-
 xpcom/base/CycleCollectedJSRuntime.cpp             |  14 +-
 xpcom/base/nsCycleCollectionParticipant.h          |  64 ++++---
 xpcom/base/nsCycleCollector.cpp                    |   2 +-
 xpcom/tests/gtest/TestJSHolderMap.cpp              |   3 +-
 323 files changed, 577 insertions(+), 525 deletions(-)

diff --git a/accessible/aom/AccessibleNode.h b/accessible/aom/AccessibleNode.h
index aec918828079b..e9b328b13d54c 100644
--- a/accessible/aom/AccessibleNode.h
+++ b/accessible/aom/AccessibleNode.h
@@ -101,7 +101,7 @@ class AccessibleNode : public nsISupports, public nsWrapperCache {
   explicit AccessibleNode(nsINode* aNode);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS;
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AccessibleNode);
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AccessibleNode);
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
   dom::ParentObject GetParentObject() const;
diff --git a/devtools/shared/heapsnapshot/DominatorTree.h b/devtools/shared/heapsnapshot/DominatorTree.h
index e8e06ee076a1e..fb3275cf23a22 100644
--- a/devtools/shared/heapsnapshot/DominatorTree.h
+++ b/devtools/shared/heapsnapshot/DominatorTree.h
@@ -38,7 +38,7 @@ class DominatorTree final : public nsISupports, public nsWrapperCache {
   };
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS;
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DominatorTree);
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DominatorTree);
 
   nsISupports* GetParentObject() const { return mParent; }
 
diff --git a/devtools/shared/heapsnapshot/HeapSnapshot.h b/devtools/shared/heapsnapshot/HeapSnapshot.h
index b4aa316f4cee0..d7bbc5455320f 100644
--- a/devtools/shared/heapsnapshot/HeapSnapshot.h
+++ b/devtools/shared/heapsnapshot/HeapSnapshot.h
@@ -119,7 +119,7 @@ class HeapSnapshot final : public nsISupports, public nsWrapperCache {
       nsAString& outSnapshotId);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(HeapSnapshot)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(HeapSnapshot)
   MOZ_DECLARE_REFCOUNTED_TYPENAME(HeapSnapshot)
 
   nsISupports* GetParentObject() const { return mParent; }
diff --git a/docshell/base/BrowsingContextGroup.h b/docshell/base/BrowsingContextGroup.h
index 6e4dedaafc431..2ad92273f857b 100644
--- a/docshell/base/BrowsingContextGroup.h
+++ b/docshell/base/BrowsingContextGroup.h
@@ -38,7 +38,7 @@ class DocGroup;
 class BrowsingContextGroup final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(BrowsingContextGroup)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(BrowsingContextGroup)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(BrowsingContextGroup)
 
   // Interact with the list of synced contexts. This controls the lifecycle of
   // the BrowsingContextGroup and contexts loaded within them.
diff --git a/docshell/base/WindowContext.cpp b/docshell/base/WindowContext.cpp
index 29eb2d32f3462..2c31c24fda04b 100644
--- a/docshell/base/WindowContext.cpp
+++ b/docshell/base/WindowContext.cpp
@@ -567,7 +567,7 @@ NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTING_ADDREF(WindowContext)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(WindowContext)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(WindowContext)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(WindowContext)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(WindowContext)
   if (gWindowContexts) {
@@ -584,8 +584,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(WindowContext)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChildren)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(WindowContext)
-
 }  // namespace dom
 
 namespace ipc {
diff --git a/docshell/base/WindowContext.h b/docshell/base/WindowContext.h
index 469de6f4eb8ec..ebacffc2f7b5f 100644
--- a/docshell/base/WindowContext.h
+++ b/docshell/base/WindowContext.h
@@ -103,7 +103,7 @@ class WindowContext : public nsISupports, public nsWrapperCache {
   MOZ_DECL_SYNCED_CONTEXT(WindowContext, MOZ_EACH_WC_FIELD)
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WindowContext)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(WindowContext)
 
  public:
   static already_AddRefed<WindowContext> GetById(uint64_t aInnerWindowId);
diff --git a/docshell/shistory/ChildSHistory.cpp b/docshell/shistory/ChildSHistory.cpp
index b42e57bb06324..d455305081b5f 100644
--- a/docshell/shistory/ChildSHistory.cpp
+++ b/docshell/shistory/ChildSHistory.cpp
@@ -264,7 +264,7 @@ NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTING_ADDREF(ChildSHistory)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(ChildSHistory)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(ChildSHistory)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ChildSHistory)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ChildSHistory)
   if (tmp->mHistory) {
@@ -278,8 +278,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ChildSHistory)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBrowsingContext, mHistory)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(ChildSHistory)
-
 JSObject* ChildSHistory::WrapObject(JSContext* cx,
                                     JS::Handle<JSObject*> aGivenProto) {
   return ChildSHistory_Binding::Wrap(cx, this, aGivenProto);
diff --git a/docshell/shistory/ChildSHistory.h b/docshell/shistory/ChildSHistory.h
index eed0871621d9c..031c91c7daf1c 100644
--- a/docshell/shistory/ChildSHistory.h
+++ b/docshell/shistory/ChildSHistory.h
@@ -37,7 +37,7 @@ class BrowsingContext;
 class ChildSHistory : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ChildSHistory)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ChildSHistory)
   nsISupports* GetParentObject() const;
   JSObject* WrapObject(JSContext* cx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/animation/AnimationEffect.cpp b/dom/animation/AnimationEffect.cpp
index 3ed190121845d..5d2b7e057f30d 100644
--- a/dom/animation/AnimationEffect.cpp
+++ b/dom/animation/AnimationEffect.cpp
@@ -16,7 +16,7 @@
 
 namespace mozilla::dom {
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(AnimationEffect)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AnimationEffect)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AnimationEffect)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocument, mAnimation)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
@@ -26,8 +26,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AnimationEffect)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument, mAnimation)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AnimationEffect)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(AnimationEffect)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(AnimationEffect)
 
diff --git a/dom/animation/AnimationEffect.h b/dom/animation/AnimationEffect.h
index 0986650f11834..020f491a58fab 100644
--- a/dom/animation/AnimationEffect.h
+++ b/dom/animation/AnimationEffect.h
@@ -30,7 +30,7 @@ class Document;
 class AnimationEffect : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationEffect)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AnimationEffect)
 
   AnimationEffect(Document* aDocument, TimingParams&& aTiming);
 
diff --git a/dom/animation/AnimationTimeline.cpp b/dom/animation/AnimationTimeline.cpp
index 4a95d7ec4d2b6..ec5129e0b2584 100644
--- a/dom/animation/AnimationTimeline.cpp
+++ b/dom/animation/AnimationTimeline.cpp
@@ -12,7 +12,7 @@ namespace mozilla::dom {
 
 AnimationTimeline::~AnimationTimeline() { mAnimationOrder.clear(); }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(AnimationTimeline)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AnimationTimeline)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AnimationTimeline)
   tmp->mAnimationOrder.clear();
@@ -24,8 +24,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AnimationTimeline)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow, mAnimations)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AnimationTimeline)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(AnimationTimeline)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(AnimationTimeline)
 
diff --git a/dom/animation/AnimationTimeline.h b/dom/animation/AnimationTimeline.h
index f2af12ca93300..f0c6cc67cf4b3 100644
--- a/dom/animation/AnimationTimeline.h
+++ b/dom/animation/AnimationTimeline.h
@@ -38,7 +38,7 @@ class AnimationTimeline : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationTimeline)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AnimationTimeline)
 
   nsIGlobalObject* GetParentObject() const { return mWindow; }
 
diff --git a/dom/animation/CSSPseudoElement.h b/dom/animation/CSSPseudoElement.h
index 1ba2d18a630e5..4b5fbc917c325 100644
--- a/dom/animation/CSSPseudoElement.h
+++ b/dom/animation/CSSPseudoElement.h
@@ -23,7 +23,7 @@ class UnrestrictedDoubleOrKeyframeAnimationOptions;
 class CSSPseudoElement final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CSSPseudoElement)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CSSPseudoElement)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(CSSPseudoElement)
 
  protected:
   virtual ~CSSPseudoElement();
diff --git a/dom/base/AbstractRange.cpp b/dom/base/AbstractRange.cpp
index fad2d73b51c9c..ca9e8274b5d91 100644
--- a/dom/base/AbstractRange.cpp
+++ b/dom/base/AbstractRange.cpp
@@ -58,7 +58,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AbstractRange)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(AbstractRange)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AbstractRange)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AbstractRange)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner);
@@ -73,8 +73,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AbstractRange)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEnd)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AbstractRange)
-
 // NOTE: If you need to change default value of members of AbstractRange,
 //       update nsRange::Create(nsINode* aNode) and ClearForReuse() too.
 AbstractRange::AbstractRange(nsINode* aNode)
diff --git a/dom/base/AbstractRange.h b/dom/base/AbstractRange.h
index 8160b6ca1827b..146b8965cfef5 100644
--- a/dom/base/AbstractRange.h
+++ b/dom/base/AbstractRange.h
@@ -42,7 +42,7 @@ class AbstractRange : public nsISupports, public nsWrapperCache {
   static void Shutdown();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AbstractRange)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AbstractRange)
 
   const RangeBoundary& StartRef() const { return mStart; }
   const RangeBoundary& EndRef() const { return mEnd; }
diff --git a/dom/base/Attr.cpp b/dom/base/Attr.cpp
index f8d2f52562eb1..a0ec3ec5b838c 100644
--- a/dom/base/Attr.cpp
+++ b/dom/base/Attr.cpp
@@ -43,7 +43,7 @@ Attr::Attr(nsDOMAttributeMap* aAttrMap,
   // to drop our reference when it goes away.
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(Attr)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Attr)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Attr)
   if (!nsINode::Traverse(tmp, cb)) {
@@ -52,8 +52,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Attr)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAttrMap)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Attr)
-
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Attr)
   nsINode::Unlink(tmp);
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mAttrMap)
diff --git a/dom/base/Attr.h b/dom/base/Attr.h
index dfac0c727a4d5..fa4347d8fbba8 100644
--- a/dom/base/Attr.h
+++ b/dom/base/Attr.h
@@ -74,7 +74,7 @@ class Attr final : public nsINode {
   static void Initialize();
   static void Shutdown();
 
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(Attr)
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(Attr)
 
   // WebIDL
   virtual JSObject* WrapNode(JSContext* aCx,
diff --git a/dom/base/BarProps.h b/dom/base/BarProps.h
index a788ca1c76fa2..f7c4c8b95a9ef 100644
--- a/dom/base/BarProps.h
+++ b/dom/base/BarProps.h
@@ -35,7 +35,7 @@ class BarProp : public nsISupports, public nsWrapperCache {
   explicit BarProp(nsGlobalWindowInner* aWindow);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(BarProp)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(BarProp)
 
   nsPIDOMWindowInner* GetParentObject() const;
 
diff --git a/dom/base/CharacterData.cpp b/dom/base/CharacterData.cpp
index 7f547fec9639b..29ff4f9761d10 100644
--- a/dom/base/CharacterData.cpp
+++ b/dom/base/CharacterData.cpp
@@ -66,9 +66,9 @@ Element* CharacterData::GetNameSpaceElement() {
   return Element::FromNodeOrNull(GetParentNode());
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(CharacterData)
-
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(CharacterData)
+// Note, _INHERITED macro isn't used here since nsINode implementations are
+// rather special.
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CharacterData)
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(CharacterData)
   return Element::CanSkip(tmp, aRemovingAllowed);
diff --git a/dom/base/CharacterData.h b/dom/base/CharacterData.h
index 4b6c2d2c17bd4..4f125953ef366 100644
--- a/dom/base/CharacterData.h
+++ b/dom/base/CharacterData.h
@@ -190,8 +190,8 @@ class CharacterData : public nsIContent {
 
   //----------------------------------------
 
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(
-      CharacterData, nsIContent)
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_INHERITED(CharacterData,
+                                                                  nsIContent)
 
   /**
    * Compare two CharacterData nodes for text equality.
diff --git a/dom/base/Crypto.h b/dom/base/Crypto.h
index bc0d65bb8bceb..02282324c0ac5 100644
--- a/dom/base/Crypto.h
+++ b/dom/base/Crypto.h
@@ -27,7 +27,7 @@ class Crypto final : public nsISupports, public nsWrapperCache {
   explicit Crypto(nsIGlobalObject* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Crypto)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Crypto)
 
   void GetRandomValues(JSContext* aCx, const ArrayBufferView& aArray,
                        JS::MutableHandle<JSObject*> aRetval, ErrorResult& aRv);
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index e29f792d75d16..bdfd6df907644 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -389,7 +389,7 @@ class MOZ_RAII AutoConstructionStackEntry final {
 
 }  // namespace
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(CustomElementRegistry)
+NS_IMPL_CYCLE_COLLECTION_CLASS(CustomElementRegistry)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CustomElementRegistry)
   tmp->mConstructors.clear();
diff --git a/dom/base/DOMImplementation.h b/dom/base/DOMImplementation.h
index d33f54b829609..b42538741bdf1 100644
--- a/dom/base/DOMImplementation.h
+++ b/dom/base/DOMImplementation.h
@@ -34,7 +34,7 @@ class DOMImplementation final : public nsISupports, public nsWrapperCache {
                     nsIURI* aDocumentURI, nsIURI* aBaseURI);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMImplementation)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMImplementation)
 
   Document* GetParentObject() const { return mOwner; }
 
diff --git a/dom/base/DOMIntersectionObserver.h b/dom/base/DOMIntersectionObserver.h
index 0e4fb985b0ae1..4b16a7e3a2da6 100644
--- a/dom/base/DOMIntersectionObserver.h
+++ b/dom/base/DOMIntersectionObserver.h
@@ -39,7 +39,7 @@ class DOMIntersectionObserverEntry final : public nsISupports,
         mTarget(aTarget),
         mIntersectionRatio(aIntersectionRatio) {}
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMIntersectionObserverEntry)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMIntersectionObserverEntry)
 
   nsISupports* GetParentObject() const { return mOwner; }
 
diff --git a/dom/base/DOMMatrix.h b/dom/base/DOMMatrix.h
index 9138999326840..19eb6f8ae4297 100644
--- a/dom/base/DOMMatrix.h
+++ b/dom/base/DOMMatrix.h
@@ -67,7 +67,7 @@ class DOMMatrixReadOnly : public nsWrapperCache {
   }
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMMatrixReadOnly)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMMatrixReadOnly)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(DOMMatrixReadOnly)
 
   nsISupports* GetParentObject() const { return mParent; }
   virtual JSObject* WrapObject(JSContext* cx,
diff --git a/dom/base/DOMParser.h b/dom/base/DOMParser.h
index cd59b4c4b39ca..efb4270ac83a5 100644
--- a/dom/base/DOMParser.h
+++ b/dom/base/DOMParser.h
@@ -28,7 +28,7 @@ class DOMParser final : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMParser)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMParser)
 
   // WebIDL API
   static already_AddRefed<DOMParser> Constructor(const GlobalObject& aOwner,
diff --git a/dom/base/DOMPoint.h b/dom/base/DOMPoint.h
index 7107a1e0d0485..d49c8fd441561 100644
--- a/dom/base/DOMPoint.h
+++ b/dom/base/DOMPoint.h
@@ -43,7 +43,7 @@ class DOMPointReadOnly : public nsWrapperCache {
       const GlobalObject& aGlobal, double aX, double aY, double aZ, double aW);
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMPointReadOnly)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMPointReadOnly)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(DOMPointReadOnly)
 
   double X() const { return mX; }
   double Y() const { return mY; }
diff --git a/dom/base/DOMQuad.h b/dom/base/DOMQuad.h
index fb0245b1096b7..f6ca36f602ca9 100644
--- a/dom/base/DOMQuad.h
+++ b/dom/base/DOMQuad.h
@@ -41,7 +41,7 @@ class DOMQuad final : public nsWrapperCache {
   explicit DOMQuad(nsISupports* aParent);
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMQuad)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(DOMQuad)
 
   nsISupports* GetParentObject() const { return mParent; }
   virtual JSObject* WrapObject(JSContext* aCx,
diff --git a/dom/base/DOMRect.h b/dom/base/DOMRect.h
index 2af66eff28a47..8cacd9a1dce8f 100644
--- a/dom/base/DOMRect.h
+++ b/dom/base/DOMRect.h
@@ -40,7 +40,7 @@ class DOMRectReadOnly : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectReadOnly)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMRectReadOnly)
 
   explicit DOMRectReadOnly(nsISupports* aParent, double aX = 0, double aY = 0,
                            double aWidth = 0, double aHeight = 0)
@@ -150,7 +150,7 @@ class DOMRectList final : public nsISupports, public nsWrapperCache {
   explicit DOMRectList(nsISupports* aParent) : mParent(aParent) {}
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMRectList)
 
   virtual JSObject* WrapObject(JSContext* cx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/base/DOMStringList.h b/dom/base/DOMStringList.h
index 1c3bf8f684e1d..89bb9fc418cce 100644
--- a/dom/base/DOMStringList.h
+++ b/dom/base/DOMStringList.h
@@ -20,7 +20,7 @@ class DOMStringList : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMStringList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMStringList)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/base/External.h b/dom/base/External.h
index 256ea40faf92a..9ddda47785d81 100644
--- a/dom/base/External.h
+++ b/dom/base/External.h
@@ -17,7 +17,7 @@ namespace mozilla::dom {
 class External : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(External)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(External)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(External)
 
   explicit External(nsISupports* aParent) : mParent(aParent) {}
 
diff --git a/dom/base/FormData.cpp b/dom/base/FormData.cpp
index d980bee7feb11..44e6f62b0ee2d 100644
--- a/dom/base/FormData.cpp
+++ b/dom/base/FormData.cpp
@@ -69,7 +69,7 @@ already_AddRefed<File> GetBlobForFormDataStorage(
 // -------------------------------------------------------------------------
 // nsISupports
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(FormData)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FormData)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FormData)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner)
@@ -93,8 +93,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(FormData)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(FormData)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(FormData)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(FormData)
 
diff --git a/dom/base/FormData.h b/dom/base/FormData.h
index 25841cfceb091..8ce21095b04d3 100644
--- a/dom/base/FormData.h
+++ b/dom/base/FormData.h
@@ -57,7 +57,7 @@ class FormData final : public nsISupports,
   already_AddRefed<FormData> Clone();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FormData)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FormData)
 
   // nsWrapperCache
   virtual JSObject* WrapObject(JSContext* aCx,
diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp
index d2a156c725508..868fa97b97aa3 100644
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -1252,7 +1252,9 @@ ContentUnbinder* ContentUnbinder::sContentUnbinder = nullptr;
 
 void FragmentOrElement::ClearContentUnbinder() { ContentUnbinder::UnbindAll(); }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(FragmentOrElement)
+// Note, _INHERITED macro isn't used here since nsINode implementations are
+// rather special.
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FragmentOrElement)
 
 // We purposefully don't UNLINK_BEGIN_INHERITED here.
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
@@ -1310,8 +1312,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(FragmentOrElement)
-
 void FragmentOrElement::MarkNodeChildren(nsINode* aNode) {
   JSObject* o = GetJSObjectChild(aNode);
   if (o) {
diff --git a/dom/base/FragmentOrElement.h b/dom/base/FragmentOrElement.h
index 512e7022826e3..9ad84ae7d3eb1 100644
--- a/dom/base/FragmentOrElement.h
+++ b/dom/base/FragmentOrElement.h
@@ -116,7 +116,7 @@ class FragmentOrElement : public nsIContent {
   static void FireNodeInserted(Document* aDoc, nsINode* aParent,
                                nsTArray<nsCOMPtr<nsIContent> >& aNodes);
 
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_INHERITED(
       FragmentOrElement, nsIContent)
 
   /**
diff --git a/dom/base/IdleDeadline.h b/dom/base/IdleDeadline.h
index 3fd66791720ce..2ce06e489d55d 100644
--- a/dom/base/IdleDeadline.h
+++ b/dom/base/IdleDeadline.h
@@ -38,7 +38,7 @@ class IdleDeadline final : public nsISupports, public nsWrapperCache {
   bool DidTimeout() const;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IdleDeadline)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(IdleDeadline)
 
  private:
   ~IdleDeadline();
diff --git a/dom/base/IntlUtils.h b/dom/base/IntlUtils.h
index ee51667b1e14e..51531e614041b 100644
--- a/dom/base/IntlUtils.h
+++ b/dom/base/IntlUtils.h
@@ -23,7 +23,7 @@ class IntlUtils final : public nsISupports, public nsWrapperCache {
   explicit IntlUtils(nsPIDOMWindowInner* aWindow);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IntlUtils)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(IntlUtils)
 
   nsPIDOMWindowInner* GetParentObject() const { return mWindow; }
 
diff --git a/dom/base/Location.h b/dom/base/Location.h
index ee6a8f3c73470..5fb92beb04171 100644
--- a/dom/base/Location.h
+++ b/dom/base/Location.h
@@ -35,7 +35,7 @@ class Location final : public nsISupports,
   Location(nsPIDOMWindowInner* aWindow, BrowsingContext* aBrowsingContext);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Location)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Location)
 
   // WebIDL API:
   void Assign(const nsAString& aUrl, nsIPrincipal& aSubjectPrincipal,
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index b7da9e6a03bd5..a604ea30b8bad 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -131,7 +131,7 @@ NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Navigator)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Navigator)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(Navigator)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Navigator)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Navigator)
   tmp->Invalidate();
@@ -166,8 +166,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mXRSystem)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Navigator)
-
 void Navigator::Invalidate() {
   // Don't clear mWindow here so we know we've got a non-null mWindow
   // until we're unlinked.
diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h
index 2a16e5e184279..36367443440e8 100644
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -91,7 +91,7 @@ class Navigator final : public nsISupports, public nsWrapperCache {
   explicit Navigator(nsPIDOMWindowInner* aInnerWindow);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Navigator)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Navigator)
 
   void Invalidate();
   nsPIDOMWindowInner* GetWindow() const { return mWindow; }
diff --git a/dom/base/PlacesWeakCallbackWrapper.h b/dom/base/PlacesWeakCallbackWrapper.h
index 2bb5ae82668c6..0b20276fc4516 100644
--- a/dom/base/PlacesWeakCallbackWrapper.h
+++ b/dom/base/PlacesWeakCallbackWrapper.h
@@ -18,7 +18,7 @@ class PlacesWeakCallbackWrapper final : public nsWrapperCache,
                                         public SupportsWeakPtr {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PlacesWeakCallbackWrapper)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PlacesWeakCallbackWrapper)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(PlacesWeakCallbackWrapper)
 
   explicit PlacesWeakCallbackWrapper(nsISupports* aParent,
                                      PlacesEventCallback& aCallback);
diff --git a/dom/base/ResizeObserver.cpp b/dom/base/ResizeObserver.cpp
index 72c08b1d72a96..542d77fab3059 100644
--- a/dom/base/ResizeObserver.cpp
+++ b/dom/base/ResizeObserver.cpp
@@ -183,9 +183,7 @@ void ResizeObservation::UpdateLastReportedSize(const gfx::Size& aSize) {
 }
 
 // Only needed for refcounted objects.
-NS_IMPL_CYCLE_COLLECTION_CLASS(ResizeObserver)
-
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(ResizeObserver)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ResizeObserver)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ResizeObserver)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner, mDocument, mCallback,
diff --git a/dom/base/ResizeObserver.h b/dom/base/ResizeObserver.h
index a4f3e0ab8f151..12923f11a1f08 100644
--- a/dom/base/ResizeObserver.h
+++ b/dom/base/ResizeObserver.h
@@ -117,7 +117,7 @@ class ResizeObservation final : public LinkedListElement<ResizeObservation> {
 class ResizeObserver final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ResizeObserver)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ResizeObserver)
 
   ResizeObserver(nsCOMPtr<nsPIDOMWindowInner>&& aOwner, Document* aDocument,
                  ResizeObserverCallback& aCb)
@@ -208,7 +208,7 @@ class ResizeObserver final : public nsISupports, public nsWrapperCache {
 class ResizeObserverEntry final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ResizeObserverEntry)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ResizeObserverEntry)
 
   ResizeObserverEntry(nsISupports* aOwner, Element& aTarget,
                       const gfx::Size& aBorderBoxSize,
@@ -269,7 +269,7 @@ class ResizeObserverEntry final : public nsISupports, public nsWrapperCache {
 class ResizeObserverSize final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ResizeObserverSize)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ResizeObserverSize)
 
   ResizeObserverSize(nsISupports* aOwner, const gfx::Size& aSize,
                      const WritingMode aWM)
diff --git a/dom/base/ScreenLuminance.h b/dom/base/ScreenLuminance.h
index b4ec422a69911..5595fd734bead 100644
--- a/dom/base/ScreenLuminance.h
+++ b/dom/base/ScreenLuminance.h
@@ -19,7 +19,7 @@ class ScreenLuminance final : public nsWrapperCache {
  public:
   // Ref counting and cycle collection
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(ScreenLuminance)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(ScreenLuminance)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(ScreenLuminance)
 
   // WebIDL methods
   double Min() const { return mMin; }
diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp
index 1ac576944cd74..eb95ffdb22fab 100644
--- a/dom/base/Selection.cpp
+++ b/dom/base/Selection.cpp
@@ -612,7 +612,7 @@ DocGroup* Selection::GetDocGroup() const {
   return doc ? doc->GetDocGroup() : nullptr;
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(Selection)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Selection)
 
 MOZ_CAN_RUN_SCRIPT_BOUNDARY
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Selection)
@@ -643,7 +643,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Selection)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelectionChangeEventDispatcher)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelectionListeners)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Selection)
 
 // QueryInterface implementation for Selection
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Selection)
diff --git a/dom/base/Selection.h b/dom/base/Selection.h
index ec558be4634f7..f2eec06da060b 100644
--- a/dom/base/Selection.h
+++ b/dom/base/Selection.h
@@ -72,7 +72,7 @@ class Selection final : public nsSupportsWeakReference,
                      nsFrameSelection* aFrameSelection);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Selection)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Selection)
 
   /**
    * Match this up with EndbatchChanges. will stop ui updates while multiple
diff --git a/dom/base/StructuredCloneTester.h b/dom/base/StructuredCloneTester.h
index b939296971d30..d85371d86ce2b 100644
--- a/dom/base/StructuredCloneTester.h
+++ b/dom/base/StructuredCloneTester.h
@@ -27,7 +27,7 @@ class GlobalObject;
 class StructuredCloneTester final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StructuredCloneTester)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(StructuredCloneTester)
 
   static already_AddRefed<StructuredCloneTester> Constructor(
       const GlobalObject& aGlobal, const bool aSerializable,
diff --git a/dom/base/StyleSheetList.h b/dom/base/StyleSheetList.h
index 0db025da31e77..7b097599b1dbf 100644
--- a/dom/base/StyleSheetList.h
+++ b/dom/base/StyleSheetList.h
@@ -23,7 +23,7 @@ class StyleSheetList final : public nsStubMutationObserver,
                              public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheetList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(StyleSheetList)
 
   NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
 
diff --git a/dom/base/SubtleCrypto.h b/dom/base/SubtleCrypto.h
index 3bb36d48dc5f1..a4d93420c8405 100644
--- a/dom/base/SubtleCrypto.h
+++ b/dom/base/SubtleCrypto.h
@@ -25,7 +25,7 @@ class SubtleCrypto final : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SubtleCrypto)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SubtleCrypto)
 
  public:
   explicit SubtleCrypto(nsIGlobalObject* aParent);
diff --git a/dom/base/TimeoutHandler.cpp b/dom/base/TimeoutHandler.cpp
index 5430feeb89a9d..ddf2b6abd7a10 100644
--- a/dom/base/TimeoutHandler.cpp
+++ b/dom/base/TimeoutHandler.cpp
@@ -103,7 +103,7 @@ CallbackTimeoutHandler::CallbackTimeoutHandler(
   mArgs = std::move(aArguments);
 }
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(CallbackTimeoutHandler)
+NS_IMPL_CYCLE_COLLECTION_CLASS(CallbackTimeoutHandler)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CallbackTimeoutHandler)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
diff --git a/dom/base/nsChildContentList.h b/dom/base/nsChildContentList.h
index 52b4c7721ee8c..af43253cbf546 100644
--- a/dom/base/nsChildContentList.h
+++ b/dom/base/nsChildContentList.h
@@ -26,7 +26,7 @@ class nsAttrChildContentList : public nsINodeList {
   explicit nsAttrChildContentList(nsINode* aNode) : mNode(aNode) {}
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsAttrChildContentList)
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(nsAttrChildContentList)
 
   // nsWrapperCache
   virtual JSObject* WrapObject(JSContext* cx,
diff --git a/dom/base/nsContentList.cpp b/dom/base/nsContentList.cpp
index d453db41b1ff6..689aeeb2b8c1a 100644
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -41,7 +41,7 @@ using namespace mozilla::dom;
 
 nsBaseContentList::~nsBaseContentList() = default;
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsBaseContentList)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsBaseContentList)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsBaseContentList)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mElements)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
@@ -50,7 +50,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsBaseContentList)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElements)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsBaseContentList)
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsBaseContentList)
   if (nsCCUncollectableMarker::sGeneration && tmp->HasKnownLiveWrapper()) {
diff --git a/dom/base/nsContentList.h b/dom/base/nsContentList.h
index 6c5c5f6b313b4..208996b546931 100644
--- a/dom/base/nsContentList.h
+++ b/dom/base/nsContentList.h
@@ -47,7 +47,7 @@ class nsBaseContentList : public nsINodeList {
 
   uint32_t Length() override { return mElements.Length(); }
 
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsBaseContentList)
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(nsBaseContentList)
 
   void AppendElement(nsIContent* aContent) {
     MOZ_ASSERT(aContent);
diff --git a/dom/base/nsDOMAttributeMap.cpp b/dom/base/nsDOMAttributeMap.cpp
index d84cd8dd053a9..5eba4c981d390 100644
--- a/dom/base/nsDOMAttributeMap.cpp
+++ b/dom/base/nsDOMAttributeMap.cpp
@@ -45,7 +45,7 @@ void nsDOMAttributeMap::DropReference() {
   mContent = nullptr;
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMAttributeMap)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMAttributeMap)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMAttributeMap)
   tmp->DropReference();
@@ -60,8 +60,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMAttributeMap)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mContent)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsDOMAttributeMap)
-
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsDOMAttributeMap)
   if (tmp->HasKnownLiveWrapper()) {
     if (tmp->mContent) {
diff --git a/dom/base/nsDOMAttributeMap.h b/dom/base/nsDOMAttributeMap.h
index 04d2857034e86..5ed1e96544ab7 100644
--- a/dom/base/nsDOMAttributeMap.h
+++ b/dom/base/nsDOMAttributeMap.h
@@ -97,7 +97,7 @@ class nsDOMAttributeMap final : public nsISupports, public nsWrapperCache {
   explicit nsDOMAttributeMap(Element* aContent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsDOMAttributeMap)
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(nsDOMAttributeMap)
 
   void DropReference();
 
diff --git a/dom/base/nsDOMCaretPosition.h b/dom/base/nsDOMCaretPosition.h
index 36a2f28d4007b..8ede967edda6f 100644
--- a/dom/base/nsDOMCaretPosition.h
+++ b/dom/base/nsDOMCaretPosition.h
@@ -29,7 +29,7 @@ class nsDOMCaretPosition : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCaretPosition)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMCaretPosition)
 
   nsDOMCaretPosition(nsINode* aNode, uint32_t aOffset);
 
diff --git a/dom/base/nsDOMMutationObserver.h b/dom/base/nsDOMMutationObserver.h
index e41e19e77b54c..a8e8b155510a8 100644
--- a/dom/base/nsDOMMutationObserver.h
+++ b/dom/base/nsDOMMutationObserver.h
@@ -57,7 +57,7 @@ class nsDOMMutationRecord final : public nsISupports, public nsWrapperCache {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMMutationRecord)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMMutationRecord)
 
   void GetType(mozilla::dom::DOMString& aRetVal) const {
     aRetVal.SetKnownLiveAtom(mType, mozilla::dom::DOMString::eNullNotExpected);
diff --git a/dom/base/nsDOMTokenList.h b/dom/base/nsDOMTokenList.h
index 37687125535ad..cd768ba0e781e 100644
--- a/dom/base/nsDOMTokenList.h
+++ b/dom/base/nsDOMTokenList.h
@@ -41,7 +41,7 @@ class nsDOMTokenList : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMTokenList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMTokenList)
 
   nsDOMTokenList(Element* aElement, nsAtom* aAttrAtom,
                  const mozilla::dom::DOMTokenListSupportedTokenArray = nullptr);
diff --git a/dom/base/nsFrameLoader.h b/dom/base/nsFrameLoader.h
index 244699c1618a7..042f77d214d51 100644
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -129,7 +129,7 @@ class nsFrameLoader final : public nsStubMutationObserver,
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_FRAMELOADER_IID)
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsFrameLoader)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsFrameLoader)
 
   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
   nsresult CheckForRecursiveLoad(nsIURI* aURI);
diff --git a/dom/base/nsHistory.h b/dom/base/nsHistory.h
index 80bac869f3614..157052fe44cef 100644
--- a/dom/base/nsHistory.h
+++ b/dom/base/nsHistory.h
@@ -29,7 +29,7 @@ class ErrorResult;
 class nsHistory final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsHistory)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsHistory)
 
  public:
   explicit nsHistory(nsPIDOMWindowInner* aInnerWindow);
diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp
index cefdbb67a3319..fe0b660b113c7 100644
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -2247,7 +2247,7 @@ void nsJSArgArray::ReleaseJSObjects() {
 }
 
 // QueryInterface implementation for nsJSArgArray
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(nsJSArgArray)
+NS_IMPL_CYCLE_COLLECTION_CLASS(nsJSArgArray)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsJSArgArray)
   tmp->ReleaseJSObjects();
diff --git a/dom/base/nsMimeTypeArray.h b/dom/base/nsMimeTypeArray.h
index cdd587db35eac..aaeedba3ae262 100644
--- a/dom/base/nsMimeTypeArray.h
+++ b/dom/base/nsMimeTypeArray.h
@@ -28,7 +28,7 @@ class nsMimeTypeArray final : public nsISupports, public nsWrapperCache {
                   const mozilla::Array<RefPtr<nsMimeType>, 2>& aMimeTypes);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsMimeTypeArray)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsMimeTypeArray)
 
   nsPIDOMWindowInner* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aCx,
@@ -69,7 +69,7 @@ class nsMimeTypeArray final : public nsISupports, public nsWrapperCache {
 class nsMimeType final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsMimeType)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsMimeType)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(nsMimeType)
 
   nsMimeType(nsPluginElement* aPluginElement, const nsAString& aName);
 
diff --git a/dom/base/nsPluginArray.h b/dom/base/nsPluginArray.h
index a029bb2b99878..1a9e12b787e86 100644
--- a/dom/base/nsPluginArray.h
+++ b/dom/base/nsPluginArray.h
@@ -28,7 +28,7 @@ class nsPluginArray final : public nsSupportsWeakReference,
                             public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsPluginArray)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsPluginArray)
 
   explicit nsPluginArray(nsPIDOMWindowInner* aWindow);
   nsPIDOMWindowInner* GetParentObject() const;
@@ -75,7 +75,7 @@ class nsPluginArray final : public nsSupportsWeakReference,
 class nsPluginElement final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsPluginElement)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsPluginElement)
 
   explicit nsPluginElement(nsPluginArray* aPluginArray,
                            nsPIDOMWindowInner* aWindow, const nsAString& aName);
diff --git a/dom/base/nsWindowRoot.cpp b/dom/base/nsWindowRoot.cpp
index 3914d33c8fcb1..177dd10e1ddb7 100644
--- a/dom/base/nsWindowRoot.cpp
+++ b/dom/base/nsWindowRoot.cpp
@@ -52,7 +52,7 @@ nsWindowRoot::~nsWindowRoot() {
   JSActorService::UnregisterChromeEventTarget(this);
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsWindowRoot)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsWindowRoot)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsWindowRoot)
   JSActorService::UnregisterChromeEventTarget(tmp);
@@ -69,8 +69,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsWindowRoot)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsWindowRoot)
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsWindowRoot)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
diff --git a/dom/base/nsWindowRoot.h b/dom/base/nsWindowRoot.h
index b412834bfadd4..1fe9c8fb9bc00 100644
--- a/dom/base/nsWindowRoot.h
+++ b/dom/base/nsWindowRoot.h
@@ -64,7 +64,7 @@ class nsWindowRoot final : public nsPIWindowRoot {
 
   JSObject* WrapObject(JSContext*, JS::Handle<JSObject*> aGivenProto) override;
 
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsWindowRoot)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsWindowRoot)
 
   void AddBrowser(nsIRemoteTab* aBrowser) override;
   void RemoveBrowser(nsIRemoteTab* aBrowser) override;
diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h
index fd27230294c75..d7232470d9580 100644
--- a/dom/base/nsWrapperCache.h
+++ b/dom/base/nsWrapperCache.h
@@ -16,6 +16,7 @@
 #include "js/TypeDecls.h"
 #include "nsISupports.h"
 #include "nsISupportsUtils.h"
+#include <type_traits>
 
 namespace mozilla::dom {
 class ContentProcessMessageManager;
@@ -422,6 +423,123 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
   else
 
 // Cycle collector macros for wrapper caches.
+//
+// The NS_DECL_*WRAPPERCACHE_* macros make it easier to mark classes as holding
+// just a single pointer to a JS value. That information is then used for
+// certain GC optimizations.
+
+#define NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(_class, _base)   \
+  class NS_CYCLE_COLLECTION_INNERCLASS                                         \
+      : public nsXPCOMCycleCollectionParticipant {                             \
+   public:                                                                     \
+    constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags = 0)        \
+        : nsXPCOMCycleCollectionParticipant(aFlags |                           \
+                                            FlagMaybeSingleZoneJSHolder) {}    \
+                                                                               \
+   private:                                                                    \
+    NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base)                         \
+    NS_IMETHOD_(void)                                                          \
+    Trace(void* p, const TraceCallbacks& cb, void* closure) override;          \
+    NS_IMETHOD_(void)                                                          \
+    TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
+    NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                     \
+  };                                                                           \
+  NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class)                                  \
+  static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;         \
+  NOT_INHERITED_CANT_OVERRIDE
+
+#define NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class) \
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(_class, _class)
+
+#define NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(_class,          \
+                                                              _base_class)     \
+  class NS_CYCLE_COLLECTION_INNERCLASS                                         \
+      : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) {                    \
+   public:                                                                     \
+    constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags)            \
+        : NS_CYCLE_COLLECTION_CLASSNAME(_base_class)(                          \
+              aFlags | FlagMaybeSingleZoneJSHolder) {}                         \
+                                                                               \
+   private:                                                                    \
+    NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class)         \
+    NS_IMETHOD_(void)                                                          \
+    Trace(void* p, const TraceCallbacks& cb, void* closure) override;          \
+    NS_IMETHOD_(void)                                                          \
+    TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
+    NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                     \
+  };                                                                           \
+  NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)                        \
+  static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
+
+#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_AMBIGUOUS(       \
+    _class, _base)                                                             \
+  class NS_CYCLE_COLLECTION_INNERCLASS                                         \
+      : public nsXPCOMCycleCollectionParticipant {                             \
+   public:                                                                     \
+    constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags)            \
+        : nsXPCOMCycleCollectionParticipant(aFlags | FlagMightSkip |           \
+                                            FlagMaybeSingleZoneJSHolder) {}    \
+                                                                               \
+   private:                                                                    \
+    NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base)                         \
+    NS_IMETHOD_(void)                                                          \
+    Trace(void* p, const TraceCallbacks& cb, void* closure) override;          \
+    NS_IMETHOD_(void)                                                          \
+    TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
+    NS_IMETHOD_(bool) CanSkipReal(void* p, bool aRemovingAllowed) override;    \
+    NS_IMETHOD_(bool) CanSkipInCCReal(void* p) override;                       \
+    NS_IMETHOD_(bool) CanSkipThisReal(void* p) override;                       \
+    NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                     \
+  };                                                                           \
+  NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class)                                  \
+  static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;         \
+  NOT_INHERITED_CANT_OVERRIDE
+
+#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(_class)     \
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_AMBIGUOUS(_class, \
+                                                                  _class)
+
+#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_INHERITED(       \
+    _class, _base_class)                                                       \
+  class NS_CYCLE_COLLECTION_INNERCLASS                                         \
+      : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) {                    \
+   public:                                                                     \
+    constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags = 0)        \
+        : NS_CYCLE_COLLECTION_CLASSNAME(_base_class)(                          \
+              aFlags | FlagMightSkip | FlagMaybeSingleZoneJSHolder) {}         \
+                                                                               \
+   private:                                                                    \
+    NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base_class)                   \
+    NS_IMETHOD_(void)                                                          \
+    Trace(void* p, const TraceCallbacks& cb, void* closure) override;          \
+    NS_IMETHOD_(void)                                                          \
+    TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
+    NS_IMETHOD_(bool) CanSkipReal(void* p, bool aRemovingAllowed) override;    \
+    NS_IMETHOD_(bool) CanSkipInCCReal(void* p) override;                       \
+    NS_IMETHOD_(bool) CanSkipThisReal(void* p) override;                       \
+    NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                     \
+  };                                                                           \
+  NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)                        \
+  static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
+
+#define NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(_class)             \
+  void DeleteCycleCollectable(void) { delete this; }                           \
+  class NS_CYCLE_COLLECTION_INNERCLASS : public nsScriptObjectTracer {         \
+   public:                                                                     \
+    constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags = 0)        \
+        : nsScriptObjectTracer(aFlags | FlagMaybeSingleZoneJSHolder) {}        \
+                                                                               \
+   private:                                                                    \
+    NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class)                         \
+    NS_IMETHOD_(void)                                                          \
+    Trace(void* p, const TraceCallbacks& cb, void* closure) override;          \
+    NS_IMETHOD_(void)                                                          \
+    TraceWrapper(void* aPtr, const TraceCallbacks& aCb, void* aClosure) final; \
+    static constexpr nsScriptObjectTracer* GetParticipant() {                  \
+      return &_class::NS_CYCLE_COLLECTION_INNERNAME;                           \
+    }                                                                          \
+  };                                                                           \
+  static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
 
 #define NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER \
   tmp->TraceWrapper(aCallbacks, aClosure);
@@ -429,33 +547,39 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
 #define NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
   tmp->ReleaseWrapper(p);
 
-#define NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class) \
-  NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(_class)              \
-    NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER        \
-  NS_IMPL_CYCLE_COLLECTION_TRACE_END
+#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class)        \
+  static_assert(std::is_base_of<nsWrapperCache, _class>::value,    \
+                "Class should inherit nsWrapperCache");            \
+  NS_IMPL_CYCLE_COLLECTION_SINGLE_ZONE_SCRIPT_HOLDER_CLASS(_class) \
+  NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(_class)                     \
+    TraceWrapper(p, aCallbacks, aClosure);                         \
+  NS_IMPL_CYCLE_COLLECTION_TRACE_END                               \
+  void NS_CYCLE_COLLECTION_CLASSNAME(_class)::TraceWrapper(        \
+      void* p, const TraceCallbacks& aCallbacks, void* aClosure) { \
+    _class* tmp = DowncastCCParticipant<_class>(p);                \
+    NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER               \
+  }
 
 #define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(_class) \
-  NS_IMPL_CYCLE_COLLECTION_CLASS(_class)                \
+  NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class)   \
   NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)         \
     NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER   \
   NS_IMPL_CYCLE_COLLECTION_UNLINK_END                   \
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class)       \
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                 \
-  NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 #define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(_class, ...) \
-  NS_IMPL_CYCLE_COLLECTION_CLASS(_class)                   \
+  NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class)      \
   NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)            \
     NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__)           \
     NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER      \
   NS_IMPL_CYCLE_COLLECTION_UNLINK_END                      \
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class)          \
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__)         \
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                    \
-  NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 #define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WEAK(_class, ...) \
-  NS_IMPL_CYCLE_COLLECTION_CLASS(_class)                        \
+  NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class)           \
   NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)                 \
     NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__)                \
     NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER           \
@@ -463,11 +587,10 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_END                           \
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class)               \
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__)              \
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                         \
-  NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 #define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WEAK_PTR(_class, ...) \
-  NS_IMPL_CYCLE_COLLECTION_CLASS(_class)                            \
+  NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class)               \
   NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)                     \
     NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__)                    \
     NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER               \
@@ -475,24 +598,33 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_END                               \
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class)                   \
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__)                  \
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                             \
-  NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 // This is used for wrapper cached classes that inherit from cycle
 // collected non-wrapper cached classes.
-#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_INHERITED(_class, _base, ...) \
-  NS_IMPL_CYCLE_COLLECTION_CLASS(_class)                                    \
-  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base)            \
-    NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__)                            \
-    NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER                       \
-  NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                       \
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_class, _base)          \
-    NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__)                          \
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                                     \
-  NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
-
+#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_INHERITED(_class, _base, ...)   \
+  static_assert(!std::is_base_of<nsWrapperCache, _base>::value,               \
+                "Base class should not inherit nsWrapperCache");              \
+  NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(_class)                         \
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base)              \
+    NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__)                              \
+    NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER                         \
+  NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                         \
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_class, _base)            \
+    /* Assert somewhere, in this case in the traverse method, that the */     \
+    /* parent isn't a single zone holder*/                                    \
+    MOZ_ASSERT(!_base::NS_CYCLE_COLLECTION_INNERNAME.IsSingleZoneJSHolder()); \
+    NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__)                            \
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+
+// if NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WITH_JS_MEMBERS is used to implement
+// a wrappercache class, one needs to use
+// NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS and its variants in the class
+// declaration.
 #define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WITH_JS_MEMBERS(              \
     class_, native_members_, js_members_)                                   \
+  static_assert(std::is_base_of<nsWrapperCache, class_>::value,             \
+                "Class should inherit nsWrapperCache");                     \
   NS_IMPL_CYCLE_COLLECTION_CLASS(class_)                                    \
   NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(class_)                             \
     using ::ImplCycleCollectionUnlink;                                      \
diff --git a/dom/bindings/CallbackObject.cpp b/dom/bindings/CallbackObject.cpp
index c42da1c995500..dfd798ba230a5 100644
--- a/dom/bindings/CallbackObject.cpp
+++ b/dom/bindings/CallbackObject.cpp
@@ -31,7 +31,7 @@ NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTING_ADDREF(CallbackObject)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(CallbackObject)
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(CallbackObject)
+NS_IMPL_CYCLE_COLLECTION_CLASS(CallbackObject)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CallbackObject)
   tmp->ClearJSReferences();
diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py
index 5e99e08ba41a2..e6c3bee7d8f91 100644
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -19897,11 +19897,11 @@ class CGJSImplClass(CGBindingImplClass):
             ]
             isupportsDecl = "NS_DECL_CYCLE_COLLECTING_ISUPPORTS\n"
             ccDecl = (
-                "NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(%s)\n" % descriptor.name
+                "NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(%s)\n" % descriptor.name
             )
             extradefinitions = fill(
                 """
-                NS_IMPL_CYCLE_COLLECTION_CLASS(${ifaceName})
+                NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(${ifaceName})
                 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(${ifaceName})
                   NS_IMPL_CYCLE_COLLECTION_UNLINK(mImpl)
                   NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)
@@ -19912,7 +19912,6 @@ class CGJSImplClass(CGBindingImplClass):
                   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImpl)
                   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
                 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-                NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(${ifaceName})
                 NS_IMPL_CYCLE_COLLECTING_ADDREF(${ifaceName})
                 NS_IMPL_CYCLE_COLLECTING_RELEASE(${ifaceName})
                 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(${ifaceName})
diff --git a/dom/bindings/SimpleGlobalObject.cpp b/dom/bindings/SimpleGlobalObject.cpp
index 6115f90f802e8..798efc94c14b6 100644
--- a/dom/bindings/SimpleGlobalObject.cpp
+++ b/dom/bindings/SimpleGlobalObject.cpp
@@ -21,7 +21,7 @@
 
 namespace mozilla::dom {
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(SimpleGlobalObject)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SimpleGlobalObject)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(SimpleGlobalObject)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
@@ -32,8 +32,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(SimpleGlobalObject)
   tmp->TraverseObjectsInGlobal(cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(SimpleGlobalObject)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(SimpleGlobalObject)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SimpleGlobalObject)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SimpleGlobalObject)
diff --git a/dom/bindings/SimpleGlobalObject.h b/dom/bindings/SimpleGlobalObject.h
index 6f58747e9ae45..45abd651ebf2a 100644
--- a/dom/bindings/SimpleGlobalObject.h
+++ b/dom/bindings/SimpleGlobalObject.h
@@ -50,8 +50,7 @@ class SimpleGlobalObject : public nsIGlobalObject, public nsWrapperCache {
                                                      JS::UndefinedHandleValue);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(SimpleGlobalObject,
-                                                         nsIGlobalObject)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SimpleGlobalObject)
 
   // Gets the GlobalType of this SimpleGlobalObject.
   GlobalType Type() const { return mType; }
diff --git a/dom/bindings/nsScriptErrorWithStack.cpp b/dom/bindings/nsScriptErrorWithStack.cpp
index d466d2a86a2ed..8b5f0bda9fd05 100644
--- a/dom/bindings/nsScriptErrorWithStack.cpp
+++ b/dom/bindings/nsScriptErrorWithStack.cpp
@@ -39,7 +39,7 @@ static nsCString FormatStackString(JSContext* cx, JSPrincipals* aPrincipals,
 
 }  // namespace
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(nsScriptErrorWithStack)
+NS_IMPL_CYCLE_COLLECTION_CLASS(nsScriptErrorWithStack)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsScriptErrorWithStack)
   tmp->mException.setUndefined();
diff --git a/dom/bindings/test/TestInterfaceIterableDouble.h b/dom/bindings/test/TestInterfaceIterableDouble.h
index ec81105a522c3..ba38b47e89ce5 100644
--- a/dom/bindings/test/TestInterfaceIterableDouble.h
+++ b/dom/bindings/test/TestInterfaceIterableDouble.h
@@ -28,7 +28,7 @@ class TestInterfaceIterableDouble final : public nsISupports,
                                           public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceIterableDouble)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceIterableDouble)
 
   explicit TestInterfaceIterableDouble(nsPIDOMWindowInner* aParent);
   nsPIDOMWindowInner* GetParentObject() const;
diff --git a/dom/bindings/test/TestInterfaceIterableDoubleUnion.h b/dom/bindings/test/TestInterfaceIterableDoubleUnion.h
index b30973e8d4e08..d35744922e2ba 100644
--- a/dom/bindings/test/TestInterfaceIterableDoubleUnion.h
+++ b/dom/bindings/test/TestInterfaceIterableDoubleUnion.h
@@ -27,7 +27,7 @@ class TestInterfaceIterableDoubleUnion final : public nsISupports,
                                                public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceIterableDoubleUnion)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceIterableDoubleUnion)
 
   explicit TestInterfaceIterableDoubleUnion(nsPIDOMWindowInner* aParent);
   nsPIDOMWindowInner* GetParentObject() const;
diff --git a/dom/bindings/test/TestInterfaceIterableSingle.h b/dom/bindings/test/TestInterfaceIterableSingle.h
index f6fbd4a98ec7a..68104d1d154ec 100644
--- a/dom/bindings/test/TestInterfaceIterableSingle.h
+++ b/dom/bindings/test/TestInterfaceIterableSingle.h
@@ -27,7 +27,7 @@ class TestInterfaceIterableSingle final : public nsISupports,
                                           public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceIterableSingle)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceIterableSingle)
 
   explicit TestInterfaceIterableSingle(nsPIDOMWindowInner* aParent);
   nsPIDOMWindowInner* GetParentObject() const;
diff --git a/dom/bindings/test/TestInterfaceMaplike.h b/dom/bindings/test/TestInterfaceMaplike.h
index 10da72e933ed7..e82f290d17b33 100644
--- a/dom/bindings/test/TestInterfaceMaplike.h
+++ b/dom/bindings/test/TestInterfaceMaplike.h
@@ -25,7 +25,7 @@ class GlobalObject;
 class TestInterfaceMaplike final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceMaplike)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceMaplike)
 
   explicit TestInterfaceMaplike(nsPIDOMWindowInner* aParent);
   nsPIDOMWindowInner* GetParentObject() const;
diff --git a/dom/bindings/test/TestInterfaceMaplikeJSObject.h b/dom/bindings/test/TestInterfaceMaplikeJSObject.h
index 53daf58cb7525..00feda779635a 100644
--- a/dom/bindings/test/TestInterfaceMaplikeJSObject.h
+++ b/dom/bindings/test/TestInterfaceMaplikeJSObject.h
@@ -26,7 +26,7 @@ class TestInterfaceMaplikeJSObject final : public nsISupports,
                                            public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceMaplikeJSObject)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceMaplikeJSObject)
 
   explicit TestInterfaceMaplikeJSObject(nsPIDOMWindowInner* aParent);
   nsPIDOMWindowInner* GetParentObject() const;
diff --git a/dom/bindings/test/TestInterfaceMaplikeObject.h b/dom/bindings/test/TestInterfaceMaplikeObject.h
index 01c40762b63bc..894447cc4157c 100644
--- a/dom/bindings/test/TestInterfaceMaplikeObject.h
+++ b/dom/bindings/test/TestInterfaceMaplikeObject.h
@@ -27,7 +27,7 @@ class TestInterfaceMaplikeObject final : public nsISupports,
                                          public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceMaplikeObject)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceMaplikeObject)
 
   explicit TestInterfaceMaplikeObject(nsPIDOMWindowInner* aParent);
   nsPIDOMWindowInner* GetParentObject() const;
diff --git a/dom/bindings/test/TestInterfaceObservableArray.h b/dom/bindings/test/TestInterfaceObservableArray.h
index 810eeb08021b1..3329663ac66b8 100644
--- a/dom/bindings/test/TestInterfaceObservableArray.h
+++ b/dom/bindings/test/TestInterfaceObservableArray.h
@@ -31,7 +31,7 @@ class TestInterfaceObservableArray final : public nsISupports,
                                            public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceObservableArray)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceObservableArray)
 
   nsPIDOMWindowInner* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aCx,
diff --git a/dom/bindings/test/TestInterfaceSetlike.h b/dom/bindings/test/TestInterfaceSetlike.h
index 4af0932adecbb..c99a0240ea863 100644
--- a/dom/bindings/test/TestInterfaceSetlike.h
+++ b/dom/bindings/test/TestInterfaceSetlike.h
@@ -25,7 +25,7 @@ class GlobalObject;
 class TestInterfaceSetlike final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceSetlike)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceSetlike)
   explicit TestInterfaceSetlike(JSContext* aCx, nsPIDOMWindowInner* aParent);
   nsPIDOMWindowInner* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aCx,
diff --git a/dom/bindings/test/TestInterfaceSetlikeNode.h b/dom/bindings/test/TestInterfaceSetlikeNode.h
index 83dfd19802bbe..c4efdeab19a57 100644
--- a/dom/bindings/test/TestInterfaceSetlikeNode.h
+++ b/dom/bindings/test/TestInterfaceSetlikeNode.h
@@ -26,7 +26,7 @@ class TestInterfaceSetlikeNode final : public nsISupports,
                                        public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestInterfaceSetlikeNode)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceSetlikeNode)
   explicit TestInterfaceSetlikeNode(JSContext* aCx,
                                     nsPIDOMWindowInner* aParent);
   nsPIDOMWindowInner* GetParentObject() const;
diff --git a/dom/bindings/test/TestTrialInterface.h b/dom/bindings/test/TestTrialInterface.h
index 29c73bacc17ad..1fa746b09a5ac 100644
--- a/dom/bindings/test/TestTrialInterface.h
+++ b/dom/bindings/test/TestTrialInterface.h
@@ -18,7 +18,7 @@ namespace mozilla::dom {
 class TestTrialInterface final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(TestTrialInterface)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(TestTrialInterface)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(TestTrialInterface)
 
  public:
   TestTrialInterface() = default;
diff --git a/dom/bindings/test/WrapperCachedNonISupportsTestInterface.h b/dom/bindings/test/WrapperCachedNonISupportsTestInterface.h
index 0b986325b2a30..c226d03456754 100644
--- a/dom/bindings/test/WrapperCachedNonISupportsTestInterface.h
+++ b/dom/bindings/test/WrapperCachedNonISupportsTestInterface.h
@@ -20,7 +20,7 @@ class WrapperCachedNonISupportsTestInterface final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(
       WrapperCachedNonISupportsTestInterface)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(
       WrapperCachedNonISupportsTestInterface)
 
  public:
diff --git a/dom/cache/Cache.h b/dom/cache/Cache.h
index d2d8b0b5adf79..02ccb557f716e 100644
--- a/dom/cache/Cache.h
+++ b/dom/cache/Cache.h
@@ -114,7 +114,7 @@ class Cache final : public nsISupports,
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Cache)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Cache)
 };
 
 }  // namespace cache
diff --git a/dom/cache/CacheStorage.h b/dom/cache/CacheStorage.h
index 2d66da89ec2b9..a210a4b4c2b2d 100644
--- a/dom/cache/CacheStorage.h
+++ b/dom/cache/CacheStorage.h
@@ -108,7 +108,7 @@ class CacheStorage final : public nsISupports,
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CacheStorage)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CacheStorage)
 };
 
 }  // namespace cache
diff --git a/dom/canvas/CanvasGradient.h b/dom/canvas/CanvasGradient.h
index b2e3f04914228..9455f7b14b36c 100644
--- a/dom/canvas/CanvasGradient.h
+++ b/dom/canvas/CanvasGradient.h
@@ -19,7 +19,7 @@ class CanvasRenderingContext2D;
 class CanvasGradient : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasGradient)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasGradient)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(CanvasGradient)
 
   enum class Type : uint8_t { LINEAR = 0, RADIAL, CONIC };
 
diff --git a/dom/canvas/CanvasPath.h b/dom/canvas/CanvasPath.h
index 7e109a96b5051..141f86fee0f45 100644
--- a/dom/canvas/CanvasPath.h
+++ b/dom/canvas/CanvasPath.h
@@ -22,7 +22,7 @@ struct DOMMatrix2DInit;
 class CanvasPath final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPath)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPath)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(CanvasPath)
 
   nsCOMPtr<nsISupports> GetParentObject() { return mParent; }
 
diff --git a/dom/canvas/CanvasPattern.h b/dom/canvas/CanvasPattern.h
index 0aa9f4655c514..7ec392b0c31aa 100644
--- a/dom/canvas/CanvasPattern.h
+++ b/dom/canvas/CanvasPattern.h
@@ -26,7 +26,7 @@ class CanvasPattern final : public nsWrapperCache {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPattern)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPattern)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(CanvasPattern)
 
   enum class RepeatMode : uint8_t { REPEAT, REPEATX, REPEATY, NOREPEAT };
 
diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp
index ac199cf96f721..e01116e939970 100644
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -903,7 +903,7 @@ CanvasShutdownObserver::Observe(nsISupports* aSubject, const char* aTopic,
 NS_IMPL_CYCLE_COLLECTING_ADDREF(CanvasRenderingContext2D)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(CanvasRenderingContext2D)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(CanvasRenderingContext2D)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CanvasRenderingContext2D)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CanvasRenderingContext2D)
   // Make sure we remove ourselves from the list of demotable contexts (raw
@@ -965,8 +965,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D)
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(CanvasRenderingContext2D)
-
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(CanvasRenderingContext2D)
   if (nsCCUncollectableMarker::sGeneration && tmp->HasKnownLiveWrapper()) {
     dom::Element* canvasElement = tmp->mCanvasElement;
diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h
index 48c49a69cdc1b..3f2088ee61bc7 100644
--- a/dom/canvas/CanvasRenderingContext2D.h
+++ b/dom/canvas/CanvasRenderingContext2D.h
@@ -482,7 +482,7 @@ class CanvasRenderingContext2D : public nsICanvasRenderingContextInternal,
   // nsISupports interface + CC
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(
       CanvasRenderingContext2D)
 
   enum class CanvasMultiGetterType : uint8_t {
diff --git a/dom/canvas/ClientWebGLContext.h b/dom/canvas/ClientWebGLContext.h
index 9a1b46743a439..22140dfadb00c 100644
--- a/dom/canvas/ClientWebGLContext.h
+++ b/dom/canvas/ClientWebGLContext.h
@@ -269,7 +269,7 @@ class WebGLBufferJS final : public nsWrapperCache, public webgl::ObjectJS {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLBufferJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLBufferJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLBufferJS)
 
   explicit WebGLBufferJS(const ClientWebGLContext& webgl)
       : webgl::ObjectJS(webgl) {}
@@ -298,7 +298,7 @@ class WebGLFramebufferJS final : public nsWrapperCache, public webgl::ObjectJS {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLFramebufferJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLFramebufferJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLFramebufferJS)
 
   explicit WebGLFramebufferJS(const ClientWebGLContext&, bool opaque = false);
 
@@ -330,7 +330,7 @@ class WebGLProgramJS final : public nsWrapperCache, public webgl::ObjectJS {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLProgramJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLProgramJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLProgramJS)
   // Must come first!
   // If the REFCOUNTING macro isn't declared first, the AddRef at
   // mInnerRef->js will panic when REFCOUNTING's "owning thread" var is still
@@ -392,7 +392,7 @@ class WebGLQueryJS final : public nsWrapperCache,
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQueryJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQueryJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLQueryJS)
 
   explicit WebGLQueryJS(const ClientWebGLContext& webgl)
       : webgl::ObjectJS(webgl) {}
@@ -412,7 +412,7 @@ class WebGLRenderbufferJS final : public nsWrapperCache,
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLRenderbufferJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLRenderbufferJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLRenderbufferJS)
 
  private:
   bool mHasBeenBound = false;  // !IsRenderbuffer until Bind
@@ -431,7 +431,7 @@ class WebGLSamplerJS final : public nsWrapperCache, public webgl::ObjectJS {
   // IsSampler without Bind
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSamplerJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSamplerJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLSamplerJS)
 
   explicit WebGLSamplerJS(const ClientWebGLContext& webgl)
       : webgl::ObjectJS(webgl) {}
@@ -450,7 +450,7 @@ class WebGLShaderJS final : public nsWrapperCache, public webgl::ObjectJS {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLShaderJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLShaderJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLShaderJS)
 
  private:
   const GLenum mType;
@@ -492,7 +492,7 @@ class WebGLSyncJS final : public nsWrapperCache,
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSyncJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSyncJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLSyncJS)
 
   explicit WebGLSyncJS(const ClientWebGLContext& webgl)
       : webgl::ObjectJS(webgl) {}
@@ -513,7 +513,7 @@ class WebGLTextureJS final : public nsWrapperCache, public webgl::ObjectJS {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTextureJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTextureJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLTextureJS)
 
   explicit WebGLTextureJS(const ClientWebGLContext& webgl)
       : webgl::ObjectJS(webgl) {}
@@ -539,7 +539,7 @@ class WebGLTransformFeedbackJS final : public nsWrapperCache,
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTransformFeedbackJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTransformFeedbackJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLTransformFeedbackJS)
 
   explicit WebGLTransformFeedbackJS(const ClientWebGLContext&);
 
@@ -564,7 +564,7 @@ class WebGLUniformLocationJS final : public nsWrapperCache,
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLUniformLocationJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLUniformLocationJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLUniformLocationJS)
 
   WebGLUniformLocationJS(const ClientWebGLContext& webgl,
                          std::weak_ptr<webgl::LinkResult> parent, uint32_t loc,
@@ -592,7 +592,7 @@ class WebGLVertexArrayJS final : public nsWrapperCache, public webgl::ObjectJS {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLVertexArrayJS)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLVertexArrayJS)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebGLVertexArrayJS)
 
   explicit WebGLVertexArrayJS(const ClientWebGLContext&);
 
@@ -710,7 +710,7 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal,
   // ----------------------------- Lifetime and DOM ---------------------------
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ClientWebGLContext)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ClientWebGLContext)
 
   JSObject* WrapObject(JSContext* cx,
                        JS::Handle<JSObject*> givenProto) override {
diff --git a/dom/canvas/ClientWebGLExtensions.h b/dom/canvas/ClientWebGLExtensions.h
index d2d8ba9815800..cf1a80756b84f 100644
--- a/dom/canvas/ClientWebGLExtensions.h
+++ b/dom/canvas/ClientWebGLExtensions.h
@@ -19,7 +19,7 @@ class ClientWebGLExtensionBase : public nsWrapperCache {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(ClientWebGLExtensionBase)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(ClientWebGLExtensionBase)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(ClientWebGLExtensionBase)
 
  protected:
   explicit ClientWebGLExtensionBase(ClientWebGLContext& context)
diff --git a/dom/canvas/ImageBitmap.h b/dom/canvas/ImageBitmap.h
index 6188a0fa7c7ec..282a743e2025f 100644
--- a/dom/canvas/ImageBitmap.h
+++ b/dom/canvas/ImageBitmap.h
@@ -79,7 +79,7 @@ struct ImageBitmapCloneData final {
 class ImageBitmap final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageBitmap)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ImageBitmap)
 
   nsCOMPtr<nsIGlobalObject> GetParentObject() const { return mParent; }
 
diff --git a/dom/canvas/ImageBitmapRenderingContext.h b/dom/canvas/ImageBitmapRenderingContext.h
index 4233448dc315b..52437bc405f41 100644
--- a/dom/canvas/ImageBitmapRenderingContext.h
+++ b/dom/canvas/ImageBitmapRenderingContext.h
@@ -52,7 +52,7 @@ class ImageBitmapRenderingContext final
   // nsISupports interface + CC
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageBitmapRenderingContext)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ImageBitmapRenderingContext)
 
   void GetCanvas(
       Nullable<OwningHTMLCanvasElementOrOffscreenCanvas>& retval) const;
diff --git a/dom/canvas/OffscreenCanvasRenderingContext2D.cpp b/dom/canvas/OffscreenCanvasRenderingContext2D.cpp
index 9eece4a5e3fdd..b43a0566152ff 100644
--- a/dom/canvas/OffscreenCanvasRenderingContext2D.cpp
+++ b/dom/canvas/OffscreenCanvasRenderingContext2D.cpp
@@ -41,13 +41,20 @@ class OffscreenCanvasShutdownObserver final {
   OffscreenCanvasRenderingContext2D* mOwner;
 };
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_INHERITED(
-    OffscreenCanvasRenderingContext2D, CanvasRenderingContext2D)
+NS_IMPL_CYCLE_COLLECTION_INHERITED(OffscreenCanvasRenderingContext2D,
+                                   CanvasRenderingContext2D)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(OffscreenCanvasRenderingContext2D)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
 NS_INTERFACE_MAP_END_INHERITING(CanvasRenderingContext2D)
 
+// Need to use NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED
+// and dummy trace since we're missing some _SKIPPABLE_ macros without
+// SCRIPT_HOLDER.
+NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(
+    OffscreenCanvasRenderingContext2D, CanvasRenderingContext2D)
+NS_IMPL_CYCLE_COLLECTION_TRACE_END
+
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(OffscreenCanvasRenderingContext2D)
   return tmp->HasKnownLiveWrapper();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
diff --git a/dom/canvas/XRWebGLLayer.h b/dom/canvas/XRWebGLLayer.h
index 01dab2f80e1ee..49d4c7e770106 100644
--- a/dom/canvas/XRWebGLLayer.h
+++ b/dom/canvas/XRWebGLLayer.h
@@ -27,7 +27,7 @@ struct XRWebGLLayerInit;
 class XRWebGLLayer final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(XRWebGLLayer)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(XRWebGLLayer)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(XRWebGLLayer)
 
   explicit XRWebGLLayer(
       nsISupports* aParent, XRSession& aSession, bool aIgnoreDepthValues,
diff --git a/dom/clients/api/Client.h b/dom/clients/api/Client.h
index 303c8be6382e7..cd47ccd93bad7 100644
--- a/dom/clients/api/Client.h
+++ b/dom/clients/api/Client.h
@@ -80,7 +80,7 @@ class Client final : public nsISupports, public nsWrapperCache {
                    ErrorResult& aRv);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(mozilla::dom::Client)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(mozilla::dom::Client)
 };
 
 }  // namespace dom
diff --git a/dom/clients/api/Clients.h b/dom/clients/api/Clients.h
index dd5448c4a1ebb..481b066655f11 100644
--- a/dom/clients/api/Clients.h
+++ b/dom/clients/api/Clients.h
@@ -46,7 +46,7 @@ class Clients final : public nsISupports, public nsWrapperCache {
   already_AddRefed<Promise> Claim(ErrorResult& aRv);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Clients)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Clients)
 };
 
 }  // namespace dom
diff --git a/dom/console/Console.cpp b/dom/console/Console.cpp
index 56b260f7f0d50..da66993586d5c 100644
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -793,7 +793,7 @@ class ConsoleProfileWorkerRunnable final : public ConsoleWorkerRunnable {
   nsString mAction;
 };
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(Console)
+NS_IMPL_CYCLE_COLLECTION_CLASS(Console)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Console)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
diff --git a/dom/console/ConsoleInstance.h b/dom/console/ConsoleInstance.h
index cb0ee5489f1c4..6afed56b57908 100644
--- a/dom/console/ConsoleInstance.h
+++ b/dom/console/ConsoleInstance.h
@@ -14,7 +14,7 @@ namespace mozilla::dom {
 class ConsoleInstance final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ConsoleInstance)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ConsoleInstance)
 
   explicit ConsoleInstance(JSContext* aCx,
                            const ConsoleInstanceOptions& aOptions);
diff --git a/dom/credentialmanagement/Credential.h b/dom/credentialmanagement/Credential.h
index a29bf28f1fc36..bb5fbd9539b0e 100644
--- a/dom/credentialmanagement/Credential.h
+++ b/dom/credentialmanagement/Credential.h
@@ -17,7 +17,7 @@ namespace mozilla::dom {
 class Credential : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Credential)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Credential)
 
  public:
   explicit Credential(nsPIDOMWindowInner* aParent);
diff --git a/dom/credentialmanagement/CredentialsContainer.h b/dom/credentialmanagement/CredentialsContainer.h
index 2d2d25af79aea..0a9bc9dfb7da7 100644
--- a/dom/credentialmanagement/CredentialsContainer.h
+++ b/dom/credentialmanagement/CredentialsContainer.h
@@ -16,7 +16,7 @@ class WebAuthnManager;
 class CredentialsContainer final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CredentialsContainer)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CredentialsContainer)
 
   explicit CredentialsContainer(nsPIDOMWindowInner* aParent);
 
diff --git a/dom/crypto/CryptoKey.h b/dom/crypto/CryptoKey.h
index 6619f1a5cda5e..d09d2cd66ceec 100644
--- a/dom/crypto/CryptoKey.h
+++ b/dom/crypto/CryptoKey.h
@@ -73,7 +73,7 @@ struct JsonWebKey;
 class CryptoKey final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CryptoKey)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CryptoKey)
 
   static const uint32_t CLEAR_EXTRACTABLE = 0xFFFFFFE;
   static const uint32_t EXTRACTABLE = 0x00000001;
diff --git a/dom/debugger/DebuggerNotification.h b/dom/debugger/DebuggerNotification.h
index 35dc5c45677c6..a0d443c27c9ca 100644
--- a/dom/debugger/DebuggerNotification.h
+++ b/dom/debugger/DebuggerNotification.h
@@ -18,7 +18,7 @@ namespace mozilla::dom {
 class DebuggerNotification : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DebuggerNotification)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DebuggerNotification)
 
   DebuggerNotification(nsIGlobalObject* aDebuggeeGlobal,
                        DebuggerNotificationType aType,
diff --git a/dom/debugger/DebuggerNotificationObserver.h b/dom/debugger/DebuggerNotificationObserver.h
index 7ba176f605358..743268f2a7faf 100644
--- a/dom/debugger/DebuggerNotificationObserver.h
+++ b/dom/debugger/DebuggerNotificationObserver.h
@@ -23,7 +23,7 @@ class DebuggerNotificationObserver final : public nsISupports,
                                            public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DebuggerNotificationObserver)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DebuggerNotificationObserver)
 
   static already_AddRefed<DebuggerNotificationObserver> Constructor(
       GlobalObject& aGlobal, ErrorResult& aRv);
diff --git a/dom/events/ClipboardItem.h b/dom/events/ClipboardItem.h
index fb043aa20119a..496ce2c0cefab 100644
--- a/dom/events/ClipboardItem.h
+++ b/dom/events/ClipboardItem.h
@@ -27,7 +27,7 @@ class ClipboardItem final : public nsWrapperCache {
   };
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(ClipboardItem)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(ClipboardItem)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(ClipboardItem)
 
   ClipboardItem(nsISupports* aOwner, dom::PresentationStyle aPresentationStyle,
                 nsTArray<ItemEntry>&& aItems);
diff --git a/dom/events/CustomEvent.cpp b/dom/events/CustomEvent.cpp
index 36eb76030b661..c4f1b30044298 100644
--- a/dom/events/CustomEvent.cpp
+++ b/dom/events/CustomEvent.cpp
@@ -23,7 +23,7 @@ CustomEvent::CustomEvent(mozilla::dom::EventTarget* aOwner,
 
 CustomEvent::~CustomEvent() { mozilla::DropJSObjects(this); }
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(CustomEvent)
+NS_IMPL_CYCLE_COLLECTION_CLASS(CustomEvent)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(CustomEvent, Event)
   mozilla::DropJSObjects(tmp);
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
diff --git a/dom/events/DOMEventTargetHelper.cpp b/dom/events/DOMEventTargetHelper.cpp
index 6a502b64e8bee..7cbe8d5636730 100644
--- a/dom/events/DOMEventTargetHelper.cpp
+++ b/dom/events/DOMEventTargetHelper.cpp
@@ -18,11 +18,7 @@ namespace mozilla {
 
 using namespace dom;
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(DOMEventTargetHelper)
-
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMEventTargetHelper)
-  NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMEventTargetHelper)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(DOMEventTargetHelper)
   if (MOZ_UNLIKELY(cb.WantDebugInfo())) {
diff --git a/dom/events/DOMEventTargetHelper.h b/dom/events/DOMEventTargetHelper.h
index 594ae6aa3e88f..622f482a16773 100644
--- a/dom/events/DOMEventTargetHelper.h
+++ b/dom/events/DOMEventTargetHelper.h
@@ -56,7 +56,7 @@ class DOMEventTargetHelper : public dom::EventTarget,
   explicit DOMEventTargetHelper(DOMEventTargetHelper* aOther);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(DOMEventTargetHelper)
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(DOMEventTargetHelper)
 
   virtual EventListenerManager* GetExistingListenerManager() const override;
   virtual EventListenerManager* GetOrCreateListenerManager() override;
diff --git a/dom/events/DataTransfer.cpp b/dom/events/DataTransfer.cpp
index 85dab302b6fcf..e932b67c296a5 100644
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -49,7 +49,7 @@
 
 namespace mozilla::dom {
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(DataTransfer)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DataTransfer)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DataTransfer)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)
@@ -64,7 +64,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DataTransfer)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDragTarget)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDragImage)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(DataTransfer)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DataTransfer)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DataTransfer)
diff --git a/dom/events/DataTransfer.h b/dom/events/DataTransfer.h
index b0d01e119ec0e..e9fed94a6771a 100644
--- a/dom/events/DataTransfer.h
+++ b/dom/events/DataTransfer.h
@@ -59,7 +59,7 @@ class DataTransfer final : public nsISupports, public nsWrapperCache {
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DataTransfer)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DataTransfer)
 
   friend class mozilla::EventStateManager;
 
diff --git a/dom/events/DataTransferItem.h b/dom/events/DataTransferItem.h
index ce97322defefd..171173852257f 100644
--- a/dom/events/DataTransferItem.h
+++ b/dom/events/DataTransferItem.h
@@ -23,7 +23,7 @@ class FunctionStringCallback;
 class DataTransferItem final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DataTransferItem);
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DataTransferItem);
 
  public:
   // The spec only talks about the "file" and "string" kinds. Due to the Moz*
diff --git a/dom/events/DataTransferItemList.h b/dom/events/DataTransferItemList.h
index b2d7f8e963c76..82977999db86f 100644
--- a/dom/events/DataTransferItemList.h
+++ b/dom/events/DataTransferItemList.h
@@ -21,7 +21,7 @@ class DataTransferItem;
 class DataTransferItemList final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DataTransferItemList);
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DataTransferItemList);
 
   explicit DataTransferItemList(DataTransfer* aDataTransfer)
       : mDataTransfer(aDataTransfer) {
diff --git a/dom/events/DeviceMotionEvent.h b/dom/events/DeviceMotionEvent.h
index 9d5922c24bcc1..3e0debba88db6 100644
--- a/dom/events/DeviceMotionEvent.h
+++ b/dom/events/DeviceMotionEvent.h
@@ -16,7 +16,7 @@ namespace mozilla::dom {
 class DeviceRotationRate final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DeviceRotationRate)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DeviceRotationRate)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(DeviceRotationRate)
 
   DeviceRotationRate(DeviceMotionEvent* aOwner, const Nullable<double>& aAlpha,
                      const Nullable<double>& aBeta,
@@ -44,7 +44,7 @@ class DeviceRotationRate final : public nsWrapperCache {
 class DeviceAcceleration final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DeviceAcceleration)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DeviceAcceleration)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(DeviceAcceleration)
 
   DeviceAcceleration(DeviceMotionEvent* aOwner, const Nullable<double>& aX,
                      const Nullable<double>& aY, const Nullable<double>& aZ);
diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp
index b2040b2d09c57..5f00c4c98153c 100644
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -129,11 +129,7 @@ NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Event)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Event)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(Event)
-
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Event)
-  NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Event)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Event)
   if (tmp->mEventIsInternal) {
diff --git a/dom/events/Event.h b/dom/events/Event.h
index 7759034cec57b..3984b021f0f10 100644
--- a/dom/events/Event.h
+++ b/dom/events/Event.h
@@ -86,7 +86,7 @@ class Event : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Event)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Event)
 
   nsIGlobalObject* GetParentObject() { return mOwner; }
 
diff --git a/dom/events/ImageCaptureError.h b/dom/events/ImageCaptureError.h
index 404af08b5846c..9c56c3f004da9 100644
--- a/dom/events/ImageCaptureError.h
+++ b/dom/events/ImageCaptureError.h
@@ -22,7 +22,7 @@ namespace mozilla::dom {
 class ImageCaptureError final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageCaptureError)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ImageCaptureError)
 
   ImageCaptureError(nsISupports* aParent, uint16_t aCode,
                     const nsAString& aMessage);
diff --git a/dom/events/MessageEvent.cpp b/dom/events/MessageEvent.cpp
index 5b16fa4eb14e4..92e59a6348f77 100644
--- a/dom/events/MessageEvent.cpp
+++ b/dom/events/MessageEvent.cpp
@@ -16,7 +16,7 @@
 
 namespace mozilla::dom {
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(MessageEvent)
+NS_IMPL_CYCLE_COLLECTION_CLASS(MessageEvent)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(MessageEvent, Event)
   tmp->mData.setUndefined();
diff --git a/dom/events/PaintRequest.h b/dom/events/PaintRequest.h
index 0cc6362fc8d1c..72a1e69283066 100644
--- a/dom/events/PaintRequest.h
+++ b/dom/events/PaintRequest.h
@@ -22,7 +22,7 @@ class PaintRequest final : public nsISupports, public nsWrapperCache {
   explicit PaintRequest(Event* aParent) : mParent(aParent) {}
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaintRequest)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PaintRequest)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
@@ -46,7 +46,7 @@ class PaintRequestList final : public nsISupports, public nsWrapperCache {
   explicit PaintRequestList(Event* aParent) : mParent(aParent) {}
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaintRequestList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PaintRequestList)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/events/TextClause.h b/dom/events/TextClause.h
index 54ce97b727866..18a3c8939227f 100644
--- a/dom/events/TextClause.h
+++ b/dom/events/TextClause.h
@@ -19,7 +19,7 @@ namespace mozilla::dom {
 class TextClause final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TextClause)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TextClause)
 
   nsPIDOMWindowInner* GetParentObject() const { return mOwner; }
 
diff --git a/dom/events/Touch.h b/dom/events/Touch.h
index 815d6a1b05d72..74924b34a2e09 100644
--- a/dom/events/Touch.h
+++ b/dom/events/Touch.h
@@ -39,7 +39,7 @@ class Touch final : public nsISupports,
   Touch(const Touch& aOther);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Touch)
 
   void InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent);
 
diff --git a/dom/events/TouchEvent.h b/dom/events/TouchEvent.h
index c175463442c89..eb88aa5868b96 100644
--- a/dom/events/TouchEvent.h
+++ b/dom/events/TouchEvent.h
@@ -21,7 +21,7 @@ namespace mozilla::dom {
 class TouchList final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TouchList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TouchList)
 
   explicit TouchList(nsISupports* aParent) : mParent(aParent) {
     nsJSContext::LikelyShortLivingObjectCreated();
diff --git a/dom/fetch/Headers.h b/dom/fetch/Headers.h
index fdccb1540619d..db3be8e75f6b4 100644
--- a/dom/fetch/Headers.h
+++ b/dom/fetch/Headers.h
@@ -34,7 +34,7 @@ class OwningByteStringSequenceSequenceOrByteStringByteStringRecord;
  */
 class Headers final : public nsISupports, public nsWrapperCache {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Headers)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Headers)
 
   friend class Request;
   friend class Response;
diff --git a/dom/fetch/Request.cpp b/dom/fetch/Request.cpp
index 3cb5f47751100..794b9489807eb 100644
--- a/dom/fetch/Request.cpp
+++ b/dom/fetch/Request.cpp
@@ -30,7 +30,8 @@ namespace mozilla::dom {
 NS_IMPL_ADDREF_INHERITED(Request, FetchBody<Request>)
 NS_IMPL_RELEASE_INHERITED(Request, FetchBody<Request>)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(Request)
+// Can't use _INHERITED macro here because FetchBody<Request> is abstract.
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Request)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(Request, FetchBody<Request>)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mReadableStreamBody)
@@ -49,10 +50,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(Request, FetchBody<Request>)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSignal)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(Request, FetchBody<Request>)
-  NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Request)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
 NS_INTERFACE_MAP_END_INHERITING(FetchBody<Request>)
diff --git a/dom/fetch/Request.h b/dom/fetch/Request.h
index 72a58d73cdd85..0086e076de973 100644
--- a/dom/fetch/Request.h
+++ b/dom/fetch/Request.h
@@ -25,8 +25,8 @@ class RequestOrUSVString;
 
 class Request final : public FetchBody<Request>, public nsWrapperCache {
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(Request,
-                                                         FetchBody<Request>)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(Request,
+                                                        FetchBody<Request>)
 
  public:
   Request(nsIGlobalObject* aOwner, SafeRefPtr<InternalRequest> aRequest,
diff --git a/dom/file/FileList.h b/dom/file/FileList.h
index f0537f264048d..f36b25ba07905 100644
--- a/dom/file/FileList.h
+++ b/dom/file/FileList.h
@@ -32,7 +32,7 @@ class Sequence;
 class FileList final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FileList)
 
   explicit FileList(nsISupports* aParent);
 
diff --git a/dom/filesystem/Directory.cpp b/dom/filesystem/Directory.cpp
index cb0e69a03451c..da5d6e551564e 100644
--- a/dom/filesystem/Directory.cpp
+++ b/dom/filesystem/Directory.cpp
@@ -20,7 +20,7 @@
 
 namespace mozilla::dom {
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(Directory)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Directory)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Directory)
   if (tmp->mFileSystem) {
@@ -38,8 +38,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Directory)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Directory)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Directory)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Directory)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Directory)
diff --git a/dom/filesystem/Directory.h b/dom/filesystem/Directory.h
index 11f1132cdaf2a..b8ee0e68e1f6a 100644
--- a/dom/filesystem/Directory.h
+++ b/dom/filesystem/Directory.h
@@ -25,7 +25,7 @@ class StringOrFileOrDirectory;
 class Directory final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Directory)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Directory)
 
   static already_AddRefed<Directory> Constructor(const GlobalObject& aGlobal,
                                                  const nsAString& aRealPath,
diff --git a/dom/filesystem/compat/FileSystem.h b/dom/filesystem/compat/FileSystem.h
index b8fa01d759c3b..92cb563ef4d48 100644
--- a/dom/filesystem/compat/FileSystem.h
+++ b/dom/filesystem/compat/FileSystem.h
@@ -23,7 +23,7 @@ class OwningFileOrDirectory;
 class FileSystem final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileSystem)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FileSystem)
 
   static already_AddRefed<FileSystem> Create(nsIGlobalObject* aGlobalObject);
 
diff --git a/dom/filesystem/compat/FileSystemDirectoryReader.h b/dom/filesystem/compat/FileSystemDirectoryReader.h
index 5aa9dce79fdf5..90274943b4bea 100644
--- a/dom/filesystem/compat/FileSystemDirectoryReader.h
+++ b/dom/filesystem/compat/FileSystemDirectoryReader.h
@@ -25,7 +25,7 @@ class FileSystemEntriesCallback;
 class FileSystemDirectoryReader : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileSystemDirectoryReader)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FileSystemDirectoryReader)
 
   explicit FileSystemDirectoryReader(FileSystemDirectoryEntry* aDirectoryEntry,
                                      FileSystem* aFileSystem,
diff --git a/dom/filesystem/compat/FileSystemEntry.h b/dom/filesystem/compat/FileSystemEntry.h
index ffdafc0a2cce8..2275c600a9bcc 100644
--- a/dom/filesystem/compat/FileSystemEntry.h
+++ b/dom/filesystem/compat/FileSystemEntry.h
@@ -25,7 +25,7 @@ class OwningFileOrDirectory;
 class FileSystemEntry : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileSystemEntry)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FileSystemEntry)
 
   static already_AddRefed<FileSystemEntry> Create(
       nsIGlobalObject* aGlobalObject,
diff --git a/dom/flex/Flex.h b/dom/flex/Flex.h
index 25d54c5069853..7476585a3cbcf 100644
--- a/dom/flex/Flex.h
+++ b/dom/flex/Flex.h
@@ -27,7 +27,7 @@ class Flex : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Flex)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Flex)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/flex/FlexItemValues.h b/dom/flex/FlexItemValues.h
index 91ba7a981aab1..2853a922bbc46 100644
--- a/dom/flex/FlexItemValues.h
+++ b/dom/flex/FlexItemValues.h
@@ -31,7 +31,7 @@ class FlexItemValues : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexItemValues)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FlexItemValues)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/flex/FlexLineValues.h b/dom/flex/FlexLineValues.h
index 09bb22cc7497a..340af2e7e5bd9 100644
--- a/dom/flex/FlexLineValues.h
+++ b/dom/flex/FlexLineValues.h
@@ -27,7 +27,7 @@ class FlexLineValues : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexLineValues)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FlexLineValues)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/fs/FileSystemDirectoryIterator.h b/dom/fs/FileSystemDirectoryIterator.h
index e07980c618551..30c7f3451187b 100644
--- a/dom/fs/FileSystemDirectoryIterator.h
+++ b/dom/fs/FileSystemDirectoryIterator.h
@@ -26,7 +26,7 @@ class FileSystemDirectoryIterator : public nsISupports, public nsWrapperCache {
   explicit FileSystemDirectoryIterator(nsIGlobalObject* aGlobal);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileSystemDirectoryIterator)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FileSystemDirectoryIterator)
 
   // WebIDL Boilerplate
   nsIGlobalObject* GetParentObject() const;
diff --git a/dom/fs/FileSystemHandle.h b/dom/fs/FileSystemHandle.h
index e2cb323fc11b8..21c9a9268f25f 100644
--- a/dom/fs/FileSystemHandle.h
+++ b/dom/fs/FileSystemHandle.h
@@ -26,7 +26,7 @@ class Promise;
 class FileSystemHandle : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileSystemHandle)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FileSystemHandle)
 
   // WebIDL Boilerplate
   nsIGlobalObject* GetParentObject() const;
diff --git a/dom/fs/FileSystemSyncAccessHandle.h b/dom/fs/FileSystemSyncAccessHandle.h
index a19737dfe4ecb..fcb07925ef58c 100644
--- a/dom/fs/FileSystemSyncAccessHandle.h
+++ b/dom/fs/FileSystemSyncAccessHandle.h
@@ -27,7 +27,7 @@ class FileSystemSyncAccessHandle final : public nsISupports,
                                          public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileSystemSyncAccessHandle)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FileSystemSyncAccessHandle)
 
   // WebIDL Boilerplate
   nsIGlobalObject* GetParentObject() const;
diff --git a/dom/gamepad/Gamepad.h b/dom/gamepad/Gamepad.h
index 8e667d0f4cbb1..689ea7f6d2a45 100644
--- a/dom/gamepad/Gamepad.h
+++ b/dom/gamepad/Gamepad.h
@@ -48,7 +48,7 @@ class Gamepad final : public nsISupports, public nsWrapperCache {
           uint32_t aNumTouchEvents);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Gamepad)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Gamepad)
 
   void SetConnected(bool aConnected);
   void SetButton(uint32_t aButton, bool aPressed, bool aTouched, double aValue);
diff --git a/dom/gamepad/GamepadButton.h b/dom/gamepad/GamepadButton.h
index 9d2363979b84f..74bde07fcf33a 100644
--- a/dom/gamepad/GamepadButton.h
+++ b/dom/gamepad/GamepadButton.h
@@ -19,7 +19,7 @@ class GamepadButton : public nsISupports, public nsWrapperCache {
       : mParent(aParent), mValue(0), mPressed(false), mTouched(false) {}
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GamepadButton)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GamepadButton)
 
   nsISupports* GetParentObject() const { return mParent; }
 
diff --git a/dom/gamepad/GamepadHapticActuator.h b/dom/gamepad/GamepadHapticActuator.h
index fe2b0266e8041..18b659137b881 100644
--- a/dom/gamepad/GamepadHapticActuator.h
+++ b/dom/gamepad/GamepadHapticActuator.h
@@ -22,7 +22,7 @@ class GamepadHapticActuator : public nsISupports, public nsWrapperCache {
                         uint32_t aIndex);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GamepadHapticActuator)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GamepadHapticActuator)
 
   nsISupports* GetParentObject() const;
 
diff --git a/dom/gamepad/GamepadLightIndicator.h b/dom/gamepad/GamepadLightIndicator.h
index 7f21164da4f91..80c6f9c13b051 100644
--- a/dom/gamepad/GamepadLightIndicator.h
+++ b/dom/gamepad/GamepadLightIndicator.h
@@ -19,7 +19,7 @@ class GamepadLightIndicator final : public nsISupports, public nsWrapperCache {
                         uint32_t aIndex);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GamepadLightIndicator)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GamepadLightIndicator)
 
   static GamepadLightIndicatorType DefaultType() {
     return GamepadLightIndicatorType::Rgb;
diff --git a/dom/geolocation/Geolocation.h b/dom/geolocation/Geolocation.h
index 5c0d2f96a22c6..7e1af00d05fba 100644
--- a/dom/geolocation/Geolocation.h
+++ b/dom/geolocation/Geolocation.h
@@ -116,7 +116,7 @@ namespace mozilla::dom {
 class Geolocation final : public nsIGeolocationUpdate, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Geolocation)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Geolocation)
 
   NS_DECL_NSIGEOLOCATIONUPDATE
 
diff --git a/dom/geolocation/GeolocationCoordinates.h b/dom/geolocation/GeolocationCoordinates.h
index de90a7f35d21f..28fb30b970681 100644
--- a/dom/geolocation/GeolocationCoordinates.h
+++ b/dom/geolocation/GeolocationCoordinates.h
@@ -21,7 +21,7 @@ class GeolocationCoordinates final : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GeolocationCoordinates)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GeolocationCoordinates)
 
  public:
   GeolocationCoordinates(GeolocationPosition* aPosition,
diff --git a/dom/geolocation/GeolocationPosition.h b/dom/geolocation/GeolocationPosition.h
index 67a074578bfd2..5920c8d2bd1cd 100644
--- a/dom/geolocation/GeolocationPosition.h
+++ b/dom/geolocation/GeolocationPosition.h
@@ -71,7 +71,7 @@ class GeolocationPosition final : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GeolocationPosition)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GeolocationPosition)
 
  public:
   GeolocationPosition(nsISupports* aParent, nsIDOMGeoPosition* aGeoPosition);
diff --git a/dom/geolocation/GeolocationPositionError.h b/dom/geolocation/GeolocationPositionError.h
index 814fe3079aa27..c379149791ea7 100644
--- a/dom/geolocation/GeolocationPositionError.h
+++ b/dom/geolocation/GeolocationPositionError.h
@@ -24,7 +24,7 @@ typedef CallbackObjectHolder<PositionErrorCallback,
 class GeolocationPositionError final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(GeolocationPositionError)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(GeolocationPositionError)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(GeolocationPositionError)
 
   GeolocationPositionError(Geolocation* aParent, int16_t aCode);
 
diff --git a/dom/grid/Grid.h b/dom/grid/Grid.h
index 52cbcbed9d61d..57f13e4044367 100644
--- a/dom/grid/Grid.h
+++ b/dom/grid/Grid.h
@@ -26,7 +26,7 @@ class Grid : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Grid)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Grid)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/grid/GridArea.h b/dom/grid/GridArea.h
index 9e209215bd532..64734f7d9185b 100644
--- a/dom/grid/GridArea.h
+++ b/dom/grid/GridArea.h
@@ -27,7 +27,7 @@ class GridArea : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridArea)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GridArea)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/grid/GridDimension.h b/dom/grid/GridDimension.h
index 8173497de1925..9d3b6174c7375 100644
--- a/dom/grid/GridDimension.h
+++ b/dom/grid/GridDimension.h
@@ -31,7 +31,7 @@ class GridDimension : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridDimension)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GridDimension)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/grid/GridLine.h b/dom/grid/GridLine.h
index 3a3207f7c9a2b..bcc332558394d 100644
--- a/dom/grid/GridLine.h
+++ b/dom/grid/GridLine.h
@@ -27,7 +27,7 @@ class GridLine : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridLine)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GridLine)
 
   void GetNames(nsTArray<nsString>& aNames) const;
   const nsTArray<RefPtr<nsAtom>>& Names() const { return mNames; }
diff --git a/dom/grid/GridLines.h b/dom/grid/GridLines.h
index 9b5b975e0b34d..f95993dc6dc30 100644
--- a/dom/grid/GridLines.h
+++ b/dom/grid/GridLines.h
@@ -33,7 +33,7 @@ class GridLines : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridLines)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GridLines)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/grid/GridTrack.h b/dom/grid/GridTrack.h
index 18b365f0e6bbd..fa78c2d5d0182 100644
--- a/dom/grid/GridTrack.h
+++ b/dom/grid/GridTrack.h
@@ -23,7 +23,7 @@ class GridTrack : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridTrack)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GridTrack)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/grid/GridTracks.h b/dom/grid/GridTracks.h
index ce11dca4d0553..d20da5e12bcc0 100644
--- a/dom/grid/GridTracks.h
+++ b/dom/grid/GridTracks.h
@@ -28,7 +28,7 @@ class GridTracks : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridTracks)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GridTracks)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/html/ElementInternals.cpp b/dom/html/ElementInternals.cpp
index 6aa6e72009eef..7e2c635b6d004 100644
--- a/dom/html/ElementInternals.cpp
+++ b/dom/html/ElementInternals.cpp
@@ -19,7 +19,7 @@
 
 namespace mozilla::dom {
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(ElementInternals)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ElementInternals)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ElementInternals)
   tmp->Unlink();
@@ -33,8 +33,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ElementInternals)
                                     mValidity, mValidationAnchor);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(ElementInternals)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(ElementInternals)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(ElementInternals)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ElementInternals)
diff --git a/dom/html/ElementInternals.h b/dom/html/ElementInternals.h
index ac238c71d5297..ea60ea82b0aea 100644
--- a/dom/html/ElementInternals.h
+++ b/dom/html/ElementInternals.h
@@ -34,8 +34,8 @@ class ElementInternals final : public nsIFormControl,
                                public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(ElementInternals,
-                                                         nsIFormControl)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(ElementInternals,
+                                                        nsIFormControl)
 
   explicit ElementInternals(HTMLElement* aTarget);
 
diff --git a/dom/html/HTMLAllCollection.h b/dom/html/HTMLAllCollection.h
index 1a0bfb1839177..6179951175e62 100644
--- a/dom/html/HTMLAllCollection.h
+++ b/dom/html/HTMLAllCollection.h
@@ -35,7 +35,7 @@ class HTMLAllCollection final : public nsISupports, public nsWrapperCache {
   explicit HTMLAllCollection(mozilla::dom::Document* aDocument);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(HTMLAllCollection)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(HTMLAllCollection)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/html/HTMLCanvasElement.h b/dom/html/HTMLCanvasElement.h
index 3b1c399f40459..bcce0da188468 100644
--- a/dom/html/HTMLCanvasElement.h
+++ b/dom/html/HTMLCanvasElement.h
@@ -412,7 +412,7 @@ class HTMLCanvasPrintState final : public nsWrapperCache {
   bool mIsDone;
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(HTMLCanvasPrintState)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(HTMLCanvasPrintState)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(HTMLCanvasPrintState)
 
   virtual JSObject* WrapObject(JSContext* cx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/html/HTMLOptionsCollection.h b/dom/html/HTMLOptionsCollection.h
index 97fd7ccd0732b..e4300c876d532 100644
--- a/dom/html/HTMLOptionsCollection.h
+++ b/dom/html/HTMLOptionsCollection.h
@@ -63,8 +63,8 @@ class HTMLOptionsCollection final : public nsIHTMLCollection,
   virtual nsINode* GetParentObject() override;
   DocGroup* GetDocGroup() const;
 
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(HTMLOptionsCollection,
-                                                         nsIHTMLCollection)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(HTMLOptionsCollection,
+                                                        nsIHTMLCollection)
 
   // Helpers for HTMLSelectElement
   /**
diff --git a/dom/html/HTMLTableElement.cpp b/dom/html/HTMLTableElement.cpp
index d680fe2b4e9b1..24a4097445c2c 100644
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -48,8 +48,8 @@ class TableRowsCollection final : public nsIHTMLCollection,
 
   NS_IMETHOD ParentDestroyed();
 
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(TableRowsCollection,
-                                                         nsIHTMLCollection)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(TableRowsCollection,
+                                                        nsIHTMLCollection)
 
   // nsWrapperCache
   using nsWrapperCache::GetWrapperPreserveColor;
diff --git a/dom/html/MediaError.h b/dom/html/MediaError.h
index faf4f856875cd..aac1df118dc4a 100644
--- a/dom/html/MediaError.h
+++ b/dom/html/MediaError.h
@@ -23,7 +23,7 @@ class MediaError final : public nsISupports, public nsWrapperCache {
 
   // nsISupports
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaError)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaError)
 
   HTMLMediaElement* GetParentObject() const { return mParent; }
 
diff --git a/dom/html/TimeRanges.h b/dom/html/TimeRanges.h
index 302d3070e7adb..2aac5308170ab 100644
--- a/dom/html/TimeRanges.h
+++ b/dom/html/TimeRanges.h
@@ -27,7 +27,7 @@ namespace dom {
 class TimeRanges final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TimeRanges)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TimeRanges)
 
   TimeRanges();
   explicit TimeRanges(nsISupports* aParent);
diff --git a/dom/html/ValidityState.h b/dom/html/ValidityState.h
index 0ef9d2332d8ab..b9cf7cf4644cd 100644
--- a/dom/html/ValidityState.h
+++ b/dom/html/ValidityState.h
@@ -19,7 +19,7 @@ class ValidityState final : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ValidityState)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ValidityState)
 
   friend class ::nsIConstraintValidation;
 
diff --git a/dom/html/nsDOMStringMap.cpp b/dom/html/nsDOMStringMap.cpp
index f9670ecb32d54..0f2171ed79fbe 100644
--- a/dom/html/nsDOMStringMap.cpp
+++ b/dom/html/nsDOMStringMap.cpp
@@ -16,7 +16,7 @@
 using namespace mozilla;
 using namespace mozilla::dom;
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMStringMap)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMStringMap)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMStringMap)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElement)
@@ -34,8 +34,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMStringMap)
   tmp->mExpandoAndGeneration.OwnerUnlinked();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsDOMStringMap)
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMStringMap)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
diff --git a/dom/html/nsDOMStringMap.h b/dom/html/nsDOMStringMap.h
index 284627dfa80be..a5b3a2083264d 100644
--- a/dom/html/nsDOMStringMap.h
+++ b/dom/html/nsDOMStringMap.h
@@ -29,7 +29,7 @@ class DocGroup;
 class nsDOMStringMap : public nsStubMutationObserver, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMStringMap)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsDOMStringMap)
 
   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
 
diff --git a/dom/indexedDB/IDBCursor.cpp b/dom/indexedDB/IDBCursor.cpp
index e1c97d8449dcb..3934bc93d8d72 100644
--- a/dom/indexedDB/IDBCursor.cpp
+++ b/dom/indexedDB/IDBCursor.cpp
@@ -827,8 +827,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
   NS_IMPL_ADDREF_INHERITED(_subclassName, IDBCursor)                          \
   NS_IMPL_RELEASE_INHERITED(_subclassName, IDBCursor)
 
-#define NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS(_subclassName)  \
-  NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(_subclassName) \
+#define NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS(_subclassName) \
+  NS_IMPL_CYCLE_COLLECTION_CLASS(_subclassName)                    \
   NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS_METHODS(_subclassName)
 
 NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS(IDBObjectStoreCursor)
diff --git a/dom/indexedDB/IDBIndex.cpp b/dom/indexedDB/IDBIndex.cpp
index 95b27973494d9..2f77a1518c3bf 100644
--- a/dom/indexedDB/IDBIndex.cpp
+++ b/dom/indexedDB/IDBIndex.cpp
@@ -605,7 +605,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IDBIndex)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(IDBIndex)
+NS_IMPL_CYCLE_COLLECTION_CLASS(IDBIndex)
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBIndex)
   NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/indexedDB/IDBKeyRange.cpp b/dom/indexedDB/IDBKeyRange.cpp
index af31cf64905f0..9719dd468513f 100644
--- a/dom/indexedDB/IDBKeyRange.cpp
+++ b/dom/indexedDB/IDBKeyRange.cpp
@@ -115,7 +115,7 @@ void IDBKeyRange::ToSerialized(SerializedKeyRange& aKeyRange) const {
   }
 }
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(IDBKeyRange)
+NS_IMPL_CYCLE_COLLECTION_CLASS(IDBKeyRange)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBKeyRange)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp
index 3e685a379c960..021a66a086f36 100644
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -1174,7 +1174,7 @@ RefPtr<IDBIndex> IDBObjectStore::Index(const nsAString& aName,
   return index;
 }
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(IDBObjectStore)
+NS_IMPL_CYCLE_COLLECTION_CLASS(IDBObjectStore)
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBObjectStore)
   NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/indexedDB/IDBRequest.cpp b/dom/indexedDB/IDBRequest.cpp
index cab5d4766963f..9862f7818e8e9 100644
--- a/dom/indexedDB/IDBRequest.cpp
+++ b/dom/indexedDB/IDBRequest.cpp
@@ -268,7 +268,7 @@ DOMException* IDBRequest::GetError(ErrorResult& aRv) {
   return mError;
 }
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(IDBRequest)
+NS_IMPL_CYCLE_COLLECTION_CLASS(IDBRequest)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(IDBRequest,
                                                   DOMEventTargetHelper)
diff --git a/dom/ipc/WindowGlobalChild.h b/dom/ipc/WindowGlobalChild.h
index 951769edc1321..89e456d84d2c6 100644
--- a/dom/ipc/WindowGlobalChild.h
+++ b/dom/ipc/WindowGlobalChild.h
@@ -40,7 +40,7 @@ class WindowGlobalChild final : public WindowGlobalActor,
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WindowGlobalChild)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(WindowGlobalChild)
 
   static already_AddRefed<WindowGlobalChild> GetByInnerWindowId(
       uint64_t aInnerWindowId);
diff --git a/dom/ipc/jsactor/JSActor.cpp b/dom/ipc/jsactor/JSActor.cpp
index 6a3ddeea47d1c..c409d6a1bb2f7 100644
--- a/dom/ipc/jsactor/JSActor.cpp
+++ b/dom/ipc/jsactor/JSActor.cpp
@@ -36,7 +36,7 @@ NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTING_ADDREF(JSActor)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(JSActor)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(JSActor)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(JSActor)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(JSActor)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
@@ -53,8 +53,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(JSActor)
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(JSActor)
-
 JSActor::JSActor(nsISupports* aGlobal) {
   mGlobal = do_QueryInterface(aGlobal);
   if (!mGlobal) {
diff --git a/dom/ipc/jsactor/JSActor.h b/dom/ipc/jsactor/JSActor.h
index d7b0e1563bce3..b4bd1e421daa4 100644
--- a/dom/ipc/jsactor/JSActor.h
+++ b/dom/ipc/jsactor/JSActor.h
@@ -43,7 +43,7 @@ enum class JSActorMessageKind {
 class JSActor : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(JSActor)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(JSActor)
 
   explicit JSActor(nsISupports* aGlobal = nullptr);
 
diff --git a/dom/ipc/jsactor/JSProcessActorChild.cpp b/dom/ipc/jsactor/JSProcessActorChild.cpp
index be0d49743c019..6e5337a0d2235 100644
--- a/dom/ipc/jsactor/JSProcessActorChild.cpp
+++ b/dom/ipc/jsactor/JSProcessActorChild.cpp
@@ -14,9 +14,6 @@ namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(JSProcessActorChild, JSActor, mManager)
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(JSProcessActorChild, JSActor)
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(JSProcessActorChild)
 NS_INTERFACE_MAP_END_INHERITING(JSActor)
 
diff --git a/dom/ipc/jsactor/JSProcessActorChild.h b/dom/ipc/jsactor/JSProcessActorChild.h
index f9ae841c7e881..a8be65211cd02 100644
--- a/dom/ipc/jsactor/JSProcessActorChild.h
+++ b/dom/ipc/jsactor/JSProcessActorChild.h
@@ -16,8 +16,7 @@ namespace mozilla::dom {
 class JSProcessActorChild final : public JSActor {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(JSProcessActorChild,
-                                                         JSActor)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(JSProcessActorChild, JSActor)
 
   explicit JSProcessActorChild(nsISupports* aGlobal = nullptr)
       : JSActor(aGlobal) {}
diff --git a/dom/ipc/jsactor/JSProcessActorParent.cpp b/dom/ipc/jsactor/JSProcessActorParent.cpp
index 4b7cc1710525a..a9ed9b773f9da 100644
--- a/dom/ipc/jsactor/JSProcessActorParent.cpp
+++ b/dom/ipc/jsactor/JSProcessActorParent.cpp
@@ -13,9 +13,6 @@ namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(JSProcessActorParent, JSActor, mManager)
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(JSProcessActorParent, JSActor)
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(JSProcessActorParent)
 NS_INTERFACE_MAP_END_INHERITING(JSActor)
 
diff --git a/dom/ipc/jsactor/JSProcessActorParent.h b/dom/ipc/jsactor/JSProcessActorParent.h
index 239efbeb594db..7b2a1535f90f3 100644
--- a/dom/ipc/jsactor/JSProcessActorParent.h
+++ b/dom/ipc/jsactor/JSProcessActorParent.h
@@ -24,8 +24,7 @@ namespace dom {
 class JSProcessActorParent final : public JSActor {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(JSProcessActorParent,
-                                                         JSActor)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(JSProcessActorParent, JSActor)
 
   explicit JSProcessActorParent(nsISupports* aGlobal = nullptr)
       : JSActor(aGlobal) {}
diff --git a/dom/ipc/jsactor/JSWindowActorChild.cpp b/dom/ipc/jsactor/JSWindowActorChild.cpp
index 350b547dce292..e1e453cdaf607 100644
--- a/dom/ipc/jsactor/JSWindowActorChild.cpp
+++ b/dom/ipc/jsactor/JSWindowActorChild.cpp
@@ -147,9 +147,6 @@ void JSWindowActorChild::ClearManager() { mManager = nullptr; }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(JSWindowActorChild, JSActor, mManager)
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(JSWindowActorChild, JSActor)
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(JSWindowActorChild)
 NS_INTERFACE_MAP_END_INHERITING(JSActor)
 
diff --git a/dom/ipc/jsactor/JSWindowActorChild.h b/dom/ipc/jsactor/JSWindowActorChild.h
index a793c102733dc..8e43d6a6c760b 100644
--- a/dom/ipc/jsactor/JSWindowActorChild.h
+++ b/dom/ipc/jsactor/JSWindowActorChild.h
@@ -41,8 +41,7 @@ namespace mozilla::dom {
 class JSWindowActorChild final : public JSActor {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(JSWindowActorChild,
-                                                         JSActor)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(JSWindowActorChild, JSActor)
 
   explicit JSWindowActorChild(nsISupports* aGlobal = nullptr)
       : JSActor(aGlobal) {}
diff --git a/dom/ipc/jsactor/JSWindowActorParent.cpp b/dom/ipc/jsactor/JSWindowActorParent.cpp
index ecf68f84cf39e..4e67602c5d35b 100644
--- a/dom/ipc/jsactor/JSWindowActorParent.cpp
+++ b/dom/ipc/jsactor/JSWindowActorParent.cpp
@@ -113,9 +113,6 @@ void JSWindowActorParent::ClearManager() { mManager = nullptr; }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(JSWindowActorParent, JSActor, mManager)
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(JSWindowActorParent, JSActor)
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(JSWindowActorParent)
 NS_INTERFACE_MAP_END_INHERITING(JSActor)
 
diff --git a/dom/ipc/jsactor/JSWindowActorParent.h b/dom/ipc/jsactor/JSWindowActorParent.h
index 113d07c4bceb8..05fb88f8ac1b2 100644
--- a/dom/ipc/jsactor/JSWindowActorParent.h
+++ b/dom/ipc/jsactor/JSWindowActorParent.h
@@ -30,8 +30,7 @@ namespace mozilla::dom {
 class JSWindowActorParent final : public JSActor {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(JSWindowActorParent,
-                                                         JSActor)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(JSWindowActorParent, JSActor)
 
   explicit JSWindowActorParent(nsISupports* aGlobal = nullptr)
       : JSActor(aGlobal) {}
diff --git a/dom/locks/Lock.h b/dom/locks/Lock.h
index 87ceaf550fca1..ced0fc3785962 100644
--- a/dom/locks/Lock.h
+++ b/dom/locks/Lock.h
@@ -29,7 +29,7 @@ class Lock final : public PromiseNativeHandler, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Lock)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Lock)
 
   Lock(nsIGlobalObject* aGlobal,
        const WeakPtr<locks::LockRequestChild>& aLockRequestChild,
diff --git a/dom/locks/LockManager.h b/dom/locks/LockManager.h
index a750150ad6f08..7ceeadd35a020 100644
--- a/dom/locks/LockManager.h
+++ b/dom/locks/LockManager.h
@@ -34,7 +34,7 @@ class LockManagerChild;
 class LockManager final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(LockManager)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(LockManager)
 
   explicit LockManager(nsIGlobalObject* aGlobal);
 
diff --git a/dom/media/GetUserMediaRequest.h b/dom/media/GetUserMediaRequest.h
index abe97199a6e31..a2b69bf1d646a 100644
--- a/dom/media/GetUserMediaRequest.h
+++ b/dom/media/GetUserMediaRequest.h
@@ -54,7 +54,7 @@ class GetUserMediaRequest : public nsISupports, public nsWrapperCache {
                       const nsAString& aMediaSource, bool aIsHandlingUserInput);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GetUserMediaRequest)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GetUserMediaRequest)
 
   JSObject* WrapObject(JSContext* cx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/media/MediaDeviceInfo.h b/dom/media/MediaDeviceInfo.h
index bfbb205c46283..e68ffba9dce07 100644
--- a/dom/media/MediaDeviceInfo.h
+++ b/dom/media/MediaDeviceInfo.h
@@ -29,7 +29,7 @@ class MediaDeviceInfo final : public nsISupports, public nsWrapperCache {
                            const nsAString& aLabel, const nsAString& aGroupId);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaDeviceInfo)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaDeviceInfo)
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_MEDIADEVICEINFO_IMPLEMENTATION_IID)
 
   JSObject* WrapObject(JSContext* cx,
diff --git a/dom/media/MediaStreamError.h b/dom/media/MediaStreamError.h
index 5ac0bf7f4b5eb..3e84cf67909a7 100644
--- a/dom/media/MediaStreamError.h
+++ b/dom/media/MediaStreamError.h
@@ -87,7 +87,7 @@ class MediaStreamError final : public nsISupports,
         mParent(aParent) {}
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamError)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaStreamError)
   NS_DECLARE_STATIC_IID_ACCESSOR(
       MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID)
 
diff --git a/dom/media/VideoPlaybackQuality.h b/dom/media/VideoPlaybackQuality.h
index 977b9e5ba5f39..76ca38de7b305 100644
--- a/dom/media/VideoPlaybackQuality.h
+++ b/dom/media/VideoPlaybackQuality.h
@@ -17,7 +17,7 @@ namespace mozilla::dom {
 class VideoPlaybackQuality final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VideoPlaybackQuality)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VideoPlaybackQuality)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(VideoPlaybackQuality)
 
   VideoPlaybackQuality(HTMLMediaElement* aElement,
                        DOMHighResTimeStamp aCreationTime, uint32_t aTotalFrames,
diff --git a/dom/media/eme/MediaKeyStatusMap.h b/dom/media/eme/MediaKeyStatusMap.h
index 653e95093acfb..bd03f7812fb84 100644
--- a/dom/media/eme/MediaKeyStatusMap.h
+++ b/dom/media/eme/MediaKeyStatusMap.h
@@ -30,7 +30,7 @@ class ArrayBufferViewOrArrayBuffer;
 class MediaKeyStatusMap final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaKeyStatusMap)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaKeyStatusMap)
 
  public:
   explicit MediaKeyStatusMap(nsPIDOMWindowInner* aParent);
diff --git a/dom/media/eme/MediaKeySystemAccess.h b/dom/media/eme/MediaKeySystemAccess.h
index 50b36b081ef85..40ce2aab2d2a4 100644
--- a/dom/media/eme/MediaKeySystemAccess.h
+++ b/dom/media/eme/MediaKeySystemAccess.h
@@ -27,7 +27,7 @@ namespace dom {
 class MediaKeySystemAccess final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaKeySystemAccess)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaKeySystemAccess)
 
  public:
   explicit MediaKeySystemAccess(nsPIDOMWindowInner* aParent,
diff --git a/dom/media/eme/MediaKeys.cpp b/dom/media/eme/MediaKeys.cpp
index 176995c8c03d8..6e0faaab8736a 100644
--- a/dom/media/eme/MediaKeys.cpp
+++ b/dom/media/eme/MediaKeys.cpp
@@ -42,7 +42,7 @@ namespace mozilla::dom {
 // We don't use NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE because we need to
 // disconnect our MediaKeys instances from the inner window (mparent) before
 // we unlink it.
-NS_IMPL_CYCLE_COLLECTION_CLASS(MediaKeys)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaKeys)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MediaKeys)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
@@ -50,7 +50,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MediaKeys)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromises)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPendingSessions)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(MediaKeys)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(MediaKeys)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mElement)
diff --git a/dom/media/eme/MediaKeys.h b/dom/media/eme/MediaKeys.h
index 7d88e6458099c..5a44b3c227369 100644
--- a/dom/media/eme/MediaKeys.h
+++ b/dom/media/eme/MediaKeys.h
@@ -56,7 +56,7 @@ class MediaKeys final : public nsIObserver,
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaKeys)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaKeys)
 
   NS_DECL_NSIOBSERVER
 
diff --git a/dom/media/mediacapabilities/MediaCapabilities.h b/dom/media/mediacapabilities/MediaCapabilities.h
index dd7b4127703cd..b31e12e8ab5dc 100644
--- a/dom/media/mediacapabilities/MediaCapabilities.h
+++ b/dom/media/mediacapabilities/MediaCapabilities.h
@@ -45,7 +45,7 @@ class MediaCapabilities final : public nsISupports, public nsWrapperCache {
  public:
   // Ref counting and cycle collection
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaCapabilities)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaCapabilities)
 
   // WebIDL Methods
   already_AddRefed<Promise> DecodingInfo(
diff --git a/dom/media/mediasession/MediaMetadata.h b/dom/media/mediasession/MediaMetadata.h
index 63fae8f776411..6c552e646577d 100644
--- a/dom/media/mediasession/MediaMetadata.h
+++ b/dom/media/mediasession/MediaMetadata.h
@@ -42,7 +42,7 @@ class MediaMetadata final : public nsISupports,
  public:
   // Ref counting and cycle collection
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaMetadata)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaMetadata)
 
   // WebIDL methods
   nsIGlobalObject* GetParentObject() const;
diff --git a/dom/media/mediasession/MediaSession.cpp b/dom/media/mediasession/MediaSession.cpp
index 718695fa0322e..e55fa28d96e15 100644
--- a/dom/media/mediasession/MediaSession.cpp
+++ b/dom/media/mediasession/MediaSession.cpp
@@ -22,14 +22,13 @@ namespace mozilla::dom {
 
 // We don't use NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE because we need to
 // unregister MediaSession from document's activity listeners.
-NS_IMPL_CYCLE_COLLECTION_CLASS(MediaSession)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaSession)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MediaSession)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaMetadata)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mActionHandlers)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDoc)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(MediaSession)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(MediaSession)
   tmp->Shutdown();
diff --git a/dom/media/mediasession/MediaSession.h b/dom/media/mediasession/MediaSession.h
index 4408f262a3b52..db6864c842c6a 100644
--- a/dom/media/mediasession/MediaSession.h
+++ b/dom/media/mediasession/MediaSession.h
@@ -42,7 +42,7 @@ class MediaSession final : public nsIDocumentActivity, public nsWrapperCache {
  public:
   // Ref counting and cycle collection
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaSession)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaSession)
   NS_DECL_NSIDOCUMENTACTIVITY
 
   explicit MediaSession(nsPIDOMWindowInner* aParent);
diff --git a/dom/media/webaudio/AudioListener.h b/dom/media/webaudio/AudioListener.h
index 640191d50b0b3..7d7fad3bfb54b 100644
--- a/dom/media/webaudio/AudioListener.h
+++ b/dom/media/webaudio/AudioListener.h
@@ -50,7 +50,7 @@ class AudioListener final : public nsWrapperCache {
   explicit AudioListener(AudioContext* aContext);
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AudioListener)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AudioListener)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(AudioListener)
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
diff --git a/dom/media/webaudio/AudioParam.cpp b/dom/media/webaudio/AudioParam.cpp
index fd07f844fd3e2..2bd169e263152 100644
--- a/dom/media/webaudio/AudioParam.cpp
+++ b/dom/media/webaudio/AudioParam.cpp
@@ -12,7 +12,7 @@
 
 namespace mozilla::dom {
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(AudioParam)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AudioParam)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AudioParam)
   tmp->DisconnectFromGraphAndDestroyTrack();
@@ -23,8 +23,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AudioParam)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNode)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AudioParam)
-
 NS_IMPL_CYCLE_COLLECTING_NATIVE_ADDREF(AudioParam)
 NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE(AudioParam)
 
diff --git a/dom/media/webaudio/AudioParam.h b/dom/media/webaudio/AudioParam.h
index 2a1a3eae26f20..397b078248c76 100644
--- a/dom/media/webaudio/AudioParam.h
+++ b/dom/media/webaudio/AudioParam.h
@@ -28,7 +28,7 @@ class AudioParam final : public nsWrapperCache, public AudioParamTimeline {
 
   NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
   NS_IMETHOD_(MozExternalRefCountType) Release(void);
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AudioParam)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(AudioParam)
 
   AudioContext* GetParentObject() const { return mNode->Context(); }
 
diff --git a/dom/media/webaudio/AudioParamMap.h b/dom/media/webaudio/AudioParamMap.h
index f960219593732..c7bb0bdbea6d7 100644
--- a/dom/media/webaudio/AudioParamMap.h
+++ b/dom/media/webaudio/AudioParamMap.h
@@ -15,7 +15,7 @@ namespace mozilla::dom {
 class AudioParamMap final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AudioParamMap)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AudioParamMap)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(AudioParamMap)
 
   explicit AudioParamMap(AudioWorkletNode* aParent);
 
diff --git a/dom/media/webaudio/AudioWorkletProcessor.h b/dom/media/webaudio/AudioWorkletProcessor.h
index 13f913fd5f1c9..3d37d61498035 100644
--- a/dom/media/webaudio/AudioWorkletProcessor.h
+++ b/dom/media/webaudio/AudioWorkletProcessor.h
@@ -25,7 +25,7 @@ class MessagePort;
 class AudioWorkletProcessor final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AudioWorkletProcessor)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AudioWorkletProcessor)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(AudioWorkletProcessor)
 
   static already_AddRefed<AudioWorkletProcessor> Constructor(
       const GlobalObject& aGlobal, ErrorResult& aRv);
diff --git a/dom/media/webaudio/PeriodicWave.h b/dom/media/webaudio/PeriodicWave.h
index d4c281df335da..18408789a93f7 100644
--- a/dom/media/webaudio/PeriodicWave.h
+++ b/dom/media/webaudio/PeriodicWave.h
@@ -26,7 +26,7 @@ class PeriodicWave final : public nsWrapperCache {
                ErrorResult& aRv);
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PeriodicWave)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PeriodicWave)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(PeriodicWave)
 
   static already_AddRefed<PeriodicWave> Constructor(
       const GlobalObject& aGlobal, AudioContext& aAudioContext,
diff --git a/dom/media/webrtc/RTCCertificate.h b/dom/media/webrtc/RTCCertificate.h
index e28d3a48b5983..a5cc6bde32121 100644
--- a/dom/media/webrtc/RTCCertificate.h
+++ b/dom/media/webrtc/RTCCertificate.h
@@ -44,7 +44,7 @@ class Promise;
 class RTCCertificate final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(RTCCertificate)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(RTCCertificate)
 
   // WebIDL method that implements RTCPeerConnection.generateCertificate.
   static already_AddRefed<Promise> GenerateCertificate(
diff --git a/dom/media/webrtc/RTCIdentityProviderRegistrar.h b/dom/media/webrtc/RTCIdentityProviderRegistrar.h
index 0cab9087ec512..0510471f170f3 100644
--- a/dom/media/webrtc/RTCIdentityProviderRegistrar.h
+++ b/dom/media/webrtc/RTCIdentityProviderRegistrar.h
@@ -24,7 +24,7 @@ class RTCIdentityProviderRegistrar final : public nsISupports,
                                            public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(RTCIdentityProviderRegistrar)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(RTCIdentityProviderRegistrar)
 
   explicit RTCIdentityProviderRegistrar(nsIGlobalObject* aGlobal);
 
diff --git a/dom/media/webrtc/jsapi/PeerConnectionImpl.cpp b/dom/media/webrtc/jsapi/PeerConnectionImpl.cpp
index 2789066f57900..ea455416dffa0 100644
--- a/dom/media/webrtc/jsapi/PeerConnectionImpl.cpp
+++ b/dom/media/webrtc/jsapi/PeerConnectionImpl.cpp
@@ -244,7 +244,7 @@ void PeerConnectionAutoTimer::UnregisterConnection(bool aContainedAV) {
 
 bool PeerConnectionAutoTimer::IsStopped() { return mRefCnt == 0; }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(PeerConnectionImpl)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PeerConnectionImpl)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(PeerConnectionImpl)
   tmp->Close();
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mPCObserver, mWindow, mCertificate,
@@ -257,7 +257,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(PeerConnectionImpl)
                                     mSTSThread, mReceiveStreams, mOperations,
                                     mTransceivers, mKungFuDeathGrip)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(PeerConnectionImpl)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(PeerConnectionImpl)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(PeerConnectionImpl)
diff --git a/dom/media/webrtc/jsapi/PeerConnectionImpl.h b/dom/media/webrtc/jsapi/PeerConnectionImpl.h
index 95c668c87830b..3b7010e105b1a 100644
--- a/dom/media/webrtc/jsapi/PeerConnectionImpl.h
+++ b/dom/media/webrtc/jsapi/PeerConnectionImpl.h
@@ -174,7 +174,7 @@ class PeerConnectionImpl final
       const mozilla::dom::GlobalObject* aGlobal = nullptr);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PeerConnectionImpl)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PeerConnectionImpl)
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/media/webrtc/jsapi/RTCRtpReceiver.h b/dom/media/webrtc/jsapi/RTCRtpReceiver.h
index 1660b58698de3..a71a23b2062af 100644
--- a/dom/media/webrtc/jsapi/RTCRtpReceiver.h
+++ b/dom/media/webrtc/jsapi/RTCRtpReceiver.h
@@ -47,7 +47,7 @@ class RTCRtpReceiver : public nsISupports, public nsWrapperCache {
 
   // nsISupports
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(RTCRtpReceiver)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(RTCRtpReceiver)
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/media/webrtc/jsapi/RTCRtpSender.h b/dom/media/webrtc/jsapi/RTCRtpSender.h
index ae2969525be54..61f99694bd37a 100644
--- a/dom/media/webrtc/jsapi/RTCRtpSender.h
+++ b/dom/media/webrtc/jsapi/RTCRtpSender.h
@@ -45,7 +45,7 @@ class RTCRtpSender : public nsISupports, public nsWrapperCache {
 
   // nsISupports
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(RTCRtpSender)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(RTCRtpSender)
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/media/webrtc/jsapi/RTCRtpTransceiver.cpp b/dom/media/webrtc/jsapi/RTCRtpTransceiver.cpp
index 025f517955f0c..72ce4c86533b6 100644
--- a/dom/media/webrtc/jsapi/RTCRtpTransceiver.cpp
+++ b/dom/media/webrtc/jsapi/RTCRtpTransceiver.cpp
@@ -128,7 +128,7 @@ struct ConduitControlState : public AudioConduitControlInterface,
 
 MOZ_MTLOG_MODULE("RTCRtpTransceiver")
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(RTCRtpTransceiver)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(RTCRtpTransceiver)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(RTCRtpTransceiver)
   // We do not unlink mPc from here; PeerConnectionImpl invokes the necessary
   // teardown code itself during unlink.
@@ -141,7 +141,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(RTCRtpTransceiver)
                                     mSender, mDtlsTransport,
                                     mLastStableDtlsTransport)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(RTCRtpTransceiver)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(RTCRtpTransceiver)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(RTCRtpTransceiver)
diff --git a/dom/media/webrtc/jsapi/RTCRtpTransceiver.h b/dom/media/webrtc/jsapi/RTCRtpTransceiver.h
index 780184634976b..d4ab9b9aed20a 100644
--- a/dom/media/webrtc/jsapi/RTCRtpTransceiver.h
+++ b/dom/media/webrtc/jsapi/RTCRtpTransceiver.h
@@ -147,7 +147,7 @@ class RTCRtpTransceiver : public nsISupports,
 
   // nsISupports
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(RTCRtpTransceiver)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(RTCRtpTransceiver)
 
   static void NegotiatedDetailsToAudioCodecConfigs(
       const JsepTrackNegotiatedDetails& aDetails,
diff --git a/dom/media/webrtc/jsapi/RTCStatsReport.h b/dom/media/webrtc/jsapi/RTCStatsReport.h
index 3ae0c24a38208..98f868b298461 100644
--- a/dom/media/webrtc/jsapi/RTCStatsReport.h
+++ b/dom/media/webrtc/jsapi/RTCStatsReport.h
@@ -79,7 +79,7 @@ typedef MozPromise<UniquePtr<RTCStatsReportInternal>, nsresult, true>
 class RTCStatsReport final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(RTCStatsReport)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(RTCStatsReport)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(RTCStatsReport)
 
   explicit RTCStatsReport(nsPIDOMWindowInner* aParent);
 
diff --git a/dom/media/webspeech/recognition/SpeechGrammar.h b/dom/media/webspeech/recognition/SpeechGrammar.h
index ea4a6bab8ec7e..0dee1e9792540 100644
--- a/dom/media/webspeech/recognition/SpeechGrammar.h
+++ b/dom/media/webspeech/recognition/SpeechGrammar.h
@@ -27,7 +27,7 @@ class SpeechGrammar final : public nsISupports, public nsWrapperCache {
   explicit SpeechGrammar(nsISupports* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechGrammar)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SpeechGrammar)
 
   nsISupports* GetParentObject() const;
 
diff --git a/dom/media/webspeech/recognition/SpeechGrammarList.h b/dom/media/webspeech/recognition/SpeechGrammarList.h
index a8c628421ac02..7f1e09cd9e0b7 100644
--- a/dom/media/webspeech/recognition/SpeechGrammarList.h
+++ b/dom/media/webspeech/recognition/SpeechGrammarList.h
@@ -31,7 +31,7 @@ class SpeechGrammarList final : public nsISupports, public nsWrapperCache {
   explicit SpeechGrammarList(nsISupports* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechGrammarList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SpeechGrammarList)
 
   static already_AddRefed<SpeechGrammarList> Constructor(
       const GlobalObject& aGlobal);
diff --git a/dom/media/webspeech/recognition/SpeechRecognitionAlternative.h b/dom/media/webspeech/recognition/SpeechRecognitionAlternative.h
index bd15c38beb8f5..017d8699433fc 100644
--- a/dom/media/webspeech/recognition/SpeechRecognitionAlternative.h
+++ b/dom/media/webspeech/recognition/SpeechRecognitionAlternative.h
@@ -24,7 +24,7 @@ class SpeechRecognitionAlternative final : public nsISupports,
   explicit SpeechRecognitionAlternative(SpeechRecognition* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechRecognitionAlternative)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SpeechRecognitionAlternative)
 
   nsISupports* GetParentObject() const;
 
diff --git a/dom/media/webspeech/recognition/SpeechRecognitionResult.h b/dom/media/webspeech/recognition/SpeechRecognitionResult.h
index 8afeb6247c41c..fc9e8fd660266 100644
--- a/dom/media/webspeech/recognition/SpeechRecognitionResult.h
+++ b/dom/media/webspeech/recognition/SpeechRecognitionResult.h
@@ -25,7 +25,7 @@ class SpeechRecognitionResult final : public nsISupports,
   explicit SpeechRecognitionResult(SpeechRecognition* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechRecognitionResult)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SpeechRecognitionResult)
 
   nsISupports* GetParentObject() const;
 
diff --git a/dom/media/webspeech/recognition/SpeechRecognitionResultList.h b/dom/media/webspeech/recognition/SpeechRecognitionResultList.h
index 2337d06aca15d..b45659564b12e 100644
--- a/dom/media/webspeech/recognition/SpeechRecognitionResultList.h
+++ b/dom/media/webspeech/recognition/SpeechRecognitionResultList.h
@@ -26,7 +26,7 @@ class SpeechRecognitionResultList final : public nsISupports,
   explicit SpeechRecognitionResultList(SpeechRecognition* aParent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechRecognitionResultList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SpeechRecognitionResultList)
 
   nsISupports* GetParentObject() const;
 
diff --git a/dom/media/webspeech/synth/SpeechSynthesisVoice.h b/dom/media/webspeech/synth/SpeechSynthesisVoice.h
index 9c4ae7fb74314..079e5f49eaf5e 100644
--- a/dom/media/webspeech/synth/SpeechSynthesisVoice.h
+++ b/dom/media/webspeech/synth/SpeechSynthesisVoice.h
@@ -25,7 +25,7 @@ class SpeechSynthesisVoice final : public nsISupports, public nsWrapperCache {
   SpeechSynthesisVoice(nsISupports* aParent, const nsAString& aUri);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechSynthesisVoice)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SpeechSynthesisVoice)
 
   nsISupports* GetParentObject() const;
 
diff --git a/dom/media/webvtt/TextTrackCueList.h b/dom/media/webvtt/TextTrackCueList.h
index 5669fe12ce498..f590f94d8cca0 100644
--- a/dom/media/webvtt/TextTrackCueList.h
+++ b/dom/media/webvtt/TextTrackCueList.h
@@ -22,7 +22,7 @@ class TextTrackCue;
 class TextTrackCueList final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TextTrackCueList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TextTrackCueList)
 
   // TextTrackCueList WebIDL
   explicit TextTrackCueList(nsISupports* aParent);
diff --git a/dom/media/webvtt/TextTrackRegion.h b/dom/media/webvtt/TextTrackRegion.h
index a04422a0c2a06..d316d7a30c46d 100644
--- a/dom/media/webvtt/TextTrackRegion.h
+++ b/dom/media/webvtt/TextTrackRegion.h
@@ -23,7 +23,7 @@ class TextTrack;
 class TextTrackRegion final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TextTrackRegion)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TextTrackRegion)
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/messagechannel/MessageChannel.h b/dom/messagechannel/MessageChannel.h
index 861cd31229910..a618bd4abd0c8 100644
--- a/dom/messagechannel/MessageChannel.h
+++ b/dom/messagechannel/MessageChannel.h
@@ -25,7 +25,7 @@ class MessagePort;
 class MessageChannel final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MessageChannel)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MessageChannel)
 
   nsIGlobalObject* GetParentObject() const { return mGlobal; }
 
diff --git a/dom/midi/MIDIInputMap.h b/dom/midi/MIDIInputMap.h
index 9a146871f1d7a..5826290dbc813 100644
--- a/dom/midi/MIDIInputMap.h
+++ b/dom/midi/MIDIInputMap.h
@@ -23,7 +23,7 @@ namespace mozilla::dom {
 class MIDIInputMap final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MIDIInputMap)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MIDIInputMap)
   nsPIDOMWindowInner* GetParentObject() const { return mParent; }
 
   explicit MIDIInputMap(nsPIDOMWindowInner* aParent);
diff --git a/dom/midi/MIDIOutputMap.h b/dom/midi/MIDIOutputMap.h
index 280cf97713c2a..2e33e8b2a7208 100644
--- a/dom/midi/MIDIOutputMap.h
+++ b/dom/midi/MIDIOutputMap.h
@@ -24,7 +24,7 @@ namespace mozilla::dom {
 class MIDIOutputMap final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MIDIOutputMap)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MIDIOutputMap)
 
   explicit MIDIOutputMap(nsPIDOMWindowInner* aParent);
 
diff --git a/dom/payments/PaymentAddress.h b/dom/payments/PaymentAddress.h
index d713c0b904391..f57e89f54f2a9 100644
--- a/dom/payments/PaymentAddress.h
+++ b/dom/payments/PaymentAddress.h
@@ -15,7 +15,7 @@ namespace mozilla::dom {
 class PaymentAddress final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaymentAddress)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PaymentAddress)
 
   PaymentAddress(nsPIDOMWindowInner* aWindow, const nsAString& aCountry,
                  const nsTArray<nsString>& aAddressLine,
diff --git a/dom/performance/EventCounts.h b/dom/performance/EventCounts.h
index 7e782c710b8c6..59d9c140fc9fc 100644
--- a/dom/performance/EventCounts.h
+++ b/dom/performance/EventCounts.h
@@ -14,7 +14,7 @@ namespace mozilla::dom {
 class EventCounts final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(EventCounts)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(EventCounts)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(EventCounts)
 
   explicit EventCounts(nsISupports* aParent);
 
diff --git a/dom/performance/PerformanceEntry.h b/dom/performance/PerformanceEntry.h
index e5675c6c1c276..8ee54248bf646 100644
--- a/dom/performance/PerformanceEntry.h
+++ b/dom/performance/PerformanceEntry.h
@@ -28,7 +28,7 @@ class PerformanceEntry : public nsISupports, public nsWrapperCache {
                    const nsAString& aEntryType);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceEntry)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PerformanceEntry)
 
   nsISupports* GetParentObject() const { return mParent; }
 
diff --git a/dom/performance/PerformanceNavigation.h b/dom/performance/PerformanceNavigation.h
index b152e329ef020..2f6e21fe65b17 100644
--- a/dom/performance/PerformanceNavigation.h
+++ b/dom/performance/PerformanceNavigation.h
@@ -20,7 +20,7 @@ class PerformanceNavigation final : public nsWrapperCache {
   explicit PerformanceNavigation(Performance* aPerformance);
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PerformanceNavigation)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PerformanceNavigation)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(PerformanceNavigation)
 
   nsDOMNavigationTiming* GetDOMTiming() const {
     return mPerformance->GetDOMTiming();
diff --git a/dom/performance/PerformanceObserver.cpp b/dom/performance/PerformanceObserver.cpp
index 4f6516f350a26..e132b70860c2f 100644
--- a/dom/performance/PerformanceObserver.cpp
+++ b/dom/performance/PerformanceObserver.cpp
@@ -22,7 +22,7 @@
 using namespace mozilla;
 using namespace mozilla::dom;
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(PerformanceObserver)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PerformanceObserver)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(PerformanceObserver)
   tmp->Disconnect();
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mCallback)
@@ -37,7 +37,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(PerformanceObserver)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mQueuedEntries)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(PerformanceObserver)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(PerformanceObserver)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(PerformanceObserver)
diff --git a/dom/performance/PerformanceObserver.h b/dom/performance/PerformanceObserver.h
index 664ae6c121814..7b50eb8b60966 100644
--- a/dom/performance/PerformanceObserver.h
+++ b/dom/performance/PerformanceObserver.h
@@ -32,7 +32,7 @@ class WorkerPrivate;
 class PerformanceObserver final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceObserver)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PerformanceObserver)
 
   static already_AddRefed<PerformanceObserver> Constructor(
       const GlobalObject& aGlobal, PerformanceObserverCallback& aCb,
diff --git a/dom/performance/PerformanceObserverEntryList.h b/dom/performance/PerformanceObserverEntryList.h
index e20a5594cbf5a..3a353060daf52 100644
--- a/dom/performance/PerformanceObserverEntryList.h
+++ b/dom/performance/PerformanceObserverEntryList.h
@@ -35,7 +35,7 @@ class PerformanceObserverEntryList final : public nsISupports,
                                JS::Handle<JSObject*> aGivenProto) override;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceObserverEntryList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PerformanceObserverEntryList)
 
   void GetEntries(const PerformanceEntryFilterOptions& aFilter,
                   nsTArray<RefPtr<PerformanceEntry>>& aRetval);
diff --git a/dom/performance/PerformanceServerTiming.h b/dom/performance/PerformanceServerTiming.h
index cd015a479140d..27b85d29fd427 100644
--- a/dom/performance/PerformanceServerTiming.h
+++ b/dom/performance/PerformanceServerTiming.h
@@ -27,7 +27,7 @@ class PerformanceServerTiming final : public nsISupports,
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceServerTiming)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PerformanceServerTiming)
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/performance/PerformanceTiming.h b/dom/performance/PerformanceTiming.h
index 1bac8812aaf4c..080b3ddf5f4d5 100644
--- a/dom/performance/PerformanceTiming.h
+++ b/dom/performance/PerformanceTiming.h
@@ -244,7 +244,7 @@ class PerformanceTiming final : public nsWrapperCache {
                     nsIHttpChannel* aHttpChannel,
                     DOMHighResTimeStamp aZeroTime);
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PerformanceTiming)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PerformanceTiming)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(PerformanceTiming)
 
   nsDOMNavigationTiming* GetDOMTiming() const {
     return mPerformance->GetDOMTiming();
diff --git a/dom/permission/Permissions.h b/dom/permission/Permissions.h
index 7642f6c0f5338..f974fa49a9152 100644
--- a/dom/permission/Permissions.h
+++ b/dom/permission/Permissions.h
@@ -22,7 +22,7 @@ class Promise;
 class Permissions final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Permissions)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Permissions)
 
   explicit Permissions(nsPIDOMWindowInner* aWindow);
 
diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp
index b8a6b9313284d..66bb1bb4ae965 100644
--- a/dom/promise/Promise.cpp
+++ b/dom/promise/Promise.cpp
@@ -56,7 +56,7 @@ namespace mozilla::dom {
 
 // Promise
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(Promise)
+NS_IMPL_CYCLE_COLLECTION_SINGLE_ZONE_SCRIPT_HOLDER_CLASS(Promise)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Promise)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
@@ -69,6 +69,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Promise)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Promise)
+  // If you add new JS member variables, you may need to stop using
+  // NS_IMPL_CYCLE_COLLECTION_SINGLE_ZONE_SCRIPT_HOLDER_CLASS.
   NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mPromiseObj);
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
diff --git a/dom/push/PushManager.h b/dom/push/PushManager.h
index fd2aa38e7dd08..515fddc24b237 100644
--- a/dom/push/PushManager.h
+++ b/dom/push/PushManager.h
@@ -52,7 +52,7 @@ class WorkerPrivate;
 class PushManager final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PushManager)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PushManager)
 
   enum SubscriptionAction {
     SubscribeAction,
diff --git a/dom/push/PushSubscription.h b/dom/push/PushSubscription.h
index 74c5921a6c212..ea2bed5ad7e02 100644
--- a/dom/push/PushSubscription.h
+++ b/dom/push/PushSubscription.h
@@ -32,7 +32,7 @@ class Promise;
 class PushSubscription final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PushSubscription)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PushSubscription)
 
   PushSubscription(nsIGlobalObject* aGlobal, const nsAString& aEndpoint,
                    const nsAString& aScope,
diff --git a/dom/quota/StorageManager.h b/dom/quota/StorageManager.h
index f733036344c72..0b3376aec1dad 100644
--- a/dom/quota/StorageManager.h
+++ b/dom/quota/StorageManager.h
@@ -45,7 +45,7 @@ class StorageManager final : public nsISupports, public nsWrapperCache {
   already_AddRefed<Promise> GetDirectory(ErrorResult& aRv);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StorageManager)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(StorageManager)
 
   // nsWrapperCache
   virtual JSObject* WrapObject(JSContext* aCx,
diff --git a/dom/reporting/Report.h b/dom/reporting/Report.h
index e645142203148..e139e27858c4a 100644
--- a/dom/reporting/Report.h
+++ b/dom/reporting/Report.h
@@ -26,7 +26,7 @@ class ReportBody;
 class Report final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Report)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Report)
 
   Report(nsIGlobalObject* aGlobal, const nsAString& aType,
          const nsAString& aURL, ReportBody* aBody);
diff --git a/dom/reporting/ReportBody.h b/dom/reporting/ReportBody.h
index 6a458795d7a0b..9043dba16d1dd 100644
--- a/dom/reporting/ReportBody.h
+++ b/dom/reporting/ReportBody.h
@@ -24,7 +24,7 @@ namespace dom {
 class ReportBody : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ReportBody)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ReportBody)
 
   explicit ReportBody(nsIGlobalObject* aGlobal);
 
diff --git a/dom/reporting/ReportingObserver.cpp b/dom/reporting/ReportingObserver.cpp
index a9ab0bfd46bd6..2eac520dfef2c 100644
--- a/dom/reporting/ReportingObserver.cpp
+++ b/dom/reporting/ReportingObserver.cpp
@@ -13,7 +13,7 @@
 
 namespace mozilla::dom {
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(ReportingObserver)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ReportingObserver)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ReportingObserver)
   tmp->Disconnect();
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mReports)
@@ -27,7 +27,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ReportingObserver)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCallback)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(ReportingObserver)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(ReportingObserver, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(ReportingObserver, Release)
diff --git a/dom/reporting/ReportingObserver.h b/dom/reporting/ReportingObserver.h
index 3a9ba1e96f005..b89ee33adf9c4 100644
--- a/dom/reporting/ReportingObserver.h
+++ b/dom/reporting/ReportingObserver.h
@@ -33,7 +33,7 @@ struct ReportingObserverOptions;
 class ReportingObserver final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(ReportingObserver)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(ReportingObserver)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(ReportingObserver)
 
   static already_AddRefed<ReportingObserver> Constructor(
       const GlobalObject& aGlobal, ReportingObserverCallback& aCallback,
diff --git a/dom/reporting/TestingDeprecatedInterface.h b/dom/reporting/TestingDeprecatedInterface.h
index 016da79fa4785..7056a91ed7af1 100644
--- a/dom/reporting/TestingDeprecatedInterface.h
+++ b/dom/reporting/TestingDeprecatedInterface.h
@@ -24,7 +24,7 @@ class TestingDeprecatedInterface final : public nsISupports,
                                          public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestingDeprecatedInterface)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestingDeprecatedInterface)
 
   static already_AddRefed<TestingDeprecatedInterface> Constructor(
       const GlobalObject& aGlobal);
diff --git a/dom/security/featurepolicy/FeaturePolicy.h b/dom/security/featurepolicy/FeaturePolicy.h
index 1d4d23fbfda81..65f525974902f 100644
--- a/dom/security/featurepolicy/FeaturePolicy.h
+++ b/dom/security/featurepolicy/FeaturePolicy.h
@@ -67,7 +67,7 @@ class FeaturePolicy final : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FeaturePolicy)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FeaturePolicy)
 
   explicit FeaturePolicy(nsINode* aNode);
 
diff --git a/dom/security/sanitizer/Sanitizer.h b/dom/security/sanitizer/Sanitizer.h
index eb30b70f33c95..b4e5a0db30c49 100644
--- a/dom/security/sanitizer/Sanitizer.h
+++ b/dom/security/sanitizer/Sanitizer.h
@@ -32,7 +32,7 @@ class GlobalObject;
 class Sanitizer final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Sanitizer);
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Sanitizer);
 
   explicit Sanitizer(nsIGlobalObject* aGlobal, const SanitizerConfig& aOptions)
       : mGlobal(aGlobal), mTreeSanitizer(nsIParserUtils::SanitizerAllowStyle) {
diff --git a/dom/serviceworkers/NavigationPreloadManager.h b/dom/serviceworkers/NavigationPreloadManager.h
index 53a8d2b2adb07..e925e27e90461 100644
--- a/dom/serviceworkers/NavigationPreloadManager.h
+++ b/dom/serviceworkers/NavigationPreloadManager.h
@@ -24,7 +24,7 @@ class NavigationPreloadManager final : public nsISupports,
                                        public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(NavigationPreloadManager)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(NavigationPreloadManager)
 
   static bool IsValidHeader(const nsACString& aHeader);
 
diff --git a/dom/serviceworkers/ServiceWorkerEvents.cpp b/dom/serviceworkers/ServiceWorkerEvents.cpp
index 95eb52a95cca0..85c29dcc86068 100644
--- a/dom/serviceworkers/ServiceWorkerEvents.cpp
+++ b/dom/serviceworkers/ServiceWorkerEvents.cpp
@@ -1248,7 +1248,7 @@ void ExtendableMessageEvent::GetPorts(nsTArray<RefPtr<MessagePort>>& aPorts) {
   aPorts = mPorts.Clone();
 }
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(ExtendableMessageEvent)
+NS_IMPL_CYCLE_COLLECTION_CLASS(ExtendableMessageEvent)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(ExtendableMessageEvent, Event)
   tmp->mData.setUndefined();
diff --git a/dom/serviceworkers/ServiceWorkerEvents.h b/dom/serviceworkers/ServiceWorkerEvents.h
index 7cbb6d9bcd43a..2003c8afe98e5 100644
--- a/dom/serviceworkers/ServiceWorkerEvents.h
+++ b/dom/serviceworkers/ServiceWorkerEvents.h
@@ -202,7 +202,7 @@ class FetchEvent final : public ExtendableEvent {
 class PushMessageData final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PushMessageData)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(PushMessageData)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/storage/Storage.h b/dom/storage/Storage.h
index bea115e9d948a..81546a0b0e603 100644
--- a/dom/storage/Storage.h
+++ b/dom/storage/Storage.h
@@ -25,7 +25,7 @@ namespace mozilla::dom {
 class Storage : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Storage)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Storage)
 
   Storage(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal,
           nsIPrincipal* aStoragePrincipal);
diff --git a/dom/streams/ByteLengthQueuingStrategy.h b/dom/streams/ByteLengthQueuingStrategy.h
index cd70cbd71a140..64fe3e4528749 100644
--- a/dom/streams/ByteLengthQueuingStrategy.h
+++ b/dom/streams/ByteLengthQueuingStrategy.h
@@ -23,7 +23,7 @@ class ByteLengthQueuingStrategy final : public BaseQueuingStrategy,
                                         public nsWrapperCache {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(
       ByteLengthQueuingStrategy, BaseQueuingStrategy)
 
  public:
diff --git a/dom/streams/CountQueuingStrategy.h b/dom/streams/CountQueuingStrategy.h
index b939173c1e246..bbf109efbc911 100644
--- a/dom/streams/CountQueuingStrategy.h
+++ b/dom/streams/CountQueuingStrategy.h
@@ -23,8 +23,8 @@ class CountQueuingStrategy final : public BaseQueuingStrategy,
                                    public nsWrapperCache {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(CountQueuingStrategy,
-                                                         BaseQueuingStrategy)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(CountQueuingStrategy,
+                                                        BaseQueuingStrategy)
 
  public:
   explicit CountQueuingStrategy(nsISupports* aGlobal, double aHighWaterMark)
diff --git a/dom/streams/ReadableStreamBYOBReader.h b/dom/streams/ReadableStreamBYOBReader.h
index 90c8646b6c2b9..16c00930324f0 100644
--- a/dom/streams/ReadableStreamBYOBReader.h
+++ b/dom/streams/ReadableStreamBYOBReader.h
@@ -31,7 +31,7 @@ class ReadableStreamBYOBReader final : public ReadableStreamGenericReader,
                                        public nsWrapperCache {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(
       ReadableStreamBYOBReader, ReadableStreamGenericReader)
 
  public:
diff --git a/dom/streams/ReadableStreamDefaultReader.h b/dom/streams/ReadableStreamDefaultReader.h
index 5a7ab60418f9d..632ff2291125f 100644
--- a/dom/streams/ReadableStreamDefaultReader.h
+++ b/dom/streams/ReadableStreamDefaultReader.h
@@ -51,7 +51,7 @@ class ReadableStreamDefaultReader final : public ReadableStreamGenericReader,
 {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(
       ReadableStreamDefaultReader, ReadableStreamGenericReader)
 
  public:
diff --git a/dom/streams/TransformStream.h b/dom/streams/TransformStream.h
index 795c1f8a31410..b22065da2482a 100644
--- a/dom/streams/TransformStream.h
+++ b/dom/streams/TransformStream.h
@@ -25,7 +25,7 @@ class MessagePort;
 class TransformStream final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TransformStream)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TransformStream)
 
   TransformStream(nsIGlobalObject* aGlobal, ReadableStream* aReadable,
                   WritableStream* aWritable);
diff --git a/dom/streams/TransformStreamDefaultController.h b/dom/streams/TransformStreamDefaultController.h
index 9dd1756bea152..97399aed5b29b 100644
--- a/dom/streams/TransformStreamDefaultController.h
+++ b/dom/streams/TransformStreamDefaultController.h
@@ -25,7 +25,7 @@ class TransformStreamDefaultController final : public nsISupports,
                                                public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TransformStreamDefaultController)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TransformStreamDefaultController)
 
   MOZ_KNOWN_LIVE TransformStream* Stream();
   void SetStream(TransformStream& aStream);
diff --git a/dom/svg/SVGMatrix.h b/dom/svg/SVGMatrix.h
index 5b88b9b723613..c7666bc096d00 100644
--- a/dom/svg/SVGMatrix.h
+++ b/dom/svg/SVGMatrix.h
@@ -51,7 +51,7 @@ namespace mozilla::dom {
 class SVGMatrix final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGMatrix)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGMatrix)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(SVGMatrix)
 
   /**
    * Ctor for SVGMatrix objects that belong to a DOMSVGTransform.
diff --git a/dom/system/IOUtils.h b/dom/system/IOUtils.h
index 570d4fc87d5bd..3ce290b4b2dc2 100644
--- a/dom/system/IOUtils.h
+++ b/dom/system/IOUtils.h
@@ -815,7 +815,7 @@ class SyncReadFile : public nsISupports, public nsWrapperCache {
                int64_t aSize);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SyncReadFile)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SyncReadFile)
 
   nsISupports* GetParentObject() const { return mParent; }
 
diff --git a/dom/u2f/U2F.cpp b/dom/u2f/U2F.cpp
index 528e82c7e34b4..c5ee8c41c59a9 100644
--- a/dom/u2f/U2F.cpp
+++ b/dom/u2f/U2F.cpp
@@ -43,7 +43,7 @@ NS_INTERFACE_MAP_END_INHERITING(WebAuthnManagerBase)
 NS_IMPL_ADDREF_INHERITED(U2F, WebAuthnManagerBase)
 NS_IMPL_RELEASE_INHERITED(U2F, WebAuthnManagerBase)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(U2F)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(U2F)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(U2F, WebAuthnManagerBase)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mTransaction)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
@@ -52,7 +52,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(U2F, WebAuthnManagerBase)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTransaction)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(U2F)
 
 /***********************************************************************
  * Utility Functions
diff --git a/dom/u2f/U2F.h b/dom/u2f/U2F.h
index 1e57e4bb22a64..103650e4bcfd1 100644
--- a/dom/u2f/U2F.h
+++ b/dom/u2f/U2F.h
@@ -90,8 +90,8 @@ class U2FTransaction {
 class U2F final : public WebAuthnManagerBase, public nsWrapperCache {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(U2F,
-                                                         WebAuthnManagerBase)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(U2F,
+                                                        WebAuthnManagerBase)
 
   explicit U2F(nsPIDOMWindowInner* aParent) : WebAuthnManagerBase(aParent) {}
 
diff --git a/dom/url/URL.h b/dom/url/URL.h
index 9d3d811861637..5674b3d8bfbd1 100644
--- a/dom/url/URL.h
+++ b/dom/url/URL.h
@@ -30,7 +30,7 @@ class Optional;
 class URL final : public URLSearchParamsObserver, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(URL)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(URL)
 
   explicit URL(nsISupports* aParent) : mParent(aParent) {}
 
diff --git a/dom/url/URLSearchParams.h b/dom/url/URLSearchParams.h
index 3f779f12ab18a..c6a63a6f7f69c 100644
--- a/dom/url/URLSearchParams.h
+++ b/dom/url/URLSearchParams.h
@@ -51,7 +51,7 @@ class URLSearchParams final : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(URLSearchParams)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(URLSearchParams)
 
   explicit URLSearchParams(nsISupports* aParent,
                            URLSearchParamsObserver* aObserver = nullptr);
diff --git a/dom/vr/VRDisplay.h b/dom/vr/VRDisplay.h
index 1f4de0ee0cf00..866edc9846169 100644
--- a/dom/vr/VRDisplay.h
+++ b/dom/vr/VRDisplay.h
@@ -43,7 +43,7 @@ class VRFieldOfView final : public nsWrapperCache {
   VRFieldOfView(nsISupports* aParent, const gfx::VRFieldOfView& aSrc);
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VRFieldOfView)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VRFieldOfView)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(VRFieldOfView)
 
   double UpDegrees() const { return mUpDegrees; }
   double RightDegrees() const { return mRightDegrees; }
@@ -72,7 +72,7 @@ class VRDisplayCapabilities final : public nsWrapperCache {
       : mParent(aParent), mFlags(aFlags) {}
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VRDisplayCapabilities)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VRDisplayCapabilities)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(VRDisplayCapabilities)
 
   nsISupports* GetParentObject() const { return mParent; }
 
diff --git a/dom/vr/XRFrame.h b/dom/vr/XRFrame.h
index 588d222381f82..26bd601f3a7ea 100644
--- a/dom/vr/XRFrame.h
+++ b/dom/vr/XRFrame.h
@@ -26,7 +26,7 @@ class XRViewerPose;
 class XRFrame final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(XRFrame)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(XRFrame)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(XRFrame)
 
   explicit XRFrame(nsISupports* aParent, XRSession* aXRSession);
 
diff --git a/dom/vr/XRInputSource.h b/dom/vr/XRInputSource.h
index a44d1aa70d801..2f9405c18e164 100644
--- a/dom/vr/XRInputSource.h
+++ b/dom/vr/XRInputSource.h
@@ -27,7 +27,7 @@ enum class XRTargetRayMode : uint8_t;
 class XRInputSource final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(XRInputSource)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(XRInputSource)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(XRInputSource)
 
   explicit XRInputSource(nsISupports* aParent);
 
diff --git a/dom/vr/XRInputSourceArray.h b/dom/vr/XRInputSourceArray.h
index cbd70af688a7e..424e0062959c5 100644
--- a/dom/vr/XRInputSourceArray.h
+++ b/dom/vr/XRInputSourceArray.h
@@ -22,7 +22,7 @@ class XRInputSource;
 class XRInputSourceArray final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(XRInputSourceArray)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(XRInputSourceArray)
 
   explicit XRInputSourceArray(nsISupports* aParent);
 
diff --git a/dom/vr/XRPose.h b/dom/vr/XRPose.h
index cc197c1c88ef7..560581a2579cc 100644
--- a/dom/vr/XRPose.h
+++ b/dom/vr/XRPose.h
@@ -21,7 +21,7 @@ class XRView;
 class XRPose : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(XRPose)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(XRPose)
 
   explicit XRPose(nsISupports* aParent, XRRigidTransform* aTransform,
                   bool aEmulatedPosition);
diff --git a/dom/vr/XRRenderState.h b/dom/vr/XRRenderState.h
index d707e3fc678dc..6004949500514 100644
--- a/dom/vr/XRRenderState.h
+++ b/dom/vr/XRRenderState.h
@@ -18,7 +18,7 @@ class XRWebGLLayer;
 class XRRenderState final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(XRRenderState)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(XRRenderState)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(XRRenderState)
 
   explicit XRRenderState(nsISupports* aParent, XRSession* aSession);
   explicit XRRenderState(const XRRenderState& aOther);
diff --git a/dom/vr/XRViewport.h b/dom/vr/XRViewport.h
index 851a8835acc42..5b36a0e8ed515 100644
--- a/dom/vr/XRViewport.h
+++ b/dom/vr/XRViewport.h
@@ -18,7 +18,7 @@ namespace mozilla::dom {
 class XRViewport final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(XRViewport)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(XRViewport)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(XRViewport)
 
   explicit XRViewport(nsISupports* aParent, const gfx::IntRect& aRect);
 
diff --git a/dom/webgpu/Buffer.h b/dom/webgpu/Buffer.h
index 4f84249ceeab0..b9c72b290a049 100644
--- a/dom/webgpu/Buffer.h
+++ b/dom/webgpu/Buffer.h
@@ -42,7 +42,8 @@ struct MappedInfo {
 
 class Buffer final : public ObjectBase, public ChildOf<Device> {
  public:
-  GPU_DECL_CYCLE_COLLECTION(Buffer)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(Buffer)
+  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(Buffer)
   GPU_DECL_JS_WRAP(Buffer)
 
   Buffer(Device* const aParent, RawId aId, BufferAddress aSize, bool aMappable);
diff --git a/dom/webgpu/CanvasContext.h b/dom/webgpu/CanvasContext.h
index 10ef4d9f22532..010ada83ad75e 100644
--- a/dom/webgpu/CanvasContext.h
+++ b/dom/webgpu/CanvasContext.h
@@ -31,7 +31,7 @@ class CanvasContext final : public nsICanvasRenderingContextInternal,
  public:
   // nsISupports interface + CC
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CanvasContext)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CanvasContext)
 
   CanvasContext();
 
diff --git a/dom/webgpu/ObjectModel.h b/dom/webgpu/ObjectModel.h
index 62da6647171fd..7dd0c2d96f2da 100644
--- a/dom/webgpu/ObjectModel.h
+++ b/dom/webgpu/ObjectModel.h
@@ -61,8 +61,8 @@ class ObjectBase : public nsWrapperCache {
   JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto) \
       override;
 
-#define GPU_DECL_CYCLE_COLLECTION(T)                     \
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(T) \
+#define GPU_DECL_CYCLE_COLLECTION(T)                    \
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(T) \
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(T)
 
 #define GPU_IMPL_JS_WRAP(T)                                                  \
@@ -73,7 +73,7 @@ class ObjectBase : public nsWrapperCache {
 // Note: we don't use `NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE` directly
 // because there is a custom action we need to always do.
 #define GPU_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(T, ...) \
-  NS_IMPL_CYCLE_COLLECTION_CLASS(T)                    \
+  NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(T)       \
   NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(T)             \
     tmp->Cleanup();                                    \
     NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__)       \
@@ -81,11 +81,10 @@ class ObjectBase : public nsWrapperCache {
   NS_IMPL_CYCLE_COLLECTION_UNLINK_END                  \
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(T)           \
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__)     \
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                \
-  NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(T)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 #define GPU_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WEAK_PTR(T, ...) \
-  NS_IMPL_CYCLE_COLLECTION_CLASS(T)                             \
+  NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(T)                \
   NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(T)                      \
     tmp->Cleanup();                                             \
     NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__)                \
@@ -94,8 +93,7 @@ class ObjectBase : public nsWrapperCache {
   NS_IMPL_CYCLE_COLLECTION_UNLINK_END                           \
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(T)                    \
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__)              \
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                         \
-  NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(T)
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 #define GPU_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_INHERITED(T, P, ...) \
   NS_IMPL_CYCLE_COLLECTION_CLASS(T)                                 \
diff --git a/dom/webscheduling/WebTaskScheduler.h b/dom/webscheduling/WebTaskScheduler.h
index 543b73a8393d2..fcddd09d365bb 100644
--- a/dom/webscheduling/WebTaskScheduler.h
+++ b/dom/webscheduling/WebTaskScheduler.h
@@ -93,7 +93,7 @@ class WebTaskScheduler : public nsWrapperCache, public SupportsWeakPtr {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebTaskScheduler)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebTaskScheduler)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WebTaskScheduler)
 
   static already_AddRefed<WebTaskSchedulerMainThread> CreateForMainThread(
       nsGlobalWindowInner* aWindow);
diff --git a/dom/workers/WorkerLocation.h b/dom/workers/WorkerLocation.h
index 83dd10f52d43b..d51e73cde5098 100644
--- a/dom/workers/WorkerLocation.h
+++ b/dom/workers/WorkerLocation.h
@@ -45,7 +45,7 @@ class WorkerLocation final : public nsWrapperCache {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WorkerLocation)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WorkerLocation)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WorkerLocation)
 
   static already_AddRefed<WorkerLocation> Create(
       WorkerPrivate::LocationInfo& aInfo);
diff --git a/dom/workers/WorkerNavigator.h b/dom/workers/WorkerNavigator.h
index b0c24b8f1f59a..dce3120519685 100644
--- a/dom/workers/WorkerNavigator.h
+++ b/dom/workers/WorkerNavigator.h
@@ -52,7 +52,7 @@ class WorkerNavigator final : public nsWrapperCache {
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WorkerNavigator)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WorkerNavigator)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(WorkerNavigator)
 
   static already_AddRefed<WorkerNavigator> Create(bool aOnLine);
 
diff --git a/dom/worklet/Worklet.cpp b/dom/worklet/Worklet.cpp
index 474915dae13ac..b42b472163a58 100644
--- a/dom/worklet/Worklet.cpp
+++ b/dom/worklet/Worklet.cpp
@@ -449,7 +449,7 @@ void ExecutionRunnable::RunOnMainThread() {
 // ---------------------------------------------------------------------------
 // Worklet
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(Worklet)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Worklet)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Worklet)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow)
@@ -463,8 +463,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Worklet)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwnedObject)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Worklet)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Worklet)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Worklet)
 
diff --git a/dom/worklet/Worklet.h b/dom/worklet/Worklet.h
index 5d7627428f43b..8d980a96117e7 100644
--- a/dom/worklet/Worklet.h
+++ b/dom/worklet/Worklet.h
@@ -29,7 +29,7 @@ enum class CallerType : uint32_t;
 class Worklet final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Worklet)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Worklet)
 
   // |aOwnedObject| may be provided by the WorkletImpl as a parent thread
   // object to keep alive and traverse for CC as long as the Worklet has
diff --git a/dom/worklet/WorkletGlobalScope.cpp b/dom/worklet/WorkletGlobalScope.cpp
index 221cced44280b..501fb2b1dd1e7 100644
--- a/dom/worklet/WorkletGlobalScope.cpp
+++ b/dom/worklet/WorkletGlobalScope.cpp
@@ -14,7 +14,7 @@
 
 namespace mozilla::dom {
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(WorkletGlobalScope)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(WorkletGlobalScope)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(WorkletGlobalScope)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
@@ -27,8 +27,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(WorkletGlobalScope)
   tmp->TraverseObjectsInGlobal(cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(WorkletGlobalScope)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(WorkletGlobalScope)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(WorkletGlobalScope)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WorkletGlobalScope)
diff --git a/dom/worklet/WorkletGlobalScope.h b/dom/worklet/WorkletGlobalScope.h
index 1e63f2c6707ed..0ff6271596403 100644
--- a/dom/worklet/WorkletGlobalScope.h
+++ b/dom/worklet/WorkletGlobalScope.h
@@ -36,7 +36,7 @@ class WorkletGlobalScope : public nsIGlobalObject, public nsWrapperCache {
   NS_DECLARE_STATIC_IID_ACCESSOR(WORKLET_IID)
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WorkletGlobalScope)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(WorkletGlobalScope)
 
   WorkletGlobalScope(WorkletImpl*);
 
@@ -73,6 +73,7 @@ class WorkletGlobalScope : public nsIGlobalObject, public nsWrapperCache {
   ~WorkletGlobalScope();
 
   const RefPtr<WorkletImpl> mImpl;
+
  private:
   TimeStamp mCreationTimeStamp;
   RefPtr<Console> mConsole;
diff --git a/dom/xhr/XMLHttpRequestMainThread.cpp b/dom/xhr/XMLHttpRequestMainThread.cpp
index 625ab05d3f808..3e68ab9e7783c 100644
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -334,7 +334,7 @@ void XMLHttpRequestMainThread::SetRequestObserver(
   mRequestObserver = aObserver;
 }
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(XMLHttpRequestMainThread)
+NS_IMPL_CYCLE_COLLECTION_CLASS(XMLHttpRequestMainThread)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XMLHttpRequestMainThread,
                                                   XMLHttpRequestEventTarget)
diff --git a/dom/xslt/xpath/XPathResult.cpp b/dom/xslt/xpath/XPathResult.cpp
index f4beff48e7361..f6ffd6d05d490 100644
--- a/dom/xslt/xpath/XPathResult.cpp
+++ b/dom/xslt/xpath/XPathResult.cpp
@@ -44,9 +44,8 @@ XPathResult::XPathResult(const XPathResult& aResult)
 
 XPathResult::~XPathResult() { RemoveObserver(); }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(XPathResult)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(XPathResult)
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(XPathResult)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(XPathResult)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent) { tmp->RemoveObserver(); }
diff --git a/dom/xslt/xpath/XPathResult.h b/dom/xslt/xpath/XPathResult.h
index b5d20ee8a34c9..e073666a847f6 100644
--- a/dom/xslt/xpath/XPathResult.h
+++ b/dom/xslt/xpath/XPathResult.h
@@ -46,7 +46,7 @@ class XPathResult final : public nsStubMutationObserver, public nsWrapperCache {
 
   // nsISupports interface
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(XPathResult)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(XPathResult)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/dom/xslt/xslt/txMozillaXSLTProcessor.h b/dom/xslt/xslt/txMozillaXSLTProcessor.h
index 897bc418533be..3dcc41f6616a6 100644
--- a/dom/xslt/xslt/txMozillaXSLTProcessor.h
+++ b/dom/xslt/xslt/txMozillaXSLTProcessor.h
@@ -59,8 +59,8 @@ class txMozillaXSLTProcessor final : public nsIDocumentTransformer,
 
   // nsISupports interface
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(txMozillaXSLTProcessor,
-                                                         nsIDocumentTransformer)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(txMozillaXSLTProcessor,
+                                                        nsIDocumentTransformer)
 
   // nsIDocumentTransformer interface
   NS_IMETHOD SetTransformObserver(nsITransformObserver* aObserver) override;
diff --git a/gfx/layers/apz/util/CheckerboardReportService.h b/gfx/layers/apz/util/CheckerboardReportService.h
index 3062255f95bc1..d9b37509c5819 100644
--- a/gfx/layers/apz/util/CheckerboardReportService.h
+++ b/gfx/layers/apz/util/CheckerboardReportService.h
@@ -115,7 +115,7 @@ class CheckerboardReportService : public nsWrapperCache {
   nsISupports* GetParentObject();
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CheckerboardReportService)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CheckerboardReportService)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(CheckerboardReportService)
 
  public:
   /*
diff --git a/intl/l10n/FileSource.h b/intl/l10n/FileSource.h
index d75c996bda744..e719dff74fe57 100644
--- a/intl/l10n/FileSource.h
+++ b/intl/l10n/FileSource.h
@@ -20,7 +20,7 @@ namespace mozilla::intl {
 class L10nFileSource : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(L10nFileSource)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(L10nFileSource)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(L10nFileSource)
 
   explicit L10nFileSource(RefPtr<const ffi::FileSource> aRaw,
                           nsIGlobalObject* aGlobal = nullptr);
diff --git a/intl/l10n/FluentBundle.h b/intl/l10n/FluentBundle.h
index 907c8ce99184a..db4087c70b649 100644
--- a/intl/l10n/FluentBundle.h
+++ b/intl/l10n/FluentBundle.h
@@ -37,7 +37,7 @@ using L10nArgs =
 class FluentPattern : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(FluentPattern)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(FluentPattern)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(FluentPattern)
 
   FluentPattern(nsISupports* aParent, const nsACString& aId);
   FluentPattern(nsISupports* aParent, const nsACString& aId,
@@ -58,7 +58,7 @@ class FluentPattern : public nsWrapperCache {
 class FluentBundle final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(FluentBundle)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(FluentBundle)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(FluentBundle)
 
   FluentBundle(nsISupports* aParent, UniquePtr<ffi::FluentBundleRc> aRaw);
 
diff --git a/intl/l10n/FluentResource.h b/intl/l10n/FluentResource.h
index 815d74abf02c5..56e7f8198bbdc 100644
--- a/intl/l10n/FluentResource.h
+++ b/intl/l10n/FluentResource.h
@@ -19,7 +19,7 @@ namespace intl {
 class FluentResource : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(FluentResource)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(FluentResource)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(FluentResource)
 
   FluentResource(nsISupports* aParent, const ffi::FluentResource* aRaw);
   FluentResource(nsISupports* aParent, const nsACString& aSource);
diff --git a/intl/l10n/L10nRegistry.h b/intl/l10n/L10nRegistry.h
index c152009f2d994..91047ec99c91e 100644
--- a/intl/l10n/L10nRegistry.h
+++ b/intl/l10n/L10nRegistry.h
@@ -26,7 +26,7 @@ namespace mozilla::intl {
 class FluentBundleAsyncIterator final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(FluentBundleAsyncIterator)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(FluentBundleAsyncIterator)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(FluentBundleAsyncIterator)
 
   FluentBundleAsyncIterator(
       nsIGlobalObject* aGlobal,
@@ -49,7 +49,7 @@ class FluentBundleAsyncIterator final : public nsWrapperCache {
 class FluentBundleIterator final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(FluentBundleIterator)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(FluentBundleIterator)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(FluentBundleIterator)
 
   FluentBundleIterator(nsIGlobalObject* aGlobal,
                        UniquePtr<ffi::GeckoFluentBundleIterator> aRaw);
@@ -71,7 +71,7 @@ class FluentBundleIterator final : public nsWrapperCache {
 class L10nRegistry final : public nsWrapperCache {
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(L10nRegistry)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(L10nRegistry)
+  NS_DECL_CYCLE_COLLECTION_NATIVE_WRAPPERCACHE_CLASS(L10nRegistry)
 
   L10nRegistry(nsIGlobalObject* aGlobal, bool aUseIsolating);
 
diff --git a/intl/l10n/Localization.h b/intl/l10n/Localization.h
index dc05bff07b5b2..54c78f68dbe77 100644
--- a/intl/l10n/Localization.h
+++ b/intl/l10n/Localization.h
@@ -80,8 +80,8 @@ class Localization : public nsIObserver,
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Localization,
-                                                         nsIObserver)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(Localization,
+                                                        nsIObserver)
   NS_DECL_NSIOBSERVER
 
   static already_AddRefed<Localization> Constructor(
diff --git a/js/loader/ModuleLoadRequest.cpp b/js/loader/ModuleLoadRequest.cpp
index 92aca5048aa00..126f02f39240d 100644
--- a/js/loader/ModuleLoadRequest.cpp
+++ b/js/loader/ModuleLoadRequest.cpp
@@ -23,7 +23,7 @@ namespace JS::loader {
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ModuleLoadRequest)
 NS_INTERFACE_MAP_END_INHERITING(ScriptLoadRequest)
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(ModuleLoadRequest)
+NS_IMPL_CYCLE_COLLECTION_CLASS(ModuleLoadRequest)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(ModuleLoadRequest,
                                                 ScriptLoadRequest)
diff --git a/js/xpconnect/loader/PrecompiledScript.h b/js/xpconnect/loader/PrecompiledScript.h
index c9073711eba28..f9d3d6e2d24b0 100644
--- a/js/xpconnect/loader/PrecompiledScript.h
+++ b/js/xpconnect/loader/PrecompiledScript.h
@@ -26,7 +26,7 @@ namespace mozilla {
 namespace dom {
 class PrecompiledScript : public nsISupports, public nsWrapperCache {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(PrecompiledScript)
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(PrecompiledScript)
 
   explicit PrecompiledScript(nsISupports* aParent, RefPtr<JS::Stencil> aStencil,
                              JS::ReadOnlyCompileOptions& aOptions);
diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp
index a1b79335fe064..52f1e9b5e6c2e 100644
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -105,7 +105,7 @@ using namespace xpc;
 using mozilla::dom::DestroyProtoAndIfaceCache;
 using mozilla::dom::IndexedDatabaseManager;
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(SandboxPrivate)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SandboxPrivate)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(SandboxPrivate)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
@@ -120,8 +120,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(SandboxPrivate)
   tmp->TraverseObjectsInGlobal(cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(SandboxPrivate)
-
 NS_IMPL_CYCLE_COLLECTING_ADDREF(SandboxPrivate)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SandboxPrivate)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SandboxPrivate)
diff --git a/js/xpconnect/src/SandboxPrivate.h b/js/xpconnect/src/SandboxPrivate.h
index b685df6882f5d..be5119d70d4ca 100644
--- a/js/xpconnect/src/SandboxPrivate.h
+++ b/js/xpconnect/src/SandboxPrivate.h
@@ -30,8 +30,8 @@ class SandboxPrivate : public nsIGlobalObject,
                        public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(SandboxPrivate,
-                                                         nsIGlobalObject)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(SandboxPrivate,
+                                                        nsIGlobalObject)
 
   static void Create(nsIPrincipal* principal, JS::Handle<JSObject*> global) {
     RefPtr<SandboxPrivate> sbp = new SandboxPrivate(principal);
diff --git a/layout/style/CSSKeyframeRule.cpp b/layout/style/CSSKeyframeRule.cpp
index 67348c343d66e..ac9087e1c5a28 100644
--- a/layout/style/CSSKeyframeRule.cpp
+++ b/layout/style/CSSKeyframeRule.cpp
@@ -25,8 +25,8 @@ class CSSKeyframeDeclaration : public nsDOMCSSDeclaration {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(CSSKeyframeDeclaration,
-                                                         nsICSSDeclaration)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(CSSKeyframeDeclaration,
+                                                        nsICSSDeclaration)
 
   css::Rule* GetParentRule() final { return mRule; }
 
diff --git a/layout/style/CSSRuleList.h b/layout/style/CSSRuleList.h
index ebf5bec90d2d9..b3802233d03da 100644
--- a/layout/style/CSSRuleList.h
+++ b/layout/style/CSSRuleList.h
@@ -16,7 +16,7 @@ namespace mozilla::dom {
 class CSSRuleList : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CSSRuleList)
 
   virtual StyleSheet* GetParentObject() = 0;
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
diff --git a/layout/style/MediaList.h b/layout/style/MediaList.h
index 674d17485d5d0..046b0b1502fe5 100644
--- a/layout/style/MediaList.h
+++ b/layout/style/MediaList.h
@@ -28,7 +28,7 @@ class Document;
 class MediaList final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaList)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaList)
 
   // Needed for CSSOM, but please don't use it outside of that :)
   explicit MediaList(already_AddRefed<RawServoMediaList> aRawList)
diff --git a/layout/style/Rule.h b/layout/style/Rule.h
index 4bc84121d55f9..fb24a5eaae9d9 100644
--- a/layout/style/Rule.h
+++ b/layout/style/Rule.h
@@ -55,7 +55,7 @@ class Rule : public nsISupports, public nsWrapperCache {
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(Rule)
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS(Rule)
   // Return true if this rule is known to be a cycle collection leaf, in the
   // sense that it doesn't have any outgoing owning edges.
   virtual bool IsCCLeaf() const MOZ_MUST_OVERRIDE;
diff --git a/layout/style/StyleSheet.cpp b/layout/style/StyleSheet.cpp
index 7e62ec6c1bd60..df4d81dc08217 100644
--- a/layout/style/StyleSheet.cpp
+++ b/layout/style/StyleSheet.cpp
@@ -248,7 +248,7 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(StyleSheet)
 // away.  This situation arises easily with sheet preloading.
 NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(StyleSheet, LastRelease())
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(StyleSheet)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(StyleSheet)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(StyleSheet)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMedia)
@@ -269,8 +269,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(StyleSheet)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(StyleSheet)
-
 dom::CSSStyleSheetParsingMode StyleSheet::ParsingModeDOM() {
 #define CHECK_MODE(X, Y)                            \
   static_assert(                                    \
diff --git a/layout/style/StyleSheet.h b/layout/style/StyleSheet.h
index d68f1a0cac336..312238d0899ff 100644
--- a/layout/style/StyleSheet.h
+++ b/layout/style/StyleSheet.h
@@ -102,7 +102,7 @@ class StyleSheet final : public nsICSSLoaderObserver, public nsWrapperCache {
                                                   ErrorResult&);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheet)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(StyleSheet)
 
   already_AddRefed<StyleSheet> CreateEmptyChildSheet(
       already_AddRefed<dom::MediaList> aMediaList) const;
diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp
index ecc09f54eacd5..6e2bdcf92238b 100644
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -364,7 +364,7 @@ nsComputedDOMStyle::~nsComputedDOMStyle() {
              "Should have called ClearComputedStyle() during last release.");
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsComputedDOMStyle)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsComputedDOMStyle)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsComputedDOMStyle)
   tmp->ClearComputedStyle();  // remove observer before clearing mElement
@@ -376,8 +376,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsComputedDOMStyle)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsComputedDOMStyle)
-
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsComputedDOMStyle)
   return tmp->HasKnownLiveWrapper();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h
index 492326129cbaf..16fe0729c49a0 100644
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -66,7 +66,7 @@ class nsComputedDOMStyle final : public nsDOMCSSDeclaration,
 
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_AMBIGUOUS(
       nsComputedDOMStyle, nsICSSDeclaration)
 
   NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER
diff --git a/layout/style/nsDOMCSSAttrDeclaration.h b/layout/style/nsDOMCSSAttrDeclaration.h
index 1db4e019376ff..15a963342b4dd 100644
--- a/layout/style/nsDOMCSSAttrDeclaration.h
+++ b/layout/style/nsDOMCSSAttrDeclaration.h
@@ -36,7 +36,7 @@ class nsDOMCSSAttributeDeclaration final : public nsDOMCSSDeclaration {
   nsDOMCSSAttributeDeclaration(Element* aContent, bool aIsSMILOverride);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(
+  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_WRAPPERCACHE_CLASS_AMBIGUOUS(
       nsDOMCSSAttributeDeclaration, nsICSSDeclaration)
 
   mozilla::DeclarationBlock* GetOrCreateCSSDeclaration(
diff --git a/layout/xul/tree/nsTreeColumns.cpp b/layout/xul/tree/nsTreeColumns.cpp
index baf711c9aa82a..77f63f0394194 100644
--- a/layout/xul/tree/nsTreeColumns.cpp
+++ b/layout/xul/tree/nsTreeColumns.cpp
@@ -36,7 +36,7 @@ nsTreeColumn::~nsTreeColumn() {
   }
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsTreeColumn)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsTreeColumn)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsTreeColumn)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
@@ -50,7 +50,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsTreeColumn)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mContent)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNext)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsTreeColumn)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsTreeColumn)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsTreeColumn)
diff --git a/layout/xul/tree/nsTreeColumns.h b/layout/xul/tree/nsTreeColumns.h
index 2c86fd0428779..9f2d7989db437 100644
--- a/layout/xul/tree/nsTreeColumns.h
+++ b/layout/xul/tree/nsTreeColumns.h
@@ -48,7 +48,7 @@ class nsTreeColumn final : public nsISupports, public nsWrapperCache {
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_TREECOLUMN_IMPL_CID)
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsTreeColumn)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsTreeColumn)
 
   // WebIDL
   nsIContent* GetParentObject() const;
@@ -158,7 +158,7 @@ class nsTreeColumns final : public nsISupports, public nsWrapperCache {
   explicit nsTreeColumns(nsTreeBodyFrame* aTree);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsTreeColumns)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsTreeColumns)
 
   nsIContent* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aCx,
diff --git a/layout/xul/tree/nsTreeContentView.h b/layout/xul/tree/nsTreeContentView.h
index 30716e6922f3c..8138ab44fc32d 100644
--- a/layout/xul/tree/nsTreeContentView.h
+++ b/layout/xul/tree/nsTreeContentView.h
@@ -42,8 +42,8 @@ class nsTreeContentView final : public nsITreeView,
   nsTreeContentView(void);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsTreeContentView,
-                                                         nsITreeView)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_AMBIGUOUS(nsTreeContentView,
+                                                        nsITreeView)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
diff --git a/storage/mozStorageAsyncStatementParams.h b/storage/mozStorageAsyncStatementParams.h
index 4c6f97052c87a..c72afc2bc3be5 100644
--- a/storage/mozStorageAsyncStatementParams.h
+++ b/storage/mozStorageAsyncStatementParams.h
@@ -21,7 +21,7 @@ class AsyncStatement;
 class AsyncStatementParams final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AsyncStatementParams)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(AsyncStatementParams)
 
   explicit AsyncStatementParams(nsPIDOMWindowInner* aWindow,
                                 AsyncStatement* aStatement);
diff --git a/storage/mozStorageStatementParams.h b/storage/mozStorageStatementParams.h
index 647e111b42ec5..6164f9854e7ed 100644
--- a/storage/mozStorageStatementParams.h
+++ b/storage/mozStorageStatementParams.h
@@ -21,7 +21,7 @@ class Statement;
 class StatementParams final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StatementParams)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(StatementParams)
 
   explicit StatementParams(nsPIDOMWindowInner* aWindow, Statement* aStatement);
 
diff --git a/storage/mozStorageStatementRow.h b/storage/mozStorageStatementRow.h
index 02c43749c630d..319645638d658 100644
--- a/storage/mozStorageStatementRow.h
+++ b/storage/mozStorageStatementRow.h
@@ -21,7 +21,7 @@ class Statement;
 class StatementRow final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StatementRow)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(StatementRow)
 
   explicit StatementRow(nsPIDOMWindowInner* aWindow, Statement* aStatement);
 
diff --git a/toolkit/components/extensions/DocumentObserver.h b/toolkit/components/extensions/DocumentObserver.h
index 3ed2b5c203c73..b9b0dc6f78342 100644
--- a/toolkit/components/extensions/DocumentObserver.h
+++ b/toolkit/components/extensions/DocumentObserver.h
@@ -19,7 +19,7 @@ namespace extensions {
 
 class DocumentObserver final : public nsISupports, public nsWrapperCache {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DocumentObserver)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DocumentObserver)
 
   static already_AddRefed<DocumentObserver> Constructor(
       dom::GlobalObject& aGlobal, dom::MozDocumentCallback& aCallbacks);
diff --git a/toolkit/components/extensions/MatchPattern.h b/toolkit/components/extensions/MatchPattern.h
index 1aa28242df826..f0ba13b141e04 100644
--- a/toolkit/components/extensions/MatchPattern.h
+++ b/toolkit/components/extensions/MatchPattern.h
@@ -191,7 +191,7 @@ class MOZ_STACK_CLASS CookieInfo final {
 
 class MatchPattern final : public nsISupports, public nsWrapperCache {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MatchPattern)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MatchPattern)
 
   static already_AddRefed<MatchPattern> Constructor(
       dom::GlobalObject& aGlobal, const nsAString& aPattern,
@@ -265,7 +265,7 @@ class MatchPattern final : public nsISupports, public nsWrapperCache {
 
 class MatchPatternSet final : public nsISupports, public nsWrapperCache {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MatchPatternSet)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MatchPatternSet)
 
   using ArrayType = nsTArray<RefPtr<MatchPattern>>;
 
diff --git a/toolkit/components/extensions/WebExtensionContentScript.h b/toolkit/components/extensions/WebExtensionContentScript.h
index 046d141020e6b..3205be1292bd3 100644
--- a/toolkit/components/extensions/WebExtensionContentScript.h
+++ b/toolkit/components/extensions/WebExtensionContentScript.h
@@ -104,7 +104,7 @@ class MOZ_STACK_CLASS DocInfo final {
 
 class MozDocumentMatcher : public nsISupports, public nsWrapperCache {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MozDocumentMatcher)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MozDocumentMatcher)
 
   using MatchGlobArray = nsTArray<RefPtr<MatchGlob>>;
 
diff --git a/toolkit/components/extensions/WebExtensionPolicy.h b/toolkit/components/extensions/WebExtensionPolicy.h
index bb34d048614be..07cbd0d03c380 100644
--- a/toolkit/components/extensions/WebExtensionPolicy.h
+++ b/toolkit/components/extensions/WebExtensionPolicy.h
@@ -67,7 +67,7 @@ class WebExtensionPolicy final : public nsISupports,
                                  public SupportsWeakPtr {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WebExtensionPolicy)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(WebExtensionPolicy)
 
   using ScriptArray = nsTArray<RefPtr<WebExtensionContentScript>>;
 
diff --git a/toolkit/components/extensions/webidl-api/ExtensionAlarms.h b/toolkit/components/extensions/webidl-api/ExtensionAlarms.h
index f0efd734417ed..19681a5706312 100644
--- a/toolkit/components/extensions/webidl-api/ExtensionAlarms.h
+++ b/toolkit/components/extensions/webidl-api/ExtensionAlarms.h
@@ -60,7 +60,7 @@ class ExtensionAlarms final : public nsISupports,
   ExtensionEventManager* OnAlarm();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ExtensionAlarms)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ExtensionAlarms)
 };
 
 }  // namespace extensions
diff --git a/toolkit/components/extensions/webidl-api/ExtensionMockAPI.h b/toolkit/components/extensions/webidl-api/ExtensionMockAPI.h
index cb138ffe40cd6..c203c2755a1a1 100644
--- a/toolkit/components/extensions/webidl-api/ExtensionMockAPI.h
+++ b/toolkit/components/extensions/webidl-api/ExtensionMockAPI.h
@@ -68,7 +68,7 @@ class ExtensionMockAPI final : public nsISupports,
   ExtensionEventManager* OnTestEvent();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ExtensionMockAPI)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ExtensionMockAPI)
 };
 
 }  // namespace extensions
diff --git a/toolkit/components/extensions/webidl-api/ExtensionPort.cpp b/toolkit/components/extensions/webidl-api/ExtensionPort.cpp
index ebefd5fc77a34..481e15387c0ef 100644
--- a/toolkit/components/extensions/webidl-api/ExtensionPort.cpp
+++ b/toolkit/components/extensions/webidl-api/ExtensionPort.cpp
@@ -17,7 +17,7 @@ namespace extensions {
 NS_IMPL_CYCLE_COLLECTING_ADDREF(ExtensionPort);
 NS_IMPL_CYCLE_COLLECTING_RELEASE(ExtensionPort)
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(ExtensionPort)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ExtensionPort)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ExtensionPort)
   // Clean the entry for this instance from the ports lookup map
@@ -34,8 +34,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ExtensionPort)
                                     mOnMessageEventMgr)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(ExtensionPort)
-
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ExtensionPort)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
diff --git a/toolkit/components/extensions/webidl-api/ExtensionPort.h b/toolkit/components/extensions/webidl-api/ExtensionPort.h
index d50ad6a8b1f10..251c4b9aaabd3 100644
--- a/toolkit/components/extensions/webidl-api/ExtensionPort.h
+++ b/toolkit/components/extensions/webidl-api/ExtensionPort.h
@@ -84,7 +84,7 @@ class ExtensionPort final : public nsISupports,
   };
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ExtensionPort)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ExtensionPort)
 };
 
 }  // namespace extensions
diff --git a/toolkit/components/extensions/webidl-api/ExtensionRuntime.h b/toolkit/components/extensions/webidl-api/ExtensionRuntime.h
index ef668c5ea3e11..b38947317bb3c 100644
--- a/toolkit/components/extensions/webidl-api/ExtensionRuntime.h
+++ b/toolkit/components/extensions/webidl-api/ExtensionRuntime.h
@@ -75,7 +75,7 @@ class ExtensionRuntime final : public nsISupports,
   void GetId(DOMString& aRetval);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ExtensionRuntime)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ExtensionRuntime)
 };
 
 }  // namespace extensions
diff --git a/toolkit/components/extensions/webidl-api/ExtensionTest.h b/toolkit/components/extensions/webidl-api/ExtensionTest.h
index aed0d6ff0a6bf..917ed2603be14 100644
--- a/toolkit/components/extensions/webidl-api/ExtensionTest.h
+++ b/toolkit/components/extensions/webidl-api/ExtensionTest.h
@@ -92,7 +92,7 @@ class ExtensionTest final : public nsISupports,
   ExtensionEventManager* OnMessage();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ExtensionTest)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ExtensionTest)
 };
 
 }  // namespace extensions
diff --git a/toolkit/components/extensions/webrequest/ChannelWrapper.cpp b/toolkit/components/extensions/webrequest/ChannelWrapper.cpp
index 2bddf9eea521f..61d795ada0cba 100644
--- a/toolkit/components/extensions/webrequest/ChannelWrapper.cpp
+++ b/toolkit/components/extensions/webrequest/ChannelWrapper.cpp
@@ -1240,10 +1240,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(ChannelWrapper,
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStub)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(ChannelWrapper,
-                                               DOMEventTargetHelper)
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
 NS_IMPL_ADDREF_INHERITED(ChannelWrapper, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(ChannelWrapper, DOMEventTargetHelper)
 
diff --git a/toolkit/components/extensions/webrequest/ChannelWrapper.h b/toolkit/components/extensions/webrequest/ChannelWrapper.h
index c39dc076f3656..235ee54d64495 100644
--- a/toolkit/components/extensions/webrequest/ChannelWrapper.h
+++ b/toolkit/components/extensions/webrequest/ChannelWrapper.h
@@ -116,8 +116,7 @@ class ChannelWrapper final : public DOMEventTargetHelper,
                              private detail::ChannelHolder {
  public:
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(ChannelWrapper,
-                                                         DOMEventTargetHelper)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ChannelWrapper, DOMEventTargetHelper)
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_CHANNELWRAPPER_IID)
 
diff --git a/toolkit/components/glean/bindings/Category.h b/toolkit/components/glean/bindings/Category.h
index 55c7e2d30be2b..47cdef4a1a9d0 100644
--- a/toolkit/components/glean/bindings/Category.h
+++ b/toolkit/components/glean/bindings/Category.h
@@ -17,7 +17,7 @@ namespace mozilla::glean {
 class Category final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Category)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Category)
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/toolkit/components/glean/bindings/Glean.h b/toolkit/components/glean/bindings/Glean.h
index 83e0fa9edac15..54d300d682f35 100644
--- a/toolkit/components/glean/bindings/Glean.h
+++ b/toolkit/components/glean/bindings/Glean.h
@@ -19,7 +19,7 @@ class Category;
 class Glean final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Glean)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Glean)
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/toolkit/components/glean/bindings/GleanPings.h b/toolkit/components/glean/bindings/GleanPings.h
index 55eb1c4c9b860..2dd1ff4b83c32 100644
--- a/toolkit/components/glean/bindings/GleanPings.h
+++ b/toolkit/components/glean/bindings/GleanPings.h
@@ -17,7 +17,7 @@ namespace mozilla::glean {
 class GleanPings final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GleanPings)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GleanPings)
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/toolkit/components/glean/bindings/private/Labeled.h b/toolkit/components/glean/bindings/private/Labeled.h
index 474c9978a21e7..be46b3b56eab0 100644
--- a/toolkit/components/glean/bindings/private/Labeled.h
+++ b/toolkit/components/glean/bindings/private/Labeled.h
@@ -49,7 +49,7 @@ class Labeled {
 class GleanLabeled final : public nsISupports, public nsWrapperCache {
  public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GleanLabeled)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GleanLabeled)
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/toolkit/components/sessionstore/SessionStoreFormData.h b/toolkit/components/sessionstore/SessionStoreFormData.h
index 029130a999fd6..fd9f925fcc8db 100644
--- a/toolkit/components/sessionstore/SessionStoreFormData.h
+++ b/toolkit/components/sessionstore/SessionStoreFormData.h
@@ -36,7 +36,7 @@ class SessionStoreFormData final : public nsISupports,
   using ChildrenArray = nsTArray<RefPtr<SessionStoreFormData>>;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SessionStoreFormData)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SessionStoreFormData)
   nsISupports* GetParentObject() const;
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/toolkit/components/sessionstore/SessionStoreScrollData.h b/toolkit/components/sessionstore/SessionStoreScrollData.h
index fbdf82954d665..22dd7e19e5aad 100644
--- a/toolkit/components/sessionstore/SessionStoreScrollData.h
+++ b/toolkit/components/sessionstore/SessionStoreScrollData.h
@@ -28,7 +28,7 @@ class SessionStoreScrollData final : public nsISupports,
   using ChildrenArray = nsTArray<RefPtr<SessionStoreScrollData>>;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SessionStoreScrollData)
+  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SessionStoreScrollData)
   nsISupports* GetParentObject() const;
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
diff --git a/xpcom/base/CycleCollectedJSRuntime.cpp b/xpcom/base/CycleCollectedJSRuntime.cpp
index 5f9318fbd082b..d21fd2152429b 100644
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -604,7 +604,7 @@ void JSHolderMap::Put(void* aHolder, nsScriptObjectTracer* aTracer,
   MOZ_ASSERT(aTracer);
 
   // Don't associate multi-zone holders with a zone, even if one is supplied.
-  if (aTracer->IsMultiZoneJSHolder()) {
+  if (!aTracer->IsSingleZoneJSHolder()) {
     aZone = nullptr;
   }
 
@@ -1317,14 +1317,8 @@ struct CheckZoneTracer : public TraceCallbacks {
     // Additionally, pointers from any holder into the atoms zone are allowed
     // since all holders are traced when we collect the atoms zone.
     //
-    // If you added a holder that has pointers into multiple zones please try to
-    // remedy this. Some options are:
-    //
-    //  - wrap all JS GC things into the same compartment
-    //  - split GC thing pointers between separate cycle collected objects
-    //
-    // If all else fails, flag the class as containing pointers into multiple
-    // zones by using NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS.
+    // If you added a holder that has pointers into multiple zones do not
+    // use NS_IMPL_CYCLE_COLLECTION_SINGLE_ZONE_SCRIPT_HOLDER_CLASS.
     MOZ_CRASH_UNSAFE_PRINTF(
         "JS holder %s contains pointers to GC things in more than one zone ("
         "found in %s)\n",
@@ -1453,7 +1447,7 @@ bool CycleCollectedJSRuntime::TraceJSHolders(JSTracer* aTracer,
     nsScriptObjectTracer* tracer = aIter->mTracer;
 
 #ifdef CHECK_SINGLE_ZONE_JS_HOLDERS
-    if (checkSingleZoneHolders && !tracer->IsMultiZoneJSHolder()) {
+    if (checkSingleZoneHolders && tracer->IsSingleZoneJSHolder()) {
       CheckHolderIsSingleZone(holder, tracer, aIter.Zone());
     }
 #else
diff --git a/xpcom/base/nsCycleCollectionParticipant.h b/xpcom/base/nsCycleCollectionParticipant.h
index fc813e5fcd2cd..1dcafb470de33 100644
--- a/xpcom/base/nsCycleCollectionParticipant.h
+++ b/xpcom/base/nsCycleCollectionParticipant.h
@@ -206,9 +206,14 @@ class NS_NO_VTABLE nsCycleCollectionParticipant {
   using Flags = uint8_t;
   static constexpr Flags FlagMightSkip = 1u << 0;
   static constexpr Flags FlagTraverseShouldTrace = 1u << 1;
-  static constexpr Flags FlagMultiZoneJSHolder = 1u << 2;
-  static constexpr Flags AllFlags =
-      FlagMightSkip | FlagTraverseShouldTrace | FlagMultiZoneJSHolder;
+  // The object is a single zone js holder if FlagMaybeSingleZoneJSHolder is set
+  // and FlagMultiZoneJSHolder isn't set. This setup is needed so that
+  // inheriting classes can unset single zone behavior.
+  static constexpr Flags FlagMaybeSingleZoneJSHolder = 1u << 2;
+  static constexpr Flags FlagMultiZoneJSHolder = 1u << 3;
+  static constexpr Flags AllFlags = FlagMightSkip | FlagTraverseShouldTrace |
+                                    FlagMaybeSingleZoneJSHolder |
+                                    FlagMultiZoneJSHolder;
 
   constexpr explicit nsCycleCollectionParticipant(Flags aFlags)
       : mFlags(aFlags) {
@@ -309,7 +314,10 @@ class NS_NO_VTABLE nsCycleCollectionParticipant {
 
   NS_IMETHOD_(void) DeleteCycleCollectable(void* aPtr) = 0;
 
-  bool IsMultiZoneJSHolder() const { return mFlags & FlagMultiZoneJSHolder; }
+  bool IsSingleZoneJSHolder() const {
+    return (mFlags & FlagMaybeSingleZoneJSHolder) &&
+           !(mFlags & FlagMultiZoneJSHolder);
+  }
 
  protected:
   NS_IMETHOD_(bool) CanSkipReal(void* aPtr, bool aRemovingAllowed) {
@@ -782,7 +790,8 @@ T* DowncastCCParticipant(void* aPtr) {
       : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) {                    \
    public:                                                                     \
     constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(                         \
-        Flags aFlags = FlagMightSkip) /* We always want skippability. */       \
+        Flags aFlags = FlagMightSkip | /* We always want skippability. */      \
+                       FlagMultiZoneJSHolder)                                  \
         : NS_CYCLE_COLLECTION_CLASSNAME(_base_class)(aFlags | FlagMightSkip) { \
     }                                                                          \
                                                                                \
@@ -826,21 +835,22 @@ T* DowncastCCParticipant(void* aPtr) {
   NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)                 \
   static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
 
-#define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(_class,      \
-                                                               _base_class) \
-  class NS_CYCLE_COLLECTION_INNERCLASS                                      \
-      : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) {                 \
-   public:                                                                  \
-    constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags = 0)     \
-        : NS_CYCLE_COLLECTION_CLASSNAME(_base_class)(aFlags) {}             \
-                                                                            \
-   private:                                                                 \
-    NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class)      \
-    NS_IMETHOD_(void)                                                       \
-    Trace(void* p, const TraceCallbacks& cb, void* closure) override;       \
-    NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                  \
-  };                                                                        \
-  NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)                     \
+#define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(_class,         \
+                                                               _base_class)    \
+  class NS_CYCLE_COLLECTION_INNERCLASS                                         \
+      : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) {                    \
+   public:                                                                     \
+    constexpr explicit NS_CYCLE_COLLECTION_INNERCLASS(Flags aFlags = 0)        \
+        : NS_CYCLE_COLLECTION_CLASSNAME(_base_class)(aFlags |                  \
+                                                     FlagMultiZoneJSHolder) {} \
+                                                                               \
+   private:                                                                    \
+    NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class)         \
+    NS_IMETHOD_(void)                                                          \
+    Trace(void* p, const TraceCallbacks& cb, void* closure) override;          \
+    NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                     \
+  };                                                                           \
+  NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)                        \
   static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
 
 // Cycle collector participant declarations.
@@ -947,13 +957,12 @@ T* DowncastCCParticipant(void* aPtr) {
 #define NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
   _class::NS_CYCLE_COLLECTION_INNERCLASS _class::NS_CYCLE_COLLECTION_INNERNAME;
 
-// Most JS holder classes should only contain pointers to JS GC things in a
-// single JS zone (excluding pointers into the atoms zone), but there are some
-// exceptions. Such classes should use this macro to tell the system about this.
-#define NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(_class) \
-  _class::NS_CYCLE_COLLECTION_INNERCLASS                           \
-      _class::NS_CYCLE_COLLECTION_INNERNAME(                       \
-          nsCycleCollectionParticipant::FlagMultiZoneJSHolder);
+// By default JS holders are treated as if they may store pointers to multiple
+// zones, but one may optimize GC handling by using single zone holders.
+#define NS_IMPL_CYCLE_COLLECTION_SINGLE_ZONE_SCRIPT_HOLDER_CLASS(_class) \
+  _class::NS_CYCLE_COLLECTION_INNERCLASS                                 \
+      _class::NS_CYCLE_COLLECTION_INNERNAME(                             \
+          nsCycleCollectionParticipant::FlagMaybeSingleZoneJSHolder);
 
 // NB: This is not something you usually want to use.  It is here to allow
 // adding things to the CC graph to help debugging via CC logs, but it does not
@@ -1048,6 +1057,7 @@ inline void ImplCycleCollectionUnlink(JS::Heap<T*>& aField) {
 }
 
 #define NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBERS(...)                \
+  MOZ_ASSERT(!IsSingleZoneJSHolder());                                \
   MOZ_FOR_EACH(NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK, (), \
                (__VA_ARGS__))
 
diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp
index 980b7d42addc5..b79e93cb4b892 100644
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -2350,7 +2350,7 @@ class JSPurpleBuffer {
   SegmentedVector<JSObject*, kSegmentSize, InfallibleAllocPolicy> mObjects;
 };
 
-NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(JSPurpleBuffer)
+NS_IMPL_CYCLE_COLLECTION_CLASS(JSPurpleBuffer)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(JSPurpleBuffer)
   tmp->Destroy();
diff --git a/xpcom/tests/gtest/TestJSHolderMap.cpp b/xpcom/tests/gtest/TestJSHolderMap.cpp
index 247a63d3b700d..20e99b05eeaf2 100644
--- a/xpcom/tests/gtest/TestJSHolderMap.cpp
+++ b/xpcom/tests/gtest/TestJSHolderMap.cpp
@@ -43,7 +43,8 @@ class MyHolder final : public nsScriptObjectTracer {
 
  private:
   Flags FlagsForKind(HolderKind kind) {
-    return kind == MultiZone ? FlagMultiZoneJSHolder : 0;
+    return kind == MultiZone ? FlagMultiZoneJSHolder
+                             : FlagMaybeSingleZoneJSHolder;
   }
 };
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits