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

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

Issue 2167643002: [Turbofan] Make the -0 deopt case more efficient in multiplication. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
Index: test/mjsunit/compiler/math-mul.js
diff --git a/test/mjsunit/compiler/math-mul.js b/test/mjsunit/compiler/math-mul.js
index 7defb2904318e5d5eeb69d582ac3b982ed34d3f1..5b8b1333f97835323ab54bb8f2e84831d1e66fd7 100644
--- a/test/mjsunit/compiler/math-mul.js
+++ b/test/mjsunit/compiler/math-mul.js
@@ -35,3 +35,12 @@ const SMI_MIN = -SMI_MAX - 1; // Create without overflowing.
// multiply by 3 to avoid compiler optimizations that convert 2*x to x + x.
assertEquals(SMI_MAX + SMI_MAX + SMI_MAX, test(SMI_MAX, 3));
+
+// Verify that strength reduction will reduce the -0 check quite a bit
+// if we have a negative integer constant.
+function negtest(y) { return -3 * y; }
+assertEquals(-12, negtest(4));
+assertEquals(-12, negtest(4));
+%OptimizeFunctionOnNextCall(negtest);
+negtest(4);
+

Powered by Google App Engine
This is Rietveld 408576698