Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: test/mjsunit/compiler/shift-shr.js

Issue 2709423002: [compiler] Speculate a little more in SpeculativeShiftRightLogical. (Closed)
Patch Set: Address feedback. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/shift-shr.js
diff --git a/test/mjsunit/compiler/shift-shr.js b/test/mjsunit/compiler/shift-shr.js
index 52cd370e427161d1bce33431647245c12300ad25..c52ad43ac5115e58dfdc2e637da369584cd67f58 100644
--- a/test/mjsunit/compiler/shift-shr.js
+++ b/test/mjsunit/compiler/shift-shr.js
@@ -24,3 +24,32 @@ assertEquals(0, test_shr(1));
for (var i = 5; i >= -5; i--) {
assertEquals(0, test_shr(i));
}
+
+
+(function () {
+ function foo(x, b, array) {
+ var y;
+ x = x >>> 0;
+ b ? (y = x | 0) : (y = x);
+ return array[y];
+ }
+
+ foo(111, true, new Array(42));
+ foo(111, true, new Array(42));
+ %OptimizeFunctionOnNextCall(foo);
+ foo(-111, true, new Array(42));
+})();
+
+(function () {
+ function foo(x, b, array) {
+ var y;
+ x = x >>> 0;
+ b ? (y = x | 0) : (y = x);
+ return array[y];
+ }
+
+ foo(111, true, new Array(42));
+ foo(111, true, new Array(42));
+ %OptimizeFunctionOnNextCall(foo);
+ foo(111, true, new Array(42));
+})();
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698