Chromium Code Reviews| 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 | |
|
rmcilroy
2016/08/24 13:31:34
should this be --ignition-staging, or is --ignitio
Michael Starzinger
2016/08/24 13:42:35
The "--ignition --turbo-from-bytecode" combination
| |
| 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 TruboFan, after it has been inlined. | |
|
rmcilroy
2016/08/24 13:31:34
/s/TruboFan/Turbofan
Michael Starzinger
2016/08/24 13:42:35
Done.
| |
| 20 %OptimizeFunctionOnNextCall(f); | |
| 21 assertEquals(23, f(0)); | |
| OLD | NEW |