Title: [166404] trunk/Source/WebCore
Revision
166404
Author
[email protected]
Date
2014-03-28 07:08:05 -0700 (Fri, 28 Mar 2014)

Log Message

Unreviewed, rolling r166249 back in.

Turns out r166070 didn't cause a 2% performance loss in page load times

Reverted changeset:

Unreviewed, rolling out r166070.
Rollout r166070 due to 2% performance loss in page load times

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (166403 => 166404)


--- trunk/Source/WebCore/ChangeLog	2014-03-28 10:34:05 UTC (rev 166403)
+++ trunk/Source/WebCore/ChangeLog	2014-03-28 14:08:05 UTC (rev 166404)
@@ -1,3 +1,14 @@
+2014-03-28  Michael Saboff  <[email protected]>
+
+        Unreviewed, rolling r166249 back in.
+
+        Turns out r166070 didn't cause a 2% performance loss in page load times
+
+        Reverted changeset:
+
+        Unreviewed, rolling out r166070.
+        Rollout r166070 due to 2% performance loss in page load times
+
 2014-03-28  James Craig  <[email protected]>
 
         Web Inspector: Copy/paste error. EventListener block in DOM.json uses description from Node.

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (166403 => 166404)


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


--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt	2014-03-28 10:34:05 UTC (rev 166403)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt	2014-03-28 14:08:05 UTC (rev 166404)
@@ -43,6 +43,7 @@
 CustomIsReachable
 CustomNamedGetter
 CustomNamedSetter
+CustomProxyToJSObject
 CustomPutFunction
 CustomReturn
 CustomSetter

Modified: trunk/Source/WebCore/page/DOMWindow.idl (166403 => 166404)


--- trunk/Source/WebCore/page/DOMWindow.idl	2014-03-28 10:34:05 UTC (rev 166403)
+++ trunk/Source/WebCore/page/DOMWindow.idl	2014-03-28 14:08:05 UTC (rev 166404)
@@ -30,6 +30,7 @@
     CustomDeleteProperty,
     CustomGetOwnPropertySlot,
     CustomEnumerateProperty,
+    CustomProxyToJSObject,
     JSCustomMarkFunction,
     JSCustomToNativeObject,
     CustomPutFunction,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to