2019-05-28 08:46:21 -04: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.
|
|
|
|
|
2023-10-05 08:46:07 +02:00
|
|
|
// Flags: --turbofan --invocation-count-for-turbofan=2 --interrupt-budget-for-feedback-allocation=10 --allow-natives-syntax --nomaglev --minimum-invocations-before-optimization=0
|
2019-05-28 08:46:21 -04:00
|
|
|
|
|
|
|
function f() {
|
|
|
|
let s = 0;
|
|
|
|
for (let i = 0; i < 10; i++) {
|
|
|
|
s += i;
|
|
|
|
}
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
2022-11-22 09:57:37 -05:00
|
|
|
%EnsureFeedbackVectorForFunction(f);
|
2019-09-24 11:56:38 -04:00
|
|
|
f();
|
2019-05-28 08:46:21 -04:00
|
|
|
f();
|
|
|
|
f();
|
2021-09-17 14:34:02 +02:00
|
|
|
%FinalizeOptimization();
|
2019-05-28 08:46:21 -04:00
|
|
|
assertOptimized(f);
|