OLD | NEW |
(Empty) | |
| 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 |
| 9 function Message(message) { |
| 10 this.message = message; |
| 11 } |
| 12 |
| 13 function 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 |
| 22 function Process(input) { |
| 23 var ret = []; |
| 24 ret.push(Inlined(input[0], 1, 2)); |
| 25 return ret; |
| 26 } |
| 27 |
| 28 var input = [new Message("TEST PASS")]; |
| 29 |
| 30 Process(input); |
| 31 Process(input); |
| 32 %OptimizeFunctionOnNextCall(Process); |
| 33 var result = Process(input); |
| 34 assertEquals("TEST PASS", result[0].message); |
OLD | NEW |