Title: [291963] trunk/Source/WebCore
Revision
291963
Author
cdu...@apple.com
Date
2022-03-28 07:14:09 -0700 (Mon, 28 Mar 2022)

Log Message

Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp
https://bugs.webkit.org/show_bug.cgi?id=238422

Reviewed by Peng Liu.

Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp and inline its implementation in the only caller instead.

* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
(WebCore::isReachableFromDOM): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291962 => 291963)


--- trunk/Source/WebCore/ChangeLog	2022-03-28 12:08:56 UTC (rev 291962)
+++ trunk/Source/WebCore/ChangeLog	2022-03-28 14:14:09 UTC (rev 291963)
@@ -1,3 +1,16 @@
+2022-03-28  Chris Dumez  <cdu...@apple.com>
+
+        Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=238422
+
+        Reviewed by Peng Liu.
+
+        Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp and inline its implementation in the only caller instead.
+
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
+        (WebCore::isReachableFromDOM): Deleted.
+
 2022-03-28  Ziran Sun  <z...@igalia.com>
 
         [Forms] Alias appearance <compat-auto> keywords to 'auto' for button

Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp (291962 => 291963)


--- trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp	2022-03-28 12:08:56 UTC (rev 291962)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp	2022-03-28 14:14:09 UTC (rev 291963)
@@ -64,17 +64,18 @@
 using namespace JSC;
 using namespace HTMLNames;
 
-static inline bool isReachableFromDOM(Node* node, AbstractSlotVisitor& visitor, const char** reason)
+bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, AbstractSlotVisitor& visitor, const char** reason)
 {
-    if (!node->isConnected()) {
+    auto& node = jsCast<JSNode*>(handle.slot()->asCell())->wrapped();
+    if (!node.isConnected()) {
         // If a node is firing event listeners, its wrapper is observable because
         // its wrapper is responsible for marking those event listeners.
-        if (node->isFiringEventListeners()) {
+        if (node.isFiringEventListeners()) {
             if (UNLIKELY(reason))
                 *reason = "Node which is firing event listeners";
             return true;
         }
-        if (GCReachableRefMap::contains(*node)) {
+        if (GCReachableRefMap::contains(node)) {
             if (UNLIKELY(reason))
                 *reason = "Node is scheduled to be used in an async script invocation)";
             return true;
@@ -87,12 +88,6 @@
     return visitor.containsOpaqueRoot(root(node));
 }
 
-bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, AbstractSlotVisitor& visitor, const char** reason)
-{
-    JSNode* jsNode = jsCast<JSNode*>(handle.slot()->asCell());
-    return isReachableFromDOM(&jsNode->wrapped(), visitor, reason);
-}
-
 JSScope* JSNode::pushEventHandlerScope(JSGlobalObject* lexicalGlobalObject, JSScope* node) const
 {
     if (inherits<JSHTMLElement>(lexicalGlobalObject->vm()))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to