Title: [196999] trunk/Source/_javascript_Core
Revision
196999
Author
[email protected]
Date
2016-02-23 14:41:26 -0800 (Tue, 23 Feb 2016)

Log Message

Make JSObject::getMethod have fewer branches
https://bugs.webkit.org/show_bug.cgi?id=154603

Reviewed by Mark Lam.

Writing code with fewer branches is almost always better.

* runtime/JSObject.cpp:
(JSC::JSObject::getMethod):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (196998 => 196999)


--- trunk/Source/_javascript_Core/ChangeLog	2016-02-23 22:35:44 UTC (rev 196998)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-02-23 22:41:26 UTC (rev 196999)
@@ -1,3 +1,15 @@
+2016-02-23  Saam barati  <[email protected]>
+
+        Make JSObject::getMethod have fewer branches
+        https://bugs.webkit.org/show_bug.cgi?id=154603
+
+        Reviewed by Mark Lam.
+
+        Writing code with fewer branches is almost always better.
+
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::getMethod):
+
 2016-02-23  Filip Pizlo  <[email protected]>
 
         B3::Value doesn't self-destruct virtually enough (Causes many leaks in LowerDFGToB3::appendOSRExit)

Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (196998 => 196999)


--- trunk/Source/_javascript_Core/runtime/JSObject.cpp	2016-02-23 22:35:44 UTC (rev 196998)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp	2016-02-23 22:41:26 UTC (rev 196999)
@@ -2947,10 +2947,10 @@
     if (exec->hadException())
         return jsUndefined();
 
-    if (method.isUndefined() || method.isNull())
-        return jsUndefined();
+    if (!method.isCell()) {
+        if (method.isUndefinedOrNull())
+            return jsUndefined();
 
-    if (!method.isCell()) {
         throwVMTypeError(exec, errorMessage);
         return jsUndefined();
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to