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

Unified Diff: test/mjsunit/array-bounds-check-removal.js

Issue 10581014: BoundsCheck should be extended to support array_bounds_checks_elimination (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 6 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
« no previous file with comments | « 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/array-bounds-check-removal.js
===================================================================
--- test/mjsunit/array-bounds-check-removal.js (revision 11854)
+++ test/mjsunit/array-bounds-check-removal.js (working copy)
@@ -123,7 +123,7 @@
// ALWAYS: 3
// NEVER: 4
-if (false) {
+if (true) {
test_base(5,true);
test_base(6,true);
test_base(5,false);
@@ -143,3 +143,26 @@
gc();
+var b1 = new Array(2000);
+var b2 = new Array(200);
+
+function test_bounds_calc_overflow(a,base) {
+ a[base + 11] = 3;
+ a[base] = 4;
+ a[base + 999] = 5;
+}
+
+var i;
+var b0 = new Array(10000);
+for (i = 0; i < b0.length; i++)
+ b0[i] = 0xFEED;
+
+test_bounds_calc_overflow(b1, 10);
+%OptimizeFunctionOnNextCall(test_bounds_calc_overflow);
+test_bounds_calc_overflow(b2, 0);
+
+for (i = 0; i < b0.length; i++)
+ assertEquals(0xFEED, b0[i]);
+assertEquals(1000, b2.length);
+assertEquals(5, b2[999]);
+assertTrue(%GetOptimizationStatus(test_bounds_calc_overflow) != 1);
« no previous file with comments | « src/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698