Title: [90709] trunk/Source/WebCore
Revision
90709
Author
par...@webkit.org
Date
2011-07-10 19:55:23 -0700 (Sun, 10 Jul 2011)

Log Message

Remove array size from generated JSC binding tables
https://bugs.webkit.org/show_bug.cgi?id=64229

Reviewed by Brent Fulgham.

Because many items in the array are surrounded with #if(ENABLE_XXX) lines,
the array size isn't fix and correct in all cases.
So let the compiler calculate the correct size itself.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHashTable):
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (90708 => 90709)


--- trunk/Source/WebCore/ChangeLog	2011-07-11 02:51:43 UTC (rev 90708)
+++ trunk/Source/WebCore/ChangeLog	2011-07-11 02:55:23 UTC (rev 90709)
@@ -1,3 +1,21 @@
+2011-07-10  Patrick Gansterer  <par...@webkit.org>
+
+        Remove array size from generated JSC binding tables
+        https://bugs.webkit.org/show_bug.cgi?id=64229
+
+        Reviewed by Brent Fulgham.
+
+        Because many items in the array are surrounded with #if(ENABLE_XXX) lines,
+        the array size isn't fix and correct in all cases.
+        So let the compiler calculate the correct size itself.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHashTable):
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+
 2011-07-10  Kenichi Ishibashi  <ba...@chromium.org>
 
         Let plugins participate in form submission

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (90708 => 90709)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2011-07-11 02:51:43 UTC (rev 90708)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2011-07-11 02:55:23 UTC (rev 90709)
@@ -2827,13 +2827,12 @@
     }
 
     # Dump the hash table
-    my $count = scalar @{$keys} + 1;
     push(@implContent, "#if ENABLE(JIT)\n");
     push(@implContent, "#define THUNK_GENERATOR(generator) , generator\n");
     push(@implContent, "#else\n");
     push(@implContent, "#define THUNK_GENERATOR(generator)\n");
     push(@implContent, "#endif\n");
-    push(@implContent, "\nstatic const HashTableValue $nameEntries\[$count\] =\n\{\n");
+    push(@implContent, "\nstatic const HashTableValue $nameEntries\[\] =\n\{\n");
     $i = 0;
     foreach my $key (@{$keys}) {
         my $conditional;

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (90708 => 90709)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp	2011-07-11 02:51:43 UTC (rev 90708)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp	2011-07-11 02:55:23 UTC (rev 90709)
@@ -40,7 +40,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestInterfaceTableValues[2] =
+static const HashTableValue JSTestInterfaceTableValues[] =
 {
     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
@@ -55,7 +55,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestInterfaceConstructorTableValues[1] =
+static const HashTableValue JSTestInterfaceConstructorTableValues[] =
 {
     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
 };
@@ -119,7 +119,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestInterfacePrototypeTableValues[1] =
+static const HashTableValue JSTestInterfacePrototypeTableValues[] =
 {
     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
 };

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp (90708 => 90709)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp	2011-07-11 02:51:43 UTC (rev 90708)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp	2011-07-11 02:55:23 UTC (rev 90709)
@@ -41,7 +41,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestMediaQueryListListenerTableValues[2] =
+static const HashTableValue JSTestMediaQueryListListenerTableValues[] =
 {
     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestMediaQueryListListenerConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
@@ -56,7 +56,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestMediaQueryListListenerConstructorTableValues[1] =
+static const HashTableValue JSTestMediaQueryListListenerConstructorTableValues[] =
 {
     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
 };
@@ -104,7 +104,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestMediaQueryListListenerPrototypeTableValues[2] =
+static const HashTableValue JSTestMediaQueryListListenerPrototypeTableValues[] =
 {
     { "method", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestMediaQueryListListenerPrototypeFunctionMethod), (intptr_t)1 THUNK_GENERATOR(0) },
     { 0, 0, 0, 0 THUNK_GENERATOR(0) }

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (90708 => 90709)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2011-07-11 02:51:43 UTC (rev 90708)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2011-07-11 02:55:23 UTC (rev 90709)
@@ -55,7 +55,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestObjTableValues[37] =
+static const HashTableValue JSTestObjTableValues[] =
 {
     { "readOnlyIntAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) },
     { "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -111,7 +111,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestObjConstructorTableValues[12] =
+static const HashTableValue JSTestObjConstructorTableValues[] =
 {
     { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
     { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -183,7 +183,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestObjPrototypeTableValues[48] =
+static const HashTableValue JSTestObjPrototypeTableValues[] =
 {
     { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
     { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) },

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (90708 => 90709)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp	2011-07-11 02:51:43 UTC (rev 90708)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp	2011-07-11 02:55:23 UTC (rev 90709)
@@ -41,7 +41,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestSerializedScriptValueInterfaceTableValues[3] =
+static const HashTableValue JSTestSerializedScriptValueInterfaceTableValues[] =
 {
     { "value", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceValue), (intptr_t)0 THUNK_GENERATOR(0) },
     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -57,7 +57,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestSerializedScriptValueInterfaceConstructorTableValues[1] =
+static const HashTableValue JSTestSerializedScriptValueInterfaceConstructorTableValues[] =
 {
     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
 };
@@ -105,7 +105,7 @@
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestSerializedScriptValueInterfacePrototypeTableValues[1] =
+static const HashTableValue JSTestSerializedScriptValueInterfacePrototypeTableValues[] =
 {
     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
 };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to