OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --allow-natives-syntax |
| 6 |
| 7 var dummy = new Int32Array(100); |
| 8 array = new Int32Array(100); |
| 9 var dummy2 = new Int32Array(100); |
| 10 |
| 11 array[-17] = 0; |
| 12 function fun(base,cond) { |
| 13 array[base - 1] = 1; |
| 14 array[base - 2] = 2; |
| 15 if (cond) { |
| 16 array[base - 4] = 3; |
| 17 array[base - 5] = 4; |
| 18 } else { |
| 19 array[base - 6] = 5; |
| 20 array[base - 100] = 777; |
| 21 } |
| 22 } |
| 23 fun(5,true); |
| 24 fun(7,false); |
| 25 %OptimizeFunctionOnNextCall(fun); |
| 26 fun(7,false); |
| 27 |
| 28 for (var i = 0; i < dummy.length; i++) { |
| 29 assertEquals(0, dummy[i]); |
| 30 } |
| 31 for (var i = 0; i < dummy2.length; i++) { |
| 32 assertEquals(0, dummy2[i]); |
| 33 } |
OLD | NEW |