Title: [241335] trunk/Source/_javascript_Core
Revision
241335
Author
rmoris...@apple.com
Date
2019-02-12 18:30:13 -0800 (Tue, 12 Feb 2019)

Log Message

Make B3Value::returnsBool() more precise
https://bugs.webkit.org/show_bug.cgi?id=194457

Reviewed by Saam Barati.

It is currently used repeatedly in B3ReduceStrength, as well as once in B3LowerToAir.
It has a needlessly complex rule for BitAnd, and has no rule for other easy cases such as BitOr or Select.
No new tests added as this should be indirectly tested by the already existing tests.

* b3/B3Value.cpp:
(JSC::B3::Value::returnsBool const):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (241334 => 241335)


--- trunk/Source/_javascript_Core/ChangeLog	2019-02-13 01:34:34 UTC (rev 241334)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-02-13 02:30:13 UTC (rev 241335)
@@ -1,3 +1,17 @@
+2019-02-12  Robin Morisset  <rmoris...@apple.com>
+
+        Make B3Value::returnsBool() more precise
+        https://bugs.webkit.org/show_bug.cgi?id=194457
+
+        Reviewed by Saam Barati.
+
+        It is currently used repeatedly in B3ReduceStrength, as well as once in B3LowerToAir.
+        It has a needlessly complex rule for BitAnd, and has no rule for other easy cases such as BitOr or Select.
+        No new tests added as this should be indirectly tested by the already existing tests.
+
+        * b3/B3Value.cpp:
+        (JSC::B3::Value::returnsBool const):
+
 2019-02-12  Michael Catanzaro  <mcatanz...@igalia.com>
 
         Unreviewed, fix -Wimplicit-fallthrough warning after r241140

Modified: trunk/Source/_javascript_Core/b3/B3Value.cpp (241334 => 241335)


--- trunk/Source/_javascript_Core/b3/B3Value.cpp	2019-02-13 01:34:34 UTC (rev 241334)
+++ trunk/Source/_javascript_Core/b3/B3Value.cpp	2019-02-13 02:30:13 UTC (rev 241335)
@@ -499,8 +499,14 @@
     case Const32:
         return asInt32() == 0 || asInt32() == 1;
     case BitAnd:
-        return child(1)->isInt32(1)
-            || (child(0)->returnsBool() && child(1)->hasInt() && child(1)->asInt() & 1);
+        return child(0)->returnsBool() || child(1)->returnsBool();
+    case BitOr:
+    case BitXor:
+        return child(0)->returnsBool() && child(1)->returnsBool();
+    case Select:
+        return child(1)->returnsBool() && child(2)->returnsBool();
+    case Identity:
+        return child(0)->returnsBool();
     case Equal:
     case NotEqual:
     case LessThan:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to