Andrew Top | 63c7ad4 | 2019-11-25 16:10:13 -0800 | [diff] [blame] | 1 | // Copyright 2019 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 | // Flags: --allow-natives-syntax |
| 5 | |
| 6 | (function() { |
| 7 | function foo(x) { |
| 8 | const i = x > 0; |
| 9 | const dv = new DataView(ab); |
| 10 | return dv.getUint16(i); |
| 11 | }; |
| 12 | %PrepareFunctionForOptimization(foo); |
| 13 | const ab = new ArrayBuffer(2); |
| 14 | foo(0); |
| 15 | foo(0); |
| 16 | %OptimizeFunctionOnNextCall(foo); |
| 17 | foo(0); |
| 18 | })(); |