Title: [201702] trunk
Revision
201702
Author
barraclo...@apple.com
Date
2016-06-05 17:59:33 -0700 (Sun, 05 Jun 2016)

Log Message

Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
https://bugs.webkit.org/show_bug.cgi?id=158178

Reviewed by Darin Adler.

As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.

Source/_javascript_Core:

Part 1: Switch JSGlobalObject & JSDOMWindow to use HasStaticPropertyTable.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::getOwnPropertySlot):
    - Override is still required for symbol table,
      but regular property access is now via Base::getOwnPropertySlot.
* runtime/JSGlobalObject.h:
    - add HasStaticPropertyTable to structureFlags.

Source/WebCore:

Part 1: Switch JSGlobalObject & JSDOMWindow to use HasStaticPropertyTable.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
    - getStaticPropertySlot -> Base::getOwnPropertySlot.
* bindings/js/JSPluginElementFunctions.h:
(WebCore::pluginElementCustomGetOwnPropertySlot):
    - Switch call from getStaticValueSlot to Type::getOwnPropertySlot.
      For any element where Type::hasStaticPropertyTable is true the HasStaticPropertyTable
      structure flag will also be set, so Type::getOwnPropertySlot will do the same thing.
* bindings/scripts/CodeGeneratorJS.pm:
(PrototypeHasStaticPropertyTable):
    - Was PrototypeOverridesGetOwnPropertySlot; prototypes now never need override getOwnPropertySlot so renaming accordingly.
(GenerateImplementation):
    - Removed generation of getOwnPropertySlot body for DOMGlobalObjects.
(GeneratePrototypeDeclaration):
    - For DOMGlobalObjects, set HasStaticPropertyTable instead of OverridesGetOwnPropertySlot & removed getOwnPropertySlot declaration.
(PrototypeOverridesGetOwnPropertySlot): Deleted.
    Renamed to PrototypeHasStaticPropertyTable.
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
    - Updating bindings test results.

LayoutTests:

Switch JSGlobalObject & WebCore DOM instance bindings to use HasStaticPropertyTable.

* fast/dom/unforgeable-attributes-expected.txt:
    - Progression, similar to the getOwnPropertyDescriptor test below. Previously we
      were reporting an error with a message appropriate to a disallowed value->value
      redefinition. This is actually a disallowed accessor->value reconfiguration, now
      reporting the correct error message for this.
* http/tests/security/cross-origin-window-property-access-expected.txt:
    - Newly reporting previously missing CORS error.
* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/resources/getOwnPropertyDescriptor.js:
    - This test was previously incorrect - was expecting window.window property to
      reflect as a value decriptor. This now reflect as an accesor descriptor. New
      behaviour is correct per spec & matches Firefox.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201701 => 201702)


--- trunk/LayoutTests/ChangeLog	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/ChangeLog	2016-06-06 00:59:33 UTC (rev 201702)
@@ -1,3 +1,28 @@
+2016-06-05  Gavin & Ellie Barraclough  <barraclo...@apple.com>
+
+        Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
+        https://bugs.webkit.org/show_bug.cgi?id=158178
+
+        Reviewed by Darin Adler.
+
+        As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
+        overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.
+
+        Switch JSGlobalObject & WebCore DOM instance bindings to use HasStaticPropertyTable.
+
+        * fast/dom/unforgeable-attributes-expected.txt:
+            - Progression, similar to the getOwnPropertyDescriptor test below. Previously we
+              were reporting an error with a message appropriate to a disallowed value->value
+              redefinition. This is actually a disallowed accessor->value reconfiguration, now
+              reporting the correct error message for this.
+        * http/tests/security/cross-origin-window-property-access-expected.txt:
+            - Newly reporting previously missing CORS error.
+        * js/dom/getOwnPropertyDescriptor-expected.txt:
+        * js/resources/getOwnPropertyDescriptor.js:
+            - This test was previously incorrect - was expecting window.window property to
+              reflect as a value decriptor. This now reflect as an accesor descriptor. New
+              behaviour is correct per spec & matches Firefox.
+
 2016-06-05  Antti Koivisto  <an...@apple.com>
 
         TextIterator should ignore non-visible frames in findPlainText

Modified: trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt (201701 => 201702)


--- trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt	2016-06-06 00:59:33 UTC (rev 201702)
@@ -18,13 +18,13 @@
 Window.window
 PASS testObject.hasOwnProperty(testPropertyName) is true
 PASS testObject.__proto__.hasOwnProperty(testPropertyName) is false
-PASS Object.defineProperty(testObject, testPropertyName, { value: 'test' }) threw exception TypeError: Attempting to change value of a readonly property..
+PASS Object.defineProperty(testObject, testPropertyName, { value: 'test' }) threw exception TypeError: Attempting to change access mechanism for an unconfigurable property..
 PASS Object.getOwnPropertyDescriptor(testObject, testPropertyName).configurable is false
 
 Window.document
 PASS testObject.hasOwnProperty(testPropertyName) is true
 PASS testObject.__proto__.hasOwnProperty(testPropertyName) is false
-PASS Object.defineProperty(testObject, testPropertyName, { value: 'test' }) threw exception TypeError: Attempting to change value of a readonly property..
+PASS Object.defineProperty(testObject, testPropertyName, { value: 'test' }) threw exception TypeError: Attempting to change access mechanism for an unconfigurable property..
 PASS Object.getOwnPropertyDescriptor(testObject, testPropertyName).configurable is false
 
 Window.location

Modified: trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt (201701 => 201702)


--- trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt	2016-06-06 00:59:33 UTC (rev 201702)
@@ -3,6 +3,7 @@
 CONSOLE MESSAGE: line 1: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 CONSOLE MESSAGE: line 1: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 CONSOLE MESSAGE: line 1: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 1: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 CONSOLE MESSAGE: line 15: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 CONSOLE MESSAGE: line 15: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
 Tests that using another window's property getter does not bypass cross-origin checks.
@@ -10,7 +11,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS Object.getOwnPropertyDescriptor(window, "document").get.call(crossOriginWindow) threw exception TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(window, "document").get.call').
+PASS Object.getOwnPropertyDescriptor(window, "document").get.call(crossOriginWindow) returned undefined.
 PASS Object.getOwnPropertyDescriptor(window, "name").get.call(crossOriginWindow) returned undefined.
 PASS Object.getOwnPropertyDescriptor(window, "menubar").get.call(crossOriginWindow) returned undefined.
 PASS Object.getOwnPropertyDescriptor(window, "scrollbars").get.call(crossOriginWindow) returned undefined.

Modified: trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt (201701 => 201702)


--- trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt	2016-06-06 00:59:33 UTC (rev 201702)
@@ -114,9 +114,10 @@
 PASS Object.getOwnPropertyDescriptor(global, 'Infinity').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Infinity').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Infinity').configurable is false
-PASS Object.getOwnPropertyDescriptor(global, 'window').value is global
-PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'window').get is globalWindowGetter
+PASS Object.getOwnPropertyDescriptor(global, 'window').set is undefined
+PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('value') is false
+PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('writable') is false
 PASS Object.getOwnPropertyDescriptor(global, 'window').enumerable is true
 PASS Object.getOwnPropertyDescriptor(global, 'window').configurable is false
 PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').value is XMLHttpRequest

Modified: trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js (201701 => 201702)


--- trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js	2016-06-06 00:59:33 UTC (rev 201702)
@@ -41,7 +41,8 @@
 descriptorShouldBe("global", "'undefined'", {writable: false, enumerable: false, configurable: false, value:"undefined"});
 descriptorShouldBe("global", "'NaN'", {writable: false, enumerable: false, configurable: false, value:"NaN"});
 descriptorShouldBe("global", "'Infinity'", {writable: false, enumerable: false, configurable: false, value:"Infinity"});
-descriptorShouldBe("global", "'window'", {writable: false, enumerable: true, configurable: false, value:"global"});
+var globalWindowGetter = Object.getOwnPropertyDescriptor(global, 'window').get;
+descriptorShouldBe("global", "'window'", {get: 'globalWindowGetter', set: undefined, enumerable: true, configurable: false});
 descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: false, configurable: true, value:"XMLHttpRequest"});
 descriptorShouldBe("global", "0", {writable: true, enumerable: false, configurable: false, value:"global[0]"});
 descriptorShouldBe("document.getElementsByTagName('div')", "0", {writable: false, enumerable: true, configurable: false, value:"document.getElementsByTagName('div')[0]"});

Modified: trunk/Source/_javascript_Core/ChangeLog (201701 => 201702)


--- trunk/Source/_javascript_Core/ChangeLog	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-06-06 00:59:33 UTC (rev 201702)
@@ -1,3 +1,22 @@
+2016-06-03  Gavin & Ellie Barraclough  <barraclo...@apple.com>
+
+        Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
+        https://bugs.webkit.org/show_bug.cgi?id=158178
+
+        Reviewed by Darin Adler.
+
+        As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
+        overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.
+
+        Part 1: Switch JSGlobalObject & JSDOMWindow to use HasStaticPropertyTable.
+
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::getOwnPropertySlot):
+            - Override is still required for symbol table,
+              but regular property access is now via Base::getOwnPropertySlot.
+        * runtime/JSGlobalObject.h:
+            - add HasStaticPropertyTable to structureFlags.
+
 2016-06-03  Benjamin Poulain  <bpoul...@apple.com>
 
         Eager FTL failure for strict comparison of NaN with number check

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (201701 => 201702)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2016-06-06 00:59:33 UTC (rev 201702)
@@ -1178,10 +1178,9 @@
 
 bool JSGlobalObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
 {
-    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object);
-    if (getStaticPropertySlot<JSGlobalObject, Base>(exec, globalObjectTable, thisObject, propertyName, slot))
+    if (Base::getOwnPropertySlot(object, exec, propertyName, slot))
         return true;
-    return symbolTableGet(thisObject, propertyName, slot);
+    return symbolTableGet(jsCast<JSGlobalObject*>(object), propertyName, slot);
 }
 
 void JSGlobalObject::clearRareData(JSCell* cell)

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.h (201701 => 201702)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.h	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.h	2016-06-06 00:59:33 UTC (rev 201702)
@@ -387,7 +387,7 @@
         
 public:
     typedef JSSegmentedVariableObject Base;
-    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetPropertyNames | OverridesToThis;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable | OverridesGetOwnPropertySlot | OverridesGetPropertyNames | OverridesToThis;
 
     static JSGlobalObject* create(VM& vm, Structure* structure)
     {

Modified: trunk/Source/WebCore/ChangeLog (201701 => 201702)


--- trunk/Source/WebCore/ChangeLog	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/ChangeLog	2016-06-06 00:59:33 UTC (rev 201702)
@@ -1,3 +1,36 @@
+2016-06-03  Gavin & Ellie Barraclough  <barraclo...@apple.com>
+
+        Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
+        https://bugs.webkit.org/show_bug.cgi?id=158178
+
+        Reviewed by Darin Adler.
+
+        As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
+        overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.
+
+        Part 1: Switch JSGlobalObject & JSDOMWindow to use HasStaticPropertyTable.
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::getOwnPropertySlot):
+            - getStaticPropertySlot -> Base::getOwnPropertySlot.
+        * bindings/js/JSPluginElementFunctions.h:
+        (WebCore::pluginElementCustomGetOwnPropertySlot):
+            - Switch call from getStaticValueSlot to Type::getOwnPropertySlot.
+              For any element where Type::hasStaticPropertyTable is true the HasStaticPropertyTable
+              structure flag will also be set, so Type::getOwnPropertySlot will do the same thing.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (PrototypeHasStaticPropertyTable):
+            - Was PrototypeOverridesGetOwnPropertySlot; prototypes now never need override getOwnPropertySlot so renaming accordingly.
+        (GenerateImplementation):
+            - Removed generation of getOwnPropertySlot body for DOMGlobalObjects.
+        (GeneratePrototypeDeclaration):
+            - For DOMGlobalObjects, set HasStaticPropertyTable instead of OverridesGetOwnPropertySlot & removed getOwnPropertySlot declaration.
+        (PrototypeOverridesGetOwnPropertySlot): Deleted.
+            Renamed to PrototypeHasStaticPropertyTable.
+        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+        * bindings/scripts/test/JS/JSTestGlobalObject.h:
+            - Updating bindings test results.
+
 2016-06-05  Antti Koivisto  <an...@apple.com>
 
         Find on page finds too many matches

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (201701 => 201702)


--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2016-06-06 00:59:33 UTC (rev 201702)
@@ -236,7 +236,7 @@
 
     // (2) Regular own properties.
     PropertySlot slotCopy = slot;
-    if (getStaticPropertySlot<JSDOMWindow, Base>(exec, *JSDOMWindow::info()->staticPropHashTable, thisObject, propertyName, slot)) {
+    if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) {
         // Detect when we're getting the property 'showModalDialog', this is disabled, and has its original value.
         bool isShowModalDialogAndShouldHide = propertyName == exec->propertyNames().showModalDialog
             && !DOMWindow::canShowModalDialog(frame)

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (201701 => 201702)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-06-06 00:59:33 UTC (rev 201702)
@@ -702,7 +702,7 @@
     return $numInstanceProperties > 0 || $hasComplexGetter;
 }
 
-sub PrototypeOverridesGetOwnPropertySlot
+sub PrototypeHasStaticPropertyTable
 {
     my $interface = shift;
     my $numPrototypeProperties = PrototypePropertyCount($interface);
@@ -2267,70 +2267,43 @@
         push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleInterfaceName}Prototype\", &Base::s_info, &${className}PrototypeTable, CREATE_METHOD_TABLE(${className}Prototype) };\n\n");
     }
 
-    if (PrototypeOverridesGetOwnPropertySlot($interface)) {
-        my $prototypePropertyCount = PrototypePropertyCount($interface);
-        my $prototypeFunctionCount = PrototypeFunctionCount($interface);
-        my $prototypeAttributeCount = $prototypePropertyCount - $prototypeFunctionCount;
-        if (IsDOMGlobalObject($interface)) {
-            push(@implContent, "bool ${className}Prototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    VM& vm = state->vm();\n");
-            push(@implContent, "    UNUSED_PARAM(vm);\n");
-            push(@implContent, "    auto* thisObject = jsCast<${className}Prototype*>(object);\n");
+    if (PrototypeHasStaticPropertyTable($interface) && !IsDOMGlobalObject($interface)) {
+        push(@implContent, "void ${className}Prototype::finishCreation(VM& vm)\n");
+        push(@implContent, "{\n");
+        push(@implContent, "    Base::finishCreation(vm);\n");
+        push(@implContent, "    reifyStaticProperties(vm, ${className}PrototypeTableValues, *this);\n");
 
-            if ($numConstants eq 0 && $prototypePropertyCount eq 0) {
-                push(@implContent, "    return Base::getOwnPropertySlot(thisObject, state, propertyName, slot);\n");        
-            } elsif ($numConstants eq 0 && $prototypeAttributeCount eq 0) {
-                push(@implContent, "    return getStaticFunctionSlot<JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
-            } elsif ($prototypePropertyCount eq 0) {
-                push(@implContent, "    return getStaticValueSlot<${className}Prototype, JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
-            } else {
-                push(@implContent, "    return getStaticPropertySlot<${className}Prototype, JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
-            }
-            push(@implContent, "}\n\n");
-        } elsif ($numConstants > 0 || $numPrototypeProperties > 0) {
-            push(@implContent, "void ${className}Prototype::finishCreation(VM& vm)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    Base::finishCreation(vm);\n");
-            push(@implContent, "    reifyStaticProperties(vm, ${className}PrototypeTableValues, *this);\n");
+        my @runtimeEnabledProperties = @runtimeEnabledFunctions;
+        push(@runtimeEnabledProperties, @runtimeEnabledAttributes);
+        foreach my $functionOrAttribute (@runtimeEnabledProperties) {
+            my $signature = $functionOrAttribute->signature;
+            my $conditionalString = $codeGenerator->GenerateConditionalString($signature);
+            push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
+            AddToImplIncludes("RuntimeEnabledFeatures.h");
+            my $enable_function = GetRuntimeEnableFunctionName($signature);
+            my $name = $signature->name;
+            push(@implContent, "    if (!${enable_function}()) {\n");
+            push(@implContent, "        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>(\"$name\"), strlen(\"$name\"));\n");
+            push(@implContent, "        removeDirect(vm, propertyName);\n");
+            push(@implContent, "    }\n");
+            push(@implContent, "#endif\n") if $conditionalString;
+        }
 
-            my @runtimeEnabledProperties = @runtimeEnabledFunctions;
-            push(@runtimeEnabledProperties, @runtimeEnabledAttributes);
-            foreach my $functionOrAttribute (@runtimeEnabledProperties) {
-                my $signature = $functionOrAttribute->signature;
-                my $conditionalString = $codeGenerator->GenerateConditionalString($signature);
-                push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
-                AddToImplIncludes("RuntimeEnabledFeatures.h");
-                my $enable_function = GetRuntimeEnableFunctionName($signature);
-                my $name = $signature->name;
-                push(@implContent, "    if (!${enable_function}()) {\n");
-                push(@implContent, "        Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>(\"$name\"), strlen(\"$name\"));\n");
-                push(@implContent, "        removeDirect(vm, propertyName);\n");
-                push(@implContent, "    }\n");
-                push(@implContent, "#endif\n") if $conditionalString;
-            }
+        my $firstPrivateFunction = 1;
+        foreach my $function (@{$interface->functions}) {
+            next unless ($function->signature->extendedAttributes->{"Private"});
+            AddToImplIncludes("WebCoreJSClientData.h");
+            push(@implContent, "    JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);\n") if $firstPrivateFunction;
+            $firstPrivateFunction = 0;
+            push(@implContent, "    putDirect(vm, clientData.builtinNames()." . $function->signature->name . "PrivateName(), JSFunction::create(vm, globalObject(), 0, String(), " . GetFunctionName($interface, $className, $function) . "), ReadOnly | DontEnum);\n");
+        }
 
-            my $firstPrivateFunction = 1;
-            foreach my $function (@{$interface->functions}) {
-                next unless ($function->signature->extendedAttributes->{"Private"});
-                AddToImplIncludes("WebCoreJSClientData.h");
-                push(@implContent, "    JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);\n") if $firstPrivateFunction;
-                $firstPrivateFunction = 0;
-                push(@implContent, "    putDirect(vm, clientData.builtinNames()." . $function->signature->name . "PrivateName(), JSFunction::create(vm, globalObject(), 0, String(), " . GetFunctionName($interface, $className, $function) . "), ReadOnly | DontEnum);\n");
-            }
-
-            if ($interface->iterable) {
-                my $functionName = GetFunctionName($interface, $className, @{$interface->iterable->functions}[0]);
-                push(@implContent, "    putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral(\"[Symbol.Iterator]\"), $functionName), ReadOnly | DontEnum);\n");
-            }
-
-            push(@implContent, "}\n\n");
-        } else {
-            push(@implContent, "void ${className}Prototype::finishCreation(VM& vm)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    Base::finishCreation(vm);\n");
-            push(@implContent, "}\n\n");
+        if ($interface->iterable) {
+            my $functionName = GetFunctionName($interface, $className, @{$interface->iterable->functions}[0]);
+            push(@implContent, "    putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral(\"[Symbol.Iterator]\"), $functionName), ReadOnly | DontEnum);\n");
         }
+
+        push(@implContent, "}\n\n");
     }
 
     if ($interface->extendedAttributes->{"JSCustomNamedGetterOnPrototype"}) {
@@ -4839,12 +4812,11 @@
     push(@$outputArray, "    {\n");
     push(@$outputArray, "    }\n");
 
-    if (PrototypeOverridesGetOwnPropertySlot($interface)) {
-        push(@$outputArray, "\n");
+    if (PrototypeHasStaticPropertyTable($interface)) {
         if (IsDOMGlobalObject($interface)) {
-            push(@$outputArray, "    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
-            $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1;
+            $structureFlags{"JSC::HasStaticPropertyTable"} = 1;
         } else {
+            push(@$outputArray, "\n");
             push(@$outputArray, "    void finishCreation(JSC::VM&);\n");
         }
     }

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (201701 => 201702)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp	2016-06-06 00:59:33 UTC (rev 201702)
@@ -108,14 +108,6 @@
 static const HashTable JSTestGlobalObjectPrototypeTable = { 1, 1, true, JSTestGlobalObjectPrototypeTableValues, JSTestGlobalObjectPrototypeTableIndex };
 const ClassInfo JSTestGlobalObjectPrototype::s_info = { "TestGlobalObjectPrototype", &Base::s_info, &JSTestGlobalObjectPrototypeTable, CREATE_METHOD_TABLE(JSTestGlobalObjectPrototype) };
 
-bool JSTestGlobalObjectPrototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
-{
-    VM& vm = state->vm();
-    UNUSED_PARAM(vm);
-    auto* thisObject = jsCast<JSTestGlobalObjectPrototype*>(object);
-    return getStaticPropertySlot<JSTestGlobalObjectPrototype, JSObject>(state, JSTestGlobalObjectPrototypeTable, thisObject, propertyName, slot);
-}
-
 const ClassInfo JSTestGlobalObject::s_info = { "TestGlobalObject", &Base::s_info, &JSTestGlobalObjectTable, CREATE_METHOD_TABLE(JSTestGlobalObject) };
 
 JSTestGlobalObject::JSTestGlobalObject(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestGlobalObject>&& impl)

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h (201701 => 201702)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h	2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h	2016-06-06 00:59:33 UTC (rev 201702)
@@ -111,10 +111,8 @@
         : JSC::JSNonFinalObject(vm, structure)
     {
     }
-
-    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
 public:
-    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+    static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags;
 };
 
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to