Index: test/mjsunit/regress/regress-mul-canoverflow.js |
diff --git a/test/mjsunit/regress/regress-2489.js b/test/mjsunit/regress/regress-mul-canoverflow.js |
similarity index 83% |
copy from test/mjsunit/regress/regress-2489.js |
copy to test/mjsunit/regress/regress-mul-canoverflow.js |
index 882c4f794a88e24d1d64e86a466b27c39f51e625..e3e21caec8f96d118273491d0f34d88b957ecf50 100644 |
--- a/test/mjsunit/regress/regress-2489.js |
+++ b/test/mjsunit/regress/regress-mul-canoverflow.js |
@@ -27,24 +27,19 @@ |
// Flags: --allow-natives-syntax |
-"use strict"; |
- |
-function f(a, b) { |
- return g("c", "d"); |
+function boom(a) { |
+ return ((a | 0) * (a | 0)) | 0; |
} |
- |
-function g(a, b) { |
- g.constructor.apply(this, arguments); |
+function boom_unoptimized(a) { |
+ try {} catch(_) {} |
+ return ((a | 0) * (a | 0)) | 0; |
} |
-g.constructor = function(a, b) { |
- assertEquals("c", a); |
- assertEquals("d", b); |
-} |
+boom(1, 1); |
+boom(2, 2); |
-f("a", "b"); |
-f("a", "b"); |
-%OptimizeFunctionOnNextCall(f); |
-f("a", "b"); |
-g.x = "deopt"; |
-f("a", "b"); |
+%OptimizeFunctionOnNextCall(boom); |
+var big_int = 0x5F00000F; |
+var expected = boom_unoptimized(big_int); |
+var actual = boom(big_int) |
+assertEquals(expected, actual); |