| 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);
|
|
|