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

Unified Diff: test/mjsunit/compiler/math-mul.js

Issue 2154073002: [Turbofan]: Eliminate the check for -0 if it's not possible/observable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 4 years, 5 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-operator.cc ('k') | test/mjsunit/math-mul.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/math-mul.js
diff --git a/test/mjsunit/math-mul.js b/test/mjsunit/compiler/math-mul.js
similarity index 59%
rename from test/mjsunit/math-mul.js
rename to test/mjsunit/compiler/math-mul.js
index 027bb6024a26c5896c51507095a8e9c943fda3ab..7defb2904318e5d5eeb69d582ac3b982ed34d3f1 100644
--- a/test/mjsunit/math-mul.js
+++ b/test/mjsunit/compiler/math-mul.js
@@ -4,6 +4,20 @@
// Flags: --allow-natives-syntax
+// For TurboFan, make sure we can eliminate the -0 return value check
+// by recognizing a constant value.
+function gotaconstant(y) { return 15 * y; }
+assertEquals(45, gotaconstant(3));
+gotaconstant(3);
+%OptimizeFunctionOnNextCall(gotaconstant);
+gotaconstant(3);
+
+function gotaconstant_truncated(x, y) { return x * y | 0; }
+assertEquals(45, gotaconstant_truncated(3, 15));
+gotaconstant_truncated(3, 15);
+%OptimizeFunctionOnNextCall(gotaconstant_truncated);
+gotaconstant_truncated(3, 15);
+
function test(x, y) { return x * y; }
assertEquals(12, test(3, 4));
« no previous file with comments | « src/compiler/simplified-operator.cc ('k') | test/mjsunit/math-mul.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698