OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 --min-preparse-length=10 |
| 6 |
| 7 let x; |
| 8 function f(a) { |
| 9 x += a; |
| 10 } |
| 11 function g(a) { |
| 12 f(a); return x; |
| 13 } |
| 14 function h(a) { |
| 15 x = a; return x; |
| 16 } |
| 17 |
| 18 function boom() { return g(1) } |
| 19 |
| 20 assertEquals(1, h(1)); |
| 21 assertEquals(2, boom()); |
| 22 assertEquals(3, boom()); |
| 23 %OptimizeFunctionOnNextCall(boom); |
| 24 assertEquals(4, boom()); |
OLD | NEW |