Title: [135320] trunk/Source/WebCore
Revision
135320
Author
ad...@chromium.org
Date
2012-11-20 15:38:44 -0800 (Tue, 20 Nov 2012)

Log Message

[v8] Avoid unnecessary call to ToObject() in Callback constructors
https://bugs.webkit.org/show_bug.cgi?id=102831

Reviewed by Adam Barth.

The code already asserted that the argument was an object, so calling
ToObject() is unnecessary: a simple Cast() suffices.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateCallbackHeader):
* bindings/scripts/test/V8/V8TestCallback.h:
(WebCore::V8TestCallback::create):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135319 => 135320)


--- trunk/Source/WebCore/ChangeLog	2012-11-20 23:34:14 UTC (rev 135319)
+++ trunk/Source/WebCore/ChangeLog	2012-11-20 23:38:44 UTC (rev 135320)
@@ -1,3 +1,18 @@
+2012-11-20  Adam Klein  <ad...@chromium.org>
+
+        [v8] Avoid unnecessary call to ToObject() in Callback constructors
+        https://bugs.webkit.org/show_bug.cgi?id=102831
+
+        Reviewed by Adam Barth.
+
+        The code already asserted that the argument was an object, so calling
+        ToObject() is unnecessary: a simple Cast() suffices.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateCallbackHeader):
+        * bindings/scripts/test/V8/V8TestCallback.h:
+        (WebCore::V8TestCallback::create):
+
 2012-11-20  Brent Fulgham  <bfulg...@webkit.org>
 
         [WinCairo] Build fix after r135316

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (135319 => 135320)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-11-20 23:34:14 UTC (rev 135319)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-11-20 23:38:44 UTC (rev 135320)
@@ -3250,7 +3250,7 @@
     {
         ASSERT(value->IsObject());
         ASSERT(context);
-        return adoptRef(new ${v8InterfaceName}(value->ToObject(), context, owner));
+        return adoptRef(new ${v8InterfaceName}(v8::Handle<v8::Object>::Cast(value), context, owner));
     }
 
     virtual ~${v8InterfaceName}();

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.h (135319 => 135320)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.h	2012-11-20 23:34:14 UTC (rev 135319)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.h	2012-11-20 23:38:44 UTC (rev 135320)
@@ -39,7 +39,7 @@
     {
         ASSERT(value->IsObject());
         ASSERT(context);
-        return adoptRef(new V8TestCallback(value->ToObject(), context, owner));
+        return adoptRef(new V8TestCallback(v8::Handle<v8::Object>::Cast(value), context, owner));
     }
 
     virtual ~V8TestCallback();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to