2017-06-06 10:28:14 +02:00
|
|
|
// Copyright 2017 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.
|
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
// Flags: --allow-natives-syntax --turbofan --no-always-turbofan
|
2019-08-01 08:38:30 +02:00
|
|
|
// The deopt count is stored in the feedback vector which gets cleared when
|
|
|
|
// bytecode is flushed, which --gc-interval can cause in stress modes.
|
2021-09-17 14:34:02 +02:00
|
|
|
// Flags: --no-flush-bytecode --no-stress-flush-code
|
2017-06-06 10:28:14 +02:00
|
|
|
|
2019-08-16 11:32:46 +02:00
|
|
|
function foo() {};
|
|
|
|
%PrepareFunctionForOptimization(foo);
|
2017-06-06 10:28:14 +02:00
|
|
|
foo();
|
|
|
|
foo();
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo();
|
|
|
|
|
|
|
|
assertOptimized(foo);
|
|
|
|
|
|
|
|
// Unlink the function.
|
|
|
|
%DeoptimizeFunction(foo);
|
|
|
|
|
|
|
|
assertUnoptimized(foo);
|
|
|
|
|
|
|
|
foo();
|
|
|
|
|
|
|
|
assertUnoptimized(foo);
|