1 // Copyright 2014 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.
5 // Flags: --allow-natives-syntax
8 function f(a, b, mode) {
16 // Gather type feedback for both branches.
27 // Gather type feedback for g, but only on one branch for f.
30 %OptimizeFunctionOnNextCall(g);
31 // Optimize g, which inlines f. Both branches in f will see the constant.
36 function f(a, b, mode) {
44 // Gather type feedback for both branches.
45 f({ a : 1}, {b : 1}, 1);
46 f({ c : 1}, {d : 1}, 1);
47 f({ a : 1}, {c : 1}, 0);
48 f({ b : 1}, {d : 1}, 0);
55 // Gather type feedback for g, but only on one branch for f.
58 %OptimizeFunctionOnNextCall(g);
59 // Optimize g, which inlines f. Both branches in f will see the constant.