Title: [136482] trunk/Source/WebCore
Revision
136482
Author
[email protected]
Date
2012-12-04 00:06:30 -0800 (Tue, 04 Dec 2012)

Log Message

[JSC] Generate visitChildren() for uncustomized EventTarget interfaces
https://bugs.webkit.org/show_bug.cgi?id=103908

Patch by Michael Pruett <[email protected]> on 2012-12-04
Reviewed by Geoffrey Garen.

CodeGeneratorJS.pm should automatically generate visitChildren()
for EventTarget interfaces without custom mark functions even if
those interfaces have no functions or cached attributes.

This change is needed for IDBOpenDBRequest and IDBVersionChangeRequest.

No new tests. Covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136481 => 136482)


--- trunk/Source/WebCore/ChangeLog	2012-12-04 08:04:26 UTC (rev 136481)
+++ trunk/Source/WebCore/ChangeLog	2012-12-04 08:06:30 UTC (rev 136482)
@@ -1,3 +1,21 @@
+2012-12-04  Michael Pruett  <[email protected]>
+
+        [JSC] Generate visitChildren() for uncustomized EventTarget interfaces
+        https://bugs.webkit.org/show_bug.cgi?id=103908
+
+        Reviewed by Geoffrey Garen.
+
+        CodeGeneratorJS.pm should automatically generate visitChildren()
+        for EventTarget interfaces without custom mark functions even if
+        those interfaces have no functions or cached attributes.
+
+        This change is needed for IDBOpenDBRequest and IDBVersionChangeRequest.
+
+        No new tests. Covered by existing tests.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+
 2012-12-04  Kentaro Hara  <[email protected]>
 
         Change ChildNodeInsertionNotifier::m_postInsertionsNotificationTargets from a Vector to an OwnPtr

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (136481 => 136482)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-12-04 08:04:26 UTC (rev 136481)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-12-04 08:06:30 UTC (rev 136482)
@@ -2355,28 +2355,26 @@
         }
     }
 
-    if ($numFunctions > 0 || $numCachedAttributes > 0) {
-        if ($needsMarkChildren && !$interface->extendedAttributes->{"JSCustomMarkFunction"}) {
-            push(@implContent, "void ${className}::visitChildren(JSCell* cell, SlotVisitor& visitor)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
-            push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
-            push(@implContent, "    COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);\n");
-            push(@implContent, "    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());\n");
-            push(@implContent, "    Base::visitChildren(thisObject, visitor);\n");
-            if ($interface->extendedAttributes->{"EventTarget"} || $interface->name eq "EventTarget") {
-                push(@implContent, "    thisObject->impl()->visitJSEventListeners(visitor);\n");
-            }
-            if ($numCachedAttributes > 0) {
-                foreach (@{$interface->attributes}) {
-                    my $attribute = $_;
-                    if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
-                        push(@implContent, "    visitor.append(&thisObject->m_" . $attribute->signature->name . ");\n");
-                    }
+    if ($needsMarkChildren && !$interface->extendedAttributes->{"JSCustomMarkFunction"}) {
+        push(@implContent, "void ${className}::visitChildren(JSCell* cell, SlotVisitor& visitor)\n");
+        push(@implContent, "{\n");
+        push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
+        push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
+        push(@implContent, "    COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);\n");
+        push(@implContent, "    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());\n");
+        push(@implContent, "    Base::visitChildren(thisObject, visitor);\n");
+        if ($interface->extendedAttributes->{"EventTarget"} || $interface->name eq "EventTarget") {
+            push(@implContent, "    thisObject->impl()->visitJSEventListeners(visitor);\n");
+        }
+        if ($numCachedAttributes > 0) {
+            foreach (@{$interface->attributes}) {
+                my $attribute = $_;
+                if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
+                    push(@implContent, "    visitor.append(&thisObject->m_" . $attribute->signature->name . ");\n");
                 }
             }
-            push(@implContent, "}\n\n");
         }
+        push(@implContent, "}\n\n");
     }
 
     # Cached attributes are indeed allowed when there is a custom mark/visitChildren function.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to