OLD | NEW |
(Empty) | |
| 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: --allow-natives-syntax |
| 6 |
| 7 z = {}; |
| 8 t = new Uint8Array(3); |
| 9 var m = 0; |
| 10 var x = 10; |
| 11 |
| 12 function k() { |
| 13 ++m; |
| 14 if (m % 10 != 9) { |
| 15 if (m > 20) // This if is to just force it to deoptimize. |
| 16 x = '1'; // this deoptimizes during the second invocation of k. |
| 17 // This causes two deopts, one eager at x = 1 and the |
| 18 // other lazy at t[2] = z. |
| 19 t[2] = z; // since we are assigning to Uint8Array, ToNumber |
| 20 // is called which calls this funciton again. |
| 21 } |
| 22 } |
| 23 |
| 24 function f1() { |
| 25 z.toString = k; |
| 26 z.toString(); |
| 27 z.toString(); |
| 28 %OptimizeFunctionOnNextCall(k); |
| 29 z.toString(); |
| 30 } |
| 31 f1(); |
OLD | NEW |