2020-03-05 10:49:19 -08: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.
|
|
|
|
|
2021-06-08 14:04:59 +02:00
|
|
|
// Flags: --allow-natives-syntax --stack-size=100 --ignore-unhandled-promises
|
2020-03-05 10:49:19 -08:00
|
|
|
|
|
|
|
let i = 0;
|
|
|
|
function f() {
|
|
|
|
i++;
|
|
|
|
if (i > 10) {
|
|
|
|
%PrepareFunctionForOptimization(f);
|
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
new Promise(f);
|
|
|
|
return f.x;
|
|
|
|
}
|
|
|
|
f();
|