| // Copyright 2015 the V8 project authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // Flags: --allow-natives-syntax |
| function test(expected, f) { |
| assertEquals(expected, f()); |
| assertEquals(expected, f()); |
| %OptimizeFunctionOnNextCall(f); |
| assertEquals(expected, f()); |
| assertEquals(expected, f()); |
| %OptimizeFunctionOnNextCall(f); |
| function f1() { return a; } |
| function f2() { return b; } |
| function f3() { return c; } |
| function f4() { return d; } |