blob: 5dd794db47671424c36d05107656e18cc75490b7 [file] [log] [blame]
Andrew Top63c7ad42019-11-25 16:10:13 -08001// 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() {
7function foo(x) {
8 const i = x > 0;
9 const dv = new DataView(ab);
10 return dv.getUint16(i);
11};
12%PrepareFunctionForOptimization(foo);
13const ab = new ArrayBuffer(2);
14foo(0);
15foo(0);
16%OptimizeFunctionOnNextCall(foo);
17foo(0);
18})();