Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 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: --harmony-tailcalls --allow-natives-syntax |
| 6 | |
| 7 | "use strict"; |
| 8 | |
| 9 | function f(x) { |
| 10 | return x; |
| 11 | } |
| 12 | |
| 13 | function g(x) { |
| 14 | return false ? 0 : f(x, 1); |
| 15 | } |
| 16 | |
| 17 | function h(x) { |
| 18 | var z = g(x, 1); |
| 19 | return z + 1; |
| 20 | } |
| 21 | |
| 22 | %SetForceInlineFlag(g); |
| 23 | %SetForceInlineFlag(f); |
| 24 | |
| 25 | h(1); |
| 26 | h(1); |
| 27 | %OptimizeFunctionOnNextCall(h); |
| 28 | h("a"); |