Changeset 90709 in webkit


Ignore:
Timestamp:
Jul 10, 2011 7:55:23 PM (13 years ago)
Author:
Patrick Gansterer
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:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90707 r90709  
     12011-07-10  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Remove array size from generated JSC binding tables
     4        https://bugs.webkit.org/show_bug.cgi?id=64229
     5
     6        Reviewed by Brent Fulgham.
     7
     8        Because many items in the array are surrounded with #if(ENABLE_XXX) lines,
     9        the array size isn't fix and correct in all cases.
     10        So let the compiler calculate the correct size itself.
     11
     12        * bindings/scripts/CodeGeneratorJS.pm:
     13        (GenerateHashTable):
     14        * bindings/scripts/test/JS/JSTestInterface.cpp:
     15        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
     16        * bindings/scripts/test/JS/JSTestObj.cpp:
     17        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
     18
    1192011-07-10  Kenichi Ishibashi  <bashi@chromium.org>
    220
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r90680 r90709  
    28282828
    28292829    # Dump the hash table
    2830     my $count = scalar @{$keys} + 1;
    28312830    push(@implContent, "#if ENABLE(JIT)\n");
    28322831    push(@implContent, "#define THUNK_GENERATOR(generator) , generator\n");
     
    28342833    push(@implContent, "#define THUNK_GENERATOR(generator)\n");
    28352834    push(@implContent, "#endif\n");
    2836     push(@implContent, "\nstatic const HashTableValue $nameEntries\[$count\] =\n\{\n");
     2835    push(@implContent, "\nstatic const HashTableValue $nameEntries\[\] =\n\{\n");
    28372836    $i = 0;
    28382837    foreach my $key (@{$keys}) {
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r87360 r90709  
    4141#endif
    4242
    43 static const HashTableValue JSTestInterfaceTableValues[2] =
     43static const HashTableValue JSTestInterfaceTableValues[] =
    4444{
    4545    { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
     
    5656#endif
    5757
    58 static const HashTableValue JSTestInterfaceConstructorTableValues[1] =
     58static const HashTableValue JSTestInterfaceConstructorTableValues[] =
    5959{
    6060    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
     
    120120#endif
    121121
    122 static const HashTableValue JSTestInterfacePrototypeTableValues[1] =
     122static const HashTableValue JSTestInterfacePrototypeTableValues[] =
    123123{
    124124    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp

    r87360 r90709  
    4242#endif
    4343
    44 static const HashTableValue JSTestMediaQueryListListenerTableValues[2] =
     44static const HashTableValue JSTestMediaQueryListListenerTableValues[] =
    4545{
    4646    { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestMediaQueryListListenerConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
     
    5757#endif
    5858
    59 static const HashTableValue JSTestMediaQueryListListenerConstructorTableValues[1] =
     59static const HashTableValue JSTestMediaQueryListListenerConstructorTableValues[] =
    6060{
    6161    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
     
    105105#endif
    106106
    107 static const HashTableValue JSTestMediaQueryListListenerPrototypeTableValues[2] =
     107static const HashTableValue JSTestMediaQueryListListenerPrototypeTableValues[] =
    108108{
    109109    { "method", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestMediaQueryListListenerPrototypeFunctionMethod), (intptr_t)1 THUNK_GENERATOR(0) },
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r89315 r90709  
    5656#endif
    5757
    58 static const HashTableValue JSTestObjTableValues[37] =
     58static const HashTableValue JSTestObjTableValues[] =
    5959{
    6060    { "readOnlyIntAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) },
     
    112112#endif
    113113
    114 static const HashTableValue JSTestObjConstructorTableValues[12] =
     114static const HashTableValue JSTestObjConstructorTableValues[] =
    115115{
    116116    { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
     
    184184#endif
    185185
    186 static const HashTableValue JSTestObjPrototypeTableValues[48] =
     186static const HashTableValue JSTestObjPrototypeTableValues[] =
    187187{
    188188    { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp

    r87360 r90709  
    4242#endif
    4343
    44 static const HashTableValue JSTestSerializedScriptValueInterfaceTableValues[3] =
     44static const HashTableValue JSTestSerializedScriptValueInterfaceTableValues[] =
    4545{
    4646    { "value", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceValue), (intptr_t)0 THUNK_GENERATOR(0) },
     
    5858#endif
    5959
    60 static const HashTableValue JSTestSerializedScriptValueInterfaceConstructorTableValues[1] =
     60static const HashTableValue JSTestSerializedScriptValueInterfaceConstructorTableValues[] =
    6161{
    6262    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
     
    106106#endif
    107107
    108 static const HashTableValue JSTestSerializedScriptValueInterfacePrototypeTableValues[1] =
     108static const HashTableValue JSTestSerializedScriptValueInterfacePrototypeTableValues[] =
    109109{
    110110    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
Note: See TracChangeset for help on using the changeset viewer.