2019-05-21 15:34:13 +00:00
|
|
|
// 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.
|
|
|
|
// Flags: --allow-natives-syntax --opt
|
|
|
|
|
|
|
|
%EnsureFeedbackVectorForFunction(foo);
|
|
|
|
function foo(x) {
|
|
|
|
return x * (x == 1);
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(foo);
|
2019-05-21 15:34:13 +00:00
|
|
|
foo(0.5);
|
|
|
|
foo(1.5);
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo(1.5);
|
|
|
|
assertOptimized(foo);
|