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

Unified Diff: test/mjsunit/elide-double-hole-check-5.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-5.js
diff --git a/test/mjsunit/regress/regress-171641.js b/test/mjsunit/elide-double-hole-check-5.js
similarity index 85%
copy from test/mjsunit/regress/regress-171641.js
copy to test/mjsunit/elide-double-hole-check-5.js
index 8db6781821325f8f6253eb2df4abb2b362b001c0..d0970c8fe1f5d13419798df1de7c30fced885855 100644
--- a/test/mjsunit/regress/regress-171641.js
+++ b/test/mjsunit/elide-double-hole-check-5.js
@@ -27,14 +27,14 @@
// 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));
+Array.prototype[1] = 1.5;
+%OptimizeFunctionOnNextCall(f1);
+assertEquals(2, f1(arr, 1));
+assertEquals(2, f1(arr, 1));
+assertEquals(0.5, f1(arr, 0));

Powered by Google App Engine
This is Rietveld 408576698