Title: [217642] trunk/Source/WebCore
Revision
217642
Author
[email protected]
Date
2017-05-31 17:12:51 -0700 (Wed, 31 May 2017)

Log Message

CodeGeneratorJS's InstanceNeedsVisitChildren should not return true just because a class is / extends EventTarget.
https://bugs.webkit.org/show_bug.cgi?id=172782
<rdar://problem/32498266>

Reviewed by Chris Dumez.

No new tests needed.  This change is covered by existing binding tests.

InstanceNeedsVisitChildren should also not check the IsJSBuiltinConstructor
condition, which is not used to emit any additional code in the visitChildren
override.

The other conditions for generating visitChildren() are adequate if the class
needs to override visitChildren.  Currently, we're generating some visitChildren()
methods that only call its Base::visitChildren().  Removing the "is / extends
EventTarget" conditions removes those unneeded visitChildren overrides.

* bindings/scripts/CodeGeneratorJS.pm:
(InstanceNeedsVisitChildren):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructor::visitChildren): Deleted.
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJIT::visitChildren): Deleted.
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::visitChildren): Deleted.
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructor::visitChildren): Deleted.
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNode::visitChildren): Deleted.
* bindings/scripts/test/JS/JSTestNode.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (217641 => 217642)


--- trunk/Source/WebCore/ChangeLog	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/ChangeLog	2017-06-01 00:12:51 UTC (rev 217642)
@@ -1,3 +1,40 @@
+2017-05-31  Mark Lam  <[email protected]>
+
+        CodeGeneratorJS's InstanceNeedsVisitChildren should not return true just because a class is / extends EventTarget.
+        https://bugs.webkit.org/show_bug.cgi?id=172782
+        <rdar://problem/32498266>
+
+        Reviewed by Chris Dumez.
+
+        No new tests needed.  This change is covered by existing binding tests.
+
+        InstanceNeedsVisitChildren should also not check the IsJSBuiltinConstructor
+        condition, which is not used to emit any additional code in the visitChildren
+        override.
+
+        The other conditions for generating visitChildren() are adequate if the class
+        needs to override visitChildren.  Currently, we're generating some visitChildren()
+        methods that only call its Base::visitChildren().  Removing the "is / extends
+        EventTarget" conditions removes those unneeded visitChildren overrides.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (InstanceNeedsVisitChildren):
+        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
+        (WebCore::JSTestClassWithJSBuiltinConstructor::visitChildren): Deleted.
+        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
+        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
+        (WebCore::JSTestDOMJIT::visitChildren): Deleted.
+        * bindings/scripts/test/JS/JSTestDOMJIT.h:
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        (WebCore::JSTestEventTarget::visitChildren): Deleted.
+        * bindings/scripts/test/JS/JSTestEventTarget.h:
+        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
+        (WebCore::JSTestJSBuiltinConstructor::visitChildren): Deleted.
+        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
+        * bindings/scripts/test/JS/JSTestNode.cpp:
+        (WebCore::JSTestNode::visitChildren): Deleted.
+        * bindings/scripts/test/JS/JSTestNode.h:
+
 2017-05-31  Chris Dumez  <[email protected]>
 
         Make QualifiedName cache per thread

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2017-06-01 00:12:51 UTC (rev 217642)
@@ -1358,10 +1358,7 @@
     }
 
     return 1 if $interface->extendedAttributes->{JSCustomMarkFunction};
-    return 1 if $codeGenerator->InheritsInterface($interface, "EventTarget");
-    return 1 if $interface->type->name eq "EventTarget";
     return 1 if $interface->extendedAttributes->{ReportExtraMemoryCost};
-    return 1 if IsJSBuiltinConstructor($interface);
     return 0;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp	2017-06-01 00:12:51 UTC (rev 217642)
@@ -158,13 +158,6 @@
     return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
 }
 
-void JSTestClassWithJSBuiltinConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
-    auto* thisObject = jsCast<JSTestClassWithJSBuiltinConstructor*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, visitor);
-}
-
 bool JSTestClassWithJSBuiltinConstructorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
     UNUSED_PARAM(handle);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h	2017-06-01 00:12:51 UTC (rev 217642)
@@ -49,8 +49,6 @@
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
-    static void visitChildren(JSCell*, JSC::SlotVisitor&);
-
 protected:
     JSTestClassWithJSBuiltinConstructor(JSC::Structure*, JSDOMGlobalObject&, Ref<TestClassWithJSBuiltinConstructor>&&);
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp	2017-06-01 00:12:51 UTC (rev 217642)
@@ -1286,12 +1286,5 @@
     return JSValue::encode(toJS<IDLInterface<NodeList>>(*state, *castedThis->globalObject(), impl.getElementsByName(WTFMove(elementName))));
 }
 
-void JSTestDOMJIT::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
-    auto* thisObject = jsCast<JSTestDOMJIT*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, visitor);
-}
 
-
 }

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h	2017-06-01 00:12:51 UTC (rev 217642)
@@ -48,8 +48,6 @@
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
-    static void visitChildren(JSCell*, JSC::SlotVisitor&);
-
     TestDOMJIT& wrapped() const
     {
         return static_cast<TestDOMJIT&>(Base::wrapped());

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp	2017-06-01 00:12:51 UTC (rev 217642)
@@ -223,13 +223,6 @@
     return IDLOperation<JSTestEventTarget>::call<jsTestEventTargetPrototypeFunctionItemBody>(*state, "item");
 }
 
-void JSTestEventTarget::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
-    auto* thisObject = jsCast<JSTestEventTarget*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, visitor);
-}
-
 #if ENABLE(BINDING_INTEGRITY)
 #if PLATFORM(WIN)
 #pragma warning(disable: 4483)

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h	2017-06-01 00:12:51 UTC (rev 217642)
@@ -52,8 +52,6 @@
 
     static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
-    static void visitChildren(JSCell*, JSC::SlotVisitor&);
-
     TestEventTarget& wrapped() const
     {
         return static_cast<TestEventTarget&>(Base::wrapped());

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp	2017-06-01 00:12:51 UTC (rev 217642)
@@ -229,12 +229,5 @@
     return IDLOperation<JSTestJSBuiltinConstructor>::call<jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunctionBody>(*state, "testCustomFunction");
 }
 
-void JSTestJSBuiltinConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
-    auto* thisObject = jsCast<JSTestJSBuiltinConstructor*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, visitor);
-}
 
-
 }

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h	2017-06-01 00:12:51 UTC (rev 217642)
@@ -46,9 +46,7 @@
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
-    static void visitChildren(JSCell*, JSC::SlotVisitor&);
 
-
     // Custom attributes
     JSC::JSValue testAttributeCustom(JSC::ExecState&) const;
     JSC::JSValue testAttributeRWCustom(JSC::ExecState&) const;

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp	2017-06-01 00:12:51 UTC (rev 217642)
@@ -335,13 +335,6 @@
     return IDLOperation<JSTestNode>::call<jsTestNodePrototypeFunctionToJSONBody>(*state, "toJSON");
 }
 
-void JSTestNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
-    auto* thisObject = jsCast<JSTestNode*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, visitor);
-}
-
 #if ENABLE(BINDING_INTEGRITY)
 #if PLATFORM(WIN)
 #pragma warning(disable: 4483)

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h (217641 => 217642)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h	2017-06-01 00:01:38 UTC (rev 217641)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h	2017-06-01 00:12:51 UTC (rev 217642)
@@ -48,8 +48,6 @@
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
     static JSC::JSObject* serialize(JSC::ExecState*, JSTestNode* thisObject, JSC::ThrowScope&);
-    static void visitChildren(JSCell*, JSC::SlotVisitor&);
-
     TestNode& wrapped() const
     {
         return static_cast<TestNode&>(Base::wrapped());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to