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

Unified Diff: test/mjsunit/regress/regress-2339.js

Issue 10963032: Avoid wrong imul deopt on ia32 and x64 (fixes v8 bug 2339). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments. Created 8 years, 3 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/regress/regress-2339.js
diff --git a/test/mjsunit/deopt-minus-zero.js b/test/mjsunit/regress/regress-2339.js
similarity index 86%
copy from test/mjsunit/deopt-minus-zero.js
copy to test/mjsunit/regress/regress-2339.js
index ee0983127dc3ae10311cf11a88ba40284e366dfe..9b82ca189b26f6838141ffa58860de2af13fc222 100644
--- a/test/mjsunit/deopt-minus-zero.js
+++ b/test/mjsunit/regress/regress-2339.js
@@ -31,6 +31,7 @@
* The possible optimization states of a function. Must be in sync with the
* return values of Runtime_GetOptimizationStatus() in runtime.cc!
*/
+
var OptimizationState = {
YES: 1,
NO: 2,
@@ -38,19 +39,19 @@ var OptimizationState = {
NEVER: 4
};
-function mul (a, b) {
- return a * b;
+function simple() {
+ return simple_two_args(0, undefined);
}
-mul(-1, -1);
-mul(0x80000001|0, -1);
-mul(0x80000001|0, -1);
-%OptimizeFunctionOnNextCall(mul);
-mul(0, -1);
-%OptimizeFunctionOnNextCall(mul);
-mul(0, -1);
+function simple_two_args(always_zero, always_undefined) {
+ var always_five = always_undefined || 5;
+ return always_zero * always_five * .5;
+}
-var raw_optimized = %GetOptimizationStatus(mul);
+for (var i = 0; i < 10000; i++) {
Jakob Kummerow 2012/09/26 09:26:41 can we use %OptimizeFunctionOnNextCall here too? -
+ simple();
+}
+var raw_optimized = %GetOptimizationStatus(simple);
assertFalse(raw_optimized == OptimizationState.NO);
gc();
« test/mjsunit/regress/regress-1117.js ('K') | « test/mjsunit/regress/regress-1117.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698