interrupt-budget-override.js 497 Bytes
Newer Older
1 2 3 4
// 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.

5
// Flags: --opt --interrupt-budget=100 --interrupt-budget-for-feedback-allocation=10 --allow-natives-syntax
6 7 8 9 10 11 12 13 14

function f() {
  let s = 0;
  for (let i = 0; i < 10; i++) {
    s += i;
  }
  return s;
}

15
%PrepareFunctionForOptimization(f, "allow heuristic optimization");
16 17
f();
f();
18
f();
19
%FinalizeOptimization();
20
assertOptimized(f);