2019-11-28 09:23:19 +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.
|
|
|
|
|
2022-04-28 14:22:23 +00:00
|
|
|
// Flags: --allow-natives-syntax --turbofan --no-always-turbofan
|
2019-11-28 09:23:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
function bar() { return foo(); }
|
|
|
|
function foo() { return %IsBeingInterpreted(); }
|
|
|
|
|
|
|
|
%PrepareFunctionForOptimization(bar);
|
|
|
|
%PrepareFunctionForOptimization(foo);
|
|
|
|
|
|
|
|
assertTrue(bar());
|
|
|
|
assertTrue(bar());
|
2022-02-23 13:48:02 +00:00
|
|
|
%OptimizeFunctionOnNextCall(bar);
|
2019-11-28 09:23:19 +00:00
|
|
|
assertFalse(bar());
|