Use a HashSet<WeakRef<LocalFrame>> for Page::m_rootFrames instead of a WeakHashSet<LocalFrame>. This map is used in a hot code path and using a WeakHashSet is unnecessarily inefficient.
Pull request: https://github.com/WebKit/WebKit/pull/18713
Committed 268974@main (86924d729527): <https://commits.webkit.org/268974@main> Reviewed commits have been landed. Closing PR #18713 and removing active labels.
<rdar://problem/116565539>
I think this change broke Debug builds, at least on my system (arm64, macOS 13.5.1, Xcode 14.3). All tests crash here: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 JavaScriptCore 0x13730c204 WTFCrash + 20 (Assertions.cpp:333) 1 WebCore 0x282ac42b0 WTFCrashWithInfo(int, char const*, char const*, int) + 32 (Assertions.h:778) 2 WebCore 0x28480a570 WebCore::Page::removeRootFrame(WebCore::LocalFrame&) + 268 (Page.cpp:4510) 3 WebCore 0x2847747cc WebCore::LocalFrame::LocalFrame(WebCore::Page&, WTF::UniqueRef<WebCore::LocalFrameLoaderClient>&&, WebCore::ProcessQualified<WTF::ObjectIdentifierGeneric<WebCore::FrameIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits>>, WebCore::HTMLFrameOwnerElement*, WebCore::Frame*) + 504 (LocalFrame.cpp:174) ... If I revert the change locally, no more crash.
Re-opened since this is blocked by bug 262778
Pull request: https://github.com/WebKit/WebKit/pull/18762
Committed 269009@main (75d236ee7095): <https://commits.webkit.org/269009@main> Reviewed commits have been landed. Closing PR #18762 and removing active labels.