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

Unified Diff: test/mjsunit/elide-double-hole-check-4.js

Issue 15014020: Elide hole checks on KeyedLoads of holey double arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Implement missing platforms and add tests Created 7 years, 7 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
Index: test/mjsunit/elide-double-hole-check-4.js
diff --git a/test/mjsunit/regress/regress-2451.js b/test/mjsunit/elide-double-hole-check-4.js
similarity index 87%
copy from test/mjsunit/regress/regress-2451.js
copy to test/mjsunit/elide-double-hole-check-4.js
index 465e4e68c26f3e3e119cbaf82d50c8f83c6efa9a..e2a55055710d6aa222ca4c4aecfbe3926d9c5cca 100644
--- a/test/mjsunit/regress/regress-2451.js
+++ b/test/mjsunit/elide-double-hole-check-4.js
@@ -27,15 +27,13 @@
// Flags: --allow-natives-syntax
-function f() {
- assertEquals(-1.0, Math.round(-1.5));
- assertEquals(-2.0, Math.round(-2.5));
- assertEquals(-1.0, Math.round(-0.5000000000000001));
+function f1(a, i) {
+ return a[i] + 0.5;
}
-
-f();
-f();
-%OptimizeFunctionOnNextCall(f);
-f();
-assertTrue(%GetOptimizationStatus(f) != 2);
-
+var arr = [0.0,,2.5];
+assertEquals(0.5, f1(arr, 0));
+assertEquals(0.5, f1(arr, 0));
+%OptimizeFunctionOnNextCall(f1);
+assertEquals(0.5, f1(arr, 0));
+Array.prototype[1] = 1.5;
+assertEquals(2, f1(arr, 1));

Powered by Google App Engine
This is Rietveld 408576698