regress-crbug-965513.js 419 Bytes
Newer Older
1 2 3
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
4
// Flags: --allow-natives-syntax --turbofan
5 6 7 8

%EnsureFeedbackVectorForFunction(foo);
function foo(x) {
  return x * (x == 1);
9 10
};
%PrepareFunctionForOptimization(foo);
11 12 13 14 15
foo(0.5);
foo(1.5);
%OptimizeFunctionOnNextCall(foo);
foo(1.5);
assertOptimized(foo);