OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 (function() { |
| 8 function doShift(a) { return a.shift(); } |
| 9 |
| 10 function test() { |
| 11 var a = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]; |
| 12 assertEquals(0, doShift(a)); |
| 13 assertEquals([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], a); |
| 14 } |
| 15 |
| 16 test(); |
| 17 test(); |
| 18 %OptimizeFunctionOnNextCall(doShift); |
| 19 test(); |
| 20 })(); |
| 21 |
| 22 (function() { |
| 23 function doShift(a) { return a.shift(); } |
| 24 |
| 25 function test() { |
| 26 var a = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16.1]; |
| 27 assertEquals(0, doShift(a)); |
| 28 assertEquals([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16.1], a); |
| 29 } |
| 30 |
| 31 test(); |
| 32 test(); |
| 33 %OptimizeFunctionOnNextCall(doShift); |
| 34 test(); |
| 35 })(); |
| 36 |
| 37 (function() { |
| 38 function doShift(a) { return a.shift(); } |
| 39 |
| 40 function test() { |
| 41 var a = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,"16"]; |
| 42 assertEquals(0, doShift(a)); |
| 43 assertEquals([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,"16"], a); |
| 44 } |
| 45 |
| 46 test(); |
| 47 test(); |
| 48 %OptimizeFunctionOnNextCall(doShift); |
| 49 test(); |
| 50 })(); |
OLD | NEW |