Changeset 167175 in webkit


Ignore:
Timestamp:
Apr 11, 2014 5:26:02 PM (10 years ago)
Author:
akling@apple.com
Message:

Remove "numeric index getter" stuff from bindings code generator.
<https://webkit.org/b/131565>

This was used for an earlier generation of typed arrays. Now that JSC
has native typed array support, we're not using this functionality and
can just remove it.

Reviewed by Geoffrey Garen.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateGetOwnPropertySlotBody):
(HasComplexGetOwnProperty):
(InterfaceRequiresAttributesOnInstance):
(InstanceOverridesGetOwnPropertySlot):
(GenerateHeader):
(GenerateImplementation):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167173 r167175  
     12014-04-11  Andreas Kling  <akling@apple.com>
     2
     3        Remove "numeric index getter" stuff from bindings code generator.
     4        <https://webkit.org/b/131565>
     5
     6        This was used for an earlier generation of typed arrays. Now that JSC
     7        has native typed array support, we're not using this functionality and
     8        can just remove it.
     9
     10        Reviewed by Geoffrey Garen.
     11
     12        * bindings/scripts/CodeGeneratorJS.pm:
     13        (GenerateGetOwnPropertySlotBody):
     14        (HasComplexGetOwnProperty):
     15        (InterfaceRequiresAttributesOnInstance):
     16        (InstanceOverridesGetOwnPropertySlot):
     17        (GenerateHeader):
     18        (GenerateImplementation):
     19
    1202014-04-11  Brian J. Burg  <burg@cs.washington.edu>
    221
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r167165 r167175  
    393393    my $namedGetterFunction = GetNamedGetterFunction($interface);
    394394    my $indexedGetterFunction = GetIndexedGetterFunction($interface);
    395     my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;
    396395
    397396    my @getOwnPropertySlotImpl = ();
     
    404403
    405404    my $manualLookupGetterGeneration = sub {
    406         my $requiresManualLookup = ($indexedGetterFunction && !$hasNumericIndexedGetter) || $namedGetterFunction;
     405        my $requiresManualLookup = $indexedGetterFunction || $namedGetterFunction;
    407406        if ($requiresManualLookup) {
    408407            push(@getOwnPropertySlotImpl, "    const ${namespaceMaybe}HashTableValue* entry = getStaticValueSlotEntryWithoutCaching<$className>(exec, propertyName);\n");
     
    434433            push(@getOwnPropertySlotImpl, "        unsigned attributes = ${namespaceMaybe}DontDelete | ${namespaceMaybe}ReadOnly;\n");
    435434        }
    436         if ($hasNumericIndexedGetter) {
    437             push(@getOwnPropertySlotImpl, "        slot.setValue(thisObject, attributes, thisObject->getByIndex(exec, index));\n");
    438         } else {
    439             push(@getOwnPropertySlotImpl, "        slot.setCustomIndex(thisObject, attributes, index, indexGetter);\n");
    440         }
     435        push(@getOwnPropertySlotImpl, "        slot.setCustomIndex(thisObject, attributes, index, indexGetter);\n");
    441436        push(@getOwnPropertySlotImpl, "        return true;\n");
    442437        push(@getOwnPropertySlotImpl, "    }\n");
     
    593588    my $namedGetterFunction = GetNamedGetterFunction($interface);
    594589    my $indexedGetterFunction = GetIndexedGetterFunction($interface);
    595     my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;
    596590
    597591    my $hasImpureNamedGetter = $namedGetterFunction
     
    615609    my $namedGetterFunction = GetNamedGetterFunction($interface);
    616610    my $indexedGetterFunction = GetIndexedGetterFunction($interface);
    617     my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;
    618611
    619612    # FIXME: All these return 1 if ... should ideally be removed.
     
    733726    my $namedGetterFunction = GetNamedGetterFunction($interface);
    734727    my $indexedGetterFunction = GetIndexedGetterFunction($interface);
    735     my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;
    736728
    737729    my $hasImpureNamedGetter = $namedGetterFunction
     
    899891    my $namedGetterFunction = GetNamedGetterFunction($interface);
    900892    my $indexedGetterFunction = GetIndexedGetterFunction($interface);
    901     my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;
    902893
    903894    my $hasImpureNamedGetter =
     
    11251116    # Index getter
    11261117    if ($indexedGetterFunction) {
    1127         if ($hasNumericIndexedGetter) {
    1128             push(@headerContent, "    JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);\n");
    1129         } else {
    1130             push(@headerContent, "    static JSC::EncodedJSValue indexGetter(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, unsigned);\n");
    1131         }
     1118        push(@headerContent, "    static JSC::EncodedJSValue indexGetter(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, unsigned);\n");
    11321119    }
    11331120
     
    17261713    my $namedGetterFunction = GetNamedGetterFunction($interface);
    17271714    my $indexedGetterFunction = GetIndexedGetterFunction($interface);
    1728     my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;
    17291715
    17301716    # - Add default header template
     
    20962082                    push(@implContent, "        unsigned attributes = DontDelete | ReadOnly;\n");
    20972083                }
    2098                 if ($hasNumericIndexedGetter) {
    2099                     push(@implContent, "        slot.setValue(thisObject, attributes, thisObject->getByIndex(exec, index));\n");
    2100                 } else {
    2101                     push(@implContent, "        slot.setCustomIndex(thisObject, attributes, index, thisObject->indexGetter);\n");
    2102                 }
     2084                push(@implContent, "        slot.setCustomIndex(thisObject, attributes, index, thisObject->indexGetter);\n");
    21032085                push(@implContent, "        return true;\n");
    21042086                push(@implContent, "    }\n");
     
    28512833    }
    28522834
    2853     if ($indexedGetterFunction && !$hasNumericIndexedGetter) {
     2835    if ($indexedGetterFunction) {
    28542836        push(@implContent, "\nEncodedJSValue ${className}::indexGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, unsigned index)\n");
    28552837        push(@implContent, "{\n");
     
    28642846        push(@implContent, "}\n\n");
    28652847        if ($interfaceName =~ /^HTML\w*Collection$/ or $interfaceName eq "RadioNodeList") {
    2866             $implIncludes{"JSNode.h"} = 1;
    2867             $implIncludes{"Node.h"} = 1;
    2868         }
    2869     }
    2870 
    2871     if ($hasNumericIndexedGetter) {
    2872         push(@implContent, "\nJSValue ${className}::getByIndex(ExecState*, unsigned index)\n");
    2873         push(@implContent, "{\n");
    2874         push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(this, info());\n");
    2875         push(@implContent, "    double result = impl().item(index);\n");
    2876         # jsNumber conversion doesn't suppress signalling NaNs, so enforce that here.
    2877         push(@implContent, "    if (std::isnan(result))\n");
    2878         push(@implContent, "        return jsNaN();\n");
    2879         push(@implContent, "    return JSValue(result);\n");
    2880         push(@implContent, "}\n\n");
    2881         if ($interfaceName =~ /^HTML\w*Collection$/) {
    28822848            $implIncludes{"JSNode.h"} = 1;
    28832849            $implIncludes{"Node.h"} = 1;
Note: See TracChangeset for help on using the changeset viewer.