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

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

Issue 12918028: Canonicalize NaNs on store to Fast(Float|Double) arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 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/hydrogen-instructions.cc ('K') | « src/hydrogen-instructions.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-2596.js
diff --git a/test/mjsunit/regress/regress-2489.js b/test/mjsunit/regress/regress-2596.js
similarity index 73%
copy from test/mjsunit/regress/regress-2489.js
copy to test/mjsunit/regress/regress-2596.js
index 882c4f794a88e24d1d64e86a466b27c39f51e625..1d327fe0f8b756242da8b5f5798cbf9c6691adb1 100644
--- a/test/mjsunit/regress/regress-2489.js
+++ b/test/mjsunit/regress/regress-2596.js
@@ -27,24 +27,30 @@
// Flags: --allow-natives-syntax
-"use strict";
+var bytes = new Uint8Array([
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f]); // kHoleNaN
+var doubles = new Float64Array(bytes.buffer);
+assertTrue(isNaN(doubles[0]));
-function f(a, b) {
- return g("c", "d");
-}
+var prototype = [2.5, 2.5];
+var array = [3.5, 3.5];
+array.__proto__ = prototype;
+assertTrue(%HasFastDoubleElements(array));
-function g(a, b) {
- g.constructor.apply(this, arguments);
+function boom(index) {
+ array[index] = doubles[0];
+ return array[index];
}
-g.constructor = function(a, b) {
- assertEquals("c", a);
- assertEquals("d", b);
-}
+assertTrue(isNaN(boom(0)));
+assertTrue(isNaN(boom(0)));
+assertTrue(isNaN(boom(0)));
+
+// Test hydrogen
+%OptimizeFunctionOnNextCall(boom);
+assertTrue(isNaN(boom(0)));
+assertTrue(isNaN(boom(0)));
+assertTrue(isNaN(boom(0)));
+
+
-f("a", "b");
-f("a", "b");
-%OptimizeFunctionOnNextCall(f);
-f("a", "b");
-g.x = "deopt";
-f("a", "b");
« src/hydrogen-instructions.cc ('K') | « src/hydrogen-instructions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698