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 --ignition --turbo-from-bytecode --turbo-filter
=f |
| 6 |
| 7 function f(x) { return x + 23 } |
| 8 function g(x) { return f(x) + 42 } |
| 9 |
| 10 assertEquals(23, f(0)); |
| 11 assertEquals(24, f(1)); |
| 12 assertEquals(67, g(2)); |
| 13 assertEquals(68, g(3)); |
| 14 |
| 15 // Optimize {g} with Crankshaft, causing {f} to be inlined. |
| 16 %OptimizeFunctionOnNextCall(g); |
| 17 assertEquals(65, g(0)); |
| 18 |
| 19 // Optimize {f} with Turbofan, after it has been inlined. |
| 20 %OptimizeFunctionOnNextCall(f); |
| 21 assertEquals(23, f(0)); |
OLD | NEW |