1// Copyright 2015 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
6
7"use strict";
8
9function Message(message) {
10  this.message = message;
11}
12
13function Inlined(input) {
14  var dummy = arguments[1] === undefined;
15  if (input instanceof Message) {
16    return input;
17  }
18  print("unreachable, but we must create register allocation complexity");
19  return [];
20}
21
22function Process(input) {
23  var ret = [];
24  ret.push(Inlined(input[0], 1, 2));
25  return ret;
26}
27
28var input = [new Message("TEST PASS")];
29
30Process(input);
31Process(input);
32%OptimizeFunctionOnNextCall(Process);
33var result = Process(input);
34assertEquals("TEST PASS", result[0].message);
35