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

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

Issue 199013002: Correctly retain argument value when deopting from Math.round on x64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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
« src/x64/lithium-codegen-x64.cc ('K') | « src/x64/lithium-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-351624.js
diff --git a/test/mjsunit/regress/regress-351624.js b/test/mjsunit/regress/regress-351624.js
new file mode 100644
index 0000000000000000000000000000000000000000..3d217fff6685755e80041c37f918e50e18147006
--- /dev/null
+++ b/test/mjsunit/regress/regress-351624.js
@@ -0,0 +1,27 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+var big = 1e10;
+var backup = new Float64Array(1);
+
+function mult0(val){
+ var prod = val * big;
+ backup[0] = prod;
+ print("input: " + prod);
Jakob Kummerow 2014/03/13 12:50:01 don't need print() for non-interactive use
+ var rounded = Math.round(prod);
+ print("rounded: " + rounded);
+ if (prod !== backup[0]) throw new Error("arg!");
Jakob Kummerow 2014/03/13 12:50:01 use assertEquals(backup[0], prod) here
+ return rounded;
+}
+
+var count = 5;
+for (var i = 0; i < count; i++) {
+ if (i == count - 1) %OptimizeFunctionOnNextCall(mult0);
+ var result = mult0(-1);
+ if (result != -big) {
Jakob Kummerow 2014/03/13 12:50:01 assertEquals(-big, result)
+ throw new Error('Iteration ' + i + ': ' + result);
+ }
+}
« src/x64/lithium-codegen-x64.cc ('K') | « src/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698