v8/test/mjsunit/interrupt-budget-override.js
Jaroslav Sevcik b47449d5d6 Expose interrupt budget as a runtime flag.
This is particularly useful to fuzzers that seek to provoke
optimization.

Bug: v8:9119
Change-Id: I729f72a0e22686fbd56793875175c230e0230823
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1564196
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60794}
2019-04-11 20:49:29 +00:00

19 lines
389 B
JavaScript

// 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.
// Flags: --opt --interrupt-budget=100 --allow-natives-syntax
function f() {
let s = 0;
for (let i = 0; i < 10; i++) {
s += i;
}
return s;
}
%PrepareFunctionForOptimization(f);
f();
f();
assertOptimized(f);