Title: [166249] trunk/Source/WebCore
Revision
166249
Author
msab...@apple.com
Date
2014-03-25 13:43:27 -0700 (Tue, 25 Mar 2014)

Log Message

Unreviewed, rolling out r166070.

Rollout r166070 due to 2% performance loss in page load times

Reverted changeset:

"Change CodeGeneratorJS.pm special cases for "DOMWindow" to be
general purpose"
https://bugs.webkit.org/show_bug.cgi?id=130553
http://trac.webkit.org/changeset/166070

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (166248 => 166249)


--- trunk/Source/WebCore/ChangeLog	2014-03-25 20:40:34 UTC (rev 166248)
+++ trunk/Source/WebCore/ChangeLog	2014-03-25 20:43:27 UTC (rev 166249)
@@ -1,5 +1,18 @@
 2014-03-25  Michael Saboff  <msab...@apple.com>
 
+        Unreviewed, rolling out r166070.
+
+        Rollout r166070 due to 2% performance loss in page load times
+
+        Reverted changeset:
+
+        "Change CodeGeneratorJS.pm special cases for "DOMWindow" to be
+        general purpose"
+        https://bugs.webkit.org/show_bug.cgi?id=130553
+        http://trac.webkit.org/changeset/166070
+
+2014-03-25  Michael Saboff  <msab...@apple.com>
+
         Unreviewed, rolling out r166126.
 
         Rollout r166126 in prepartion to roll out prerequisite r166070

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (166248 => 166249)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2014-03-25 20:40:34 UTC (rev 166248)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2014-03-25 20:43:27 UTC (rev 166249)
@@ -2127,8 +2127,12 @@
             push(@implContent, "{\n");
 
             if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) {
-                if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) {
-                    push(@implContent, "    ${className}* castedThis = to${className}(JSValue::decode(thisValue));\n");
+                if ($interfaceName eq "DOMWindow") {
+                    push(@implContent, "    ${className}* castedThis = jsDynamicCast<$className*>(JSValue::decode(thisValue));\n");
+                    push(@implContent, "    if (UNLIKELY(!castedThis)) {\n");
+                    push(@implContent, "        if (JSDOMWindowShell* shell = jsDynamicCast<JSDOMWindowShell*>(JSValue::decode(thisValue)))\n");
+                    push(@implContent, "            castedThis = shell->window();\n");
+                    push(@implContent, "    }\n");
                     push(@implContent, "    UNUSED_PARAM(slotBase);\n");
                 } else {
                     push(@implContent, "    ${className}* castedThis = jsDynamicCast<$className*>(JSValue::decode(thisValue));\n");
@@ -2346,8 +2350,12 @@
             push(@implContent, "{\n");
             push(@implContent, "    UNUSED_PARAM(baseValue);\n");
             push(@implContent, "    UNUSED_PARAM(thisValue);\n");
-            if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) {
-                push(@implContent, "    ${className}* domObject = to${className}(JSValue::decode(thisValue));\n");
+            if ($interfaceName eq "DOMWindow") {
+                push(@implContent, "    ${className}* domObject = jsDynamicCast<$className*>(JSValue::decode(thisValue));\n");
+                push(@implContent, "    if (!domObject) {\n");
+                push(@implContent, "        if (JSDOMWindowShell* shell = jsDynamicCast<JSDOMWindowShell*>(JSValue::decode(thisValue)))\n");
+                push(@implContent, "            domObject = shell->window();\n");
+                push(@implContent, "    }\n");
             } else {
                 push(@implContent, "    ${className}* domObject = jsDynamicCast<${className}*>(JSValue::decode(thisValue));\n") if ConstructorShouldBeOnInstance($interface);
                 push(@implContent, "    ${className}Prototype* domObject = jsDynamicCast<${className}Prototype*>(baseValue);\n") if !ConstructorShouldBeOnInstance($interface);
@@ -2371,10 +2379,12 @@
             push(@implContent, "void ${constructorFunctionName}(ExecState* exec, JSObject*, EncodedJSValue thisValue, EncodedJSValue encodedValue)\n");
             push(@implContent, "{\n");
             push(@implContent, "    JSValue value = JSValue::decode(encodedValue);");
-            if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) {
-                push(@implContent, "    ${className}* castedThis = to${className}(JSValue::decode(thisValue));\n");
-            } else {
-                push(@implContent, "    ${className}* castedThis = jsDynamicCast<${className}*>(JSValue::decode(thisValue));\n");
+            push(@implContent, "    ${className}* castedThis = jsDynamicCast<${className}*>(JSValue::decode(thisValue));\n");
+            if ($interfaceName eq "DOMWindow") {
+                push(@implContent, "    if (UNLIKELY(!castedThis)) {\n");
+                push(@implContent, "        if (JSDOMWindowShell* shell = jsDynamicCast<JSDOMWindowShell*>(JSValue::decode(thisValue)))\n");
+                push(@implContent, "            castedThis = shell->window();\n");
+                push(@implContent, "    }\n");
             }
             push(@implContent, "    if (UNLIKELY(!castedThis)) {\n");
             push(@implContent, "        throwVMTypeError(exec);\n");
@@ -2478,10 +2488,12 @@
                 push(@implContent, "    JSValue value = JSValue::decode(encodedValue);\n");
                 push(@implContent, "    UNUSED_PARAM(exec);\n");
                 if (!$attribute->isStatic) {
-                    if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) {
-                        push(@implContent, "    ${className}* castedThis = to${className}(JSValue::decode(thisValue));\n");
-                    } else {
-                        push(@implContent, "    ${className}* castedThis = jsDynamicCast<${className}*>(JSValue::decode(thisValue));\n");
+                    push(@implContent, "    ${className}* castedThis = jsDynamicCast<${className}*>(JSValue::decode(thisValue));\n");
+                    if ($interfaceName eq "DOMWindow") {
+                        push(@implContent, "    if (UNLIKELY(!castedThis)) {\n");
+                        push(@implContent, "        if (JSDOMWindowShell* shell = jsDynamicCast<JSDOMWindowShell*>(JSValue::decode(thisValue)))\n");
+                        push(@implContent, "            castedThis = shell->window();\n");
+                        push(@implContent, "    }\n");
                     }
                     push(@implContent, "    if (UNLIKELY(!castedThis)) {\n");
                     push(@implContent, "        throwVMTypeError(exec, makeDOMBindingsTypeErrorString(\"The \", \"$interfaceName\", \".\", \"$name\", \" setter can only be used on instances of \", \"$interfaceName\"));\n");
@@ -2706,8 +2718,8 @@
                     GenerateImplementationFunctionCall($function, $functionString, "    ", $svgPropertyType, $interfaceName);
                 }
             } else {
-                if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) {
-                    push(@implContent, "    $className* castedThis = to${className}(exec->hostThisValue().toThis(exec, NotStrictMode));\n");
+                if ($interfaceName eq "DOMWindow") {
+                    push(@implContent, "    $className* castedThis = toJSDOMWindow(exec->hostThisValue().toThis(exec, NotStrictMode));\n");
                     push(@implContent, "    if (UNLIKELY(!castedThis))\n");
                     push(@implContent, "        return throwVMTypeError(exec);\n");
                 } elsif ($interface->extendedAttributes->{"WorkerGlobalScope"}) {

Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (166248 => 166249)


--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt	2014-03-25 20:40:34 UTC (rev 166248)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt	2014-03-25 20:43:27 UTC (rev 166249)
@@ -43,7 +43,6 @@
 CustomIsReachable
 CustomNamedGetter
 CustomNamedSetter
-CustomProxyToJSObject
 CustomPutFunction
 CustomReturn
 CustomSetter

Modified: trunk/Source/WebCore/page/DOMWindow.idl (166248 => 166249)


--- trunk/Source/WebCore/page/DOMWindow.idl	2014-03-25 20:40:34 UTC (rev 166248)
+++ trunk/Source/WebCore/page/DOMWindow.idl	2014-03-25 20:43:27 UTC (rev 166249)
@@ -30,7 +30,6 @@
     CustomDeleteProperty,
     CustomGetOwnPropertySlot,
     CustomEnumerateProperty,
-    CustomProxyToJSObject,
     JSCustomMarkFunction,
     JSCustomToNativeObject,
     CustomPutFunction,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to