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

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

Issue 11618017: Deopt on overflow in integer mod. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-166379.js
diff --git a/test/mjsunit/regress/regress-2045.js b/test/mjsunit/regress/regress-166379.js
similarity index 86%
copy from test/mjsunit/regress/regress-2045.js
copy to test/mjsunit/regress/regress-166379.js
index 822ee1fa4641b4a0ba15eee2c2a2e59411db7d4d..b19afbdde630e4eef2b14da12fae14349dbe0d2a 100644
--- a/test/mjsunit/regress/regress-2045.js
+++ b/test/mjsunit/regress/regress-166379.js
@@ -27,23 +27,13 @@
// Flags: --allow-natives-syntax
-function foo() {
- assertEquals(2, arguments.length);
-}
+function mod(a, b) { return a % b; }
-function bar() {
- G.x;
- return foo.apply(this, arguments);
-}
+// Feed integer type info and optimize.
+assertEquals(0, mod(4, 2));
+assertEquals(1, mod(3, 2));
+%OptimizeFunctionOnNextCall(mod);
-function baz() {
- return bar(1, 2);
-}
+// Surprise mod with overflow.
+assertEquals(-Infinity, 1/mod(-2147483648, -1));
-G = {x: 0};
-baz();
-baz();
-%OptimizeFunctionOnNextCall(baz);
-baz();
-delete G.x;
-baz();
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698