Changeset 167175 in webkit
- Timestamp:
- Apr 11, 2014 5:26:02 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167173 r167175 1 2014-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 1 20 2014-04-11 Brian J. Burg <burg@cs.washington.edu> 2 21 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r167165 r167175 393 393 my $namedGetterFunction = GetNamedGetterFunction($interface); 394 394 my $indexedGetterFunction = GetIndexedGetterFunction($interface); 395 my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;396 395 397 396 my @getOwnPropertySlotImpl = (); … … 404 403 405 404 my $manualLookupGetterGeneration = sub { 406 my $requiresManualLookup = ($indexedGetterFunction && !$hasNumericIndexedGetter)|| $namedGetterFunction;405 my $requiresManualLookup = $indexedGetterFunction || $namedGetterFunction; 407 406 if ($requiresManualLookup) { 408 407 push(@getOwnPropertySlotImpl, " const ${namespaceMaybe}HashTableValue* entry = getStaticValueSlotEntryWithoutCaching<$className>(exec, propertyName);\n"); … … 434 433 push(@getOwnPropertySlotImpl, " unsigned attributes = ${namespaceMaybe}DontDelete | ${namespaceMaybe}ReadOnly;\n"); 435 434 } 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"); 441 436 push(@getOwnPropertySlotImpl, " return true;\n"); 442 437 push(@getOwnPropertySlotImpl, " }\n"); … … 593 588 my $namedGetterFunction = GetNamedGetterFunction($interface); 594 589 my $indexedGetterFunction = GetIndexedGetterFunction($interface); 595 my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;596 590 597 591 my $hasImpureNamedGetter = $namedGetterFunction … … 615 609 my $namedGetterFunction = GetNamedGetterFunction($interface); 616 610 my $indexedGetterFunction = GetIndexedGetterFunction($interface); 617 my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;618 611 619 612 # FIXME: All these return 1 if ... should ideally be removed. … … 733 726 my $namedGetterFunction = GetNamedGetterFunction($interface); 734 727 my $indexedGetterFunction = GetIndexedGetterFunction($interface); 735 my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;736 728 737 729 my $hasImpureNamedGetter = $namedGetterFunction … … 899 891 my $namedGetterFunction = GetNamedGetterFunction($interface); 900 892 my $indexedGetterFunction = GetIndexedGetterFunction($interface); 901 my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;902 893 903 894 my $hasImpureNamedGetter = … … 1125 1116 # Index getter 1126 1117 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"); 1132 1119 } 1133 1120 … … 1726 1713 my $namedGetterFunction = GetNamedGetterFunction($interface); 1727 1714 my $indexedGetterFunction = GetIndexedGetterFunction($interface); 1728 my $hasNumericIndexedGetter = $indexedGetterFunction ? $codeGenerator->IsNumericType($indexedGetterFunction->signature->type) : 0;1729 1715 1730 1716 # - Add default header template … … 2096 2082 push(@implContent, " unsigned attributes = DontDelete | ReadOnly;\n"); 2097 2083 } 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"); 2103 2085 push(@implContent, " return true;\n"); 2104 2086 push(@implContent, " }\n"); … … 2851 2833 } 2852 2834 2853 if ($indexedGetterFunction && !$hasNumericIndexedGetter) {2835 if ($indexedGetterFunction) { 2854 2836 push(@implContent, "\nEncodedJSValue ${className}::indexGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, unsigned index)\n"); 2855 2837 push(@implContent, "{\n"); … … 2864 2846 push(@implContent, "}\n\n"); 2865 2847 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$/) {2882 2848 $implIncludes{"JSNode.h"} = 1; 2883 2849 $implIncludes{"Node.h"} = 1;
Note: See TracChangeset
for help on using the changeset viewer.