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

Unified Diff: test/mjsunit/elide-double-hole-check-6.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-6.js
diff --git a/test/mjsunit/regress/regress-171641.js b/test/mjsunit/elide-double-hole-check-6.js
similarity index 86%
copy from test/mjsunit/regress/regress-171641.js
copy to test/mjsunit/elide-double-hole-check-6.js
index 8db6781821325f8f6253eb2df4abb2b362b001c0..01a8096f85c2381d400d436198daa59fe7ca9ce0 100644
--- a/test/mjsunit/regress/regress-171641.js
+++ b/test/mjsunit/elide-double-hole-check-6.js
@@ -27,14 +27,13 @@
// Flags: --allow-natives-syntax
-function foo(k, p) {
- for (var i = 0; i < 1; i++) {
- p = Math.min(p, i);
- }
- m = Math.floor((k | 0) / p);
+function f1(a, i) {
+ return a[i] + 0.5;
}
-
-foo(0, 1);
-foo(0, 1);
-%OptimizeFunctionOnNextCall(foo);
-foo(0, 1);
+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.__proto__[1] = 1.5;
+assertEquals(2, f1(arr, 1));

Powered by Google App Engine
This is Rietveld 408576698