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

Unified Diff: test/mjsunit/regress/regress-int32-truncation.js

Issue 16656002: Take all uses into account to clear int32 truncation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Space man Created 7 years, 6 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/hydrogen.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-int32-truncation.js
diff --git a/test/mjsunit/regress/regress-2489.js b/test/mjsunit/regress/regress-int32-truncation.js
similarity index 81%
copy from test/mjsunit/regress/regress-2489.js
copy to test/mjsunit/regress/regress-int32-truncation.js
index 882c4f794a88e24d1d64e86a466b27c39f51e625..dec4ac1195a6c4928d84eac8cc8dc9496bf66600 100644
--- a/test/mjsunit/regress/regress-2489.js
+++ b/test/mjsunit/regress/regress-int32-truncation.js
@@ -27,24 +27,35 @@
// Flags: --allow-natives-syntax
-"use strict";
-
-function f(a, b) {
- return g("c", "d");
+function f(i, b) {
+ var a = 0;
+ if (b) {
+ var c = 1 << i;
+ a = c + c;
+ }
+ var x = a >> 3;
+ return a;
}
-function g(a, b) {
- g.constructor.apply(this, arguments);
-}
+f(1, false);
+f(1, true);
+%OptimizeFunctionOnNextCall(f);
+assertEquals((1 << 30) * 2, f(30, true));
-g.constructor = function(a, b) {
- assertEquals("c", a);
- assertEquals("d", b);
+
+var global = 1;
+
+function f2(b) {
+ var a = 0;
+ if (b) {
+ a = global;
+ }
+ var x = a >> 3;
+ return a;
}
-f("a", "b");
-f("a", "b");
-%OptimizeFunctionOnNextCall(f);
-f("a", "b");
-g.x = "deopt";
-f("a", "b");
+f2(false);
+f2(true);
+%OptimizeFunctionOnNextCall(f2);
+global = 2.5;
+assertEquals(global, f2(true));
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698