Bug 1808373: Set warmup threshold using |jit-test| r=jonco

With `--baseline-eager`, the default Ion warmup threshold gets baked into the top-level script before we can set it with `setJitCompilerOption`. This can prevent us from getting into Ion when expected.

To be safe, in addition to fixing bug1343513.js and bug1343513-2.js, I updated every jit-test that uses `inIon()` and `setJitCompilerOption("ion.warmup.trigger", ...)`. I don't think anything can go wrong if `inIon` is not in the top level script, but better safe than sorry.

Differential Revision: https://phabricator.services.mozilla.com/D166815
This commit is contained in:
Iain Ireland 2023-01-16 17:57:24 +00:00
Родитель 34e5ec560b
Коммит fcebb7d02d
19 изменённых файлов: 22 добавлений и 29 удалений

Просмотреть файл

@ -1,5 +1,4 @@
// |jit-test| error:RangeError; skip-if: largeArrayBufferSupported()
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| error:RangeError; skip-if: largeArrayBufferSupported(); --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,5 +1,4 @@
// |jit-test| error:RangeError; skip-if: largeArrayBufferSupported()
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| error:RangeError; skip-if: largeArrayBufferSupported(); --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,8 +1,7 @@
// |jit-test| skip-if: !this.getJitCompilerOptions() || !getJitCompilerOptions()['ion.enable']
// |jit-test| skip-if: !this.getJitCompilerOptions() || !getJitCompilerOptions()['ion.enable']; --ion-warmup-threshold=50
// Test inlining in Ion of fun.apply(..., array).
setJitCompilerOption("ion.warmup.trigger", 50);
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 20);
// |jit-test| --ion-warmup-threshold=20
function testBailout() {
function f(v, r) {

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 20);
// |jit-test| --ion-warmup-threshold=20
function testBailout() {
function f(v, r) {

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 20);
// |jit-test| --ion-warmup-threshold=20
function testBailout() {
function f(v, r) {

Просмотреть файл

@ -1,6 +1,4 @@
// |jit-test| error: ReferenceError
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| error: ReferenceError; --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
gcPreserveCode();

Просмотреть файл

@ -1,9 +1,8 @@
// |jit-test| --ion-offthread-compile=off;
// |jit-test| --ion-offthread-compile=off; --ion-warmup-threshold=30
// We disable any off-main thread compilation, and set a definite trigger for
// Ion compilation, such that we can garantee that we would OSR into the inner
// loop before we reach the end of the loop.
setJitCompilerOption("ion.warmup.trigger", 30);
gcPreserveCode();
function f (n) {

Просмотреть файл

@ -1,6 +1,6 @@
var ArrayBufferByteLength = getSelfHostedValue("ArrayBufferByteLength");
// |jit-test| --ion-warmup-threshold=50
setJitCompilerOption("ion.warmup.trigger", 50);
var ArrayBufferByteLength = getSelfHostedValue("ArrayBufferByteLength");
function testBasic() {
var arr = [1, 2, 3];

Просмотреть файл

@ -1,6 +1,6 @@
var IsCallable = getSelfHostedValue("IsCallable");
// |jit-test| --ion-warmup-threshold=50
setJitCompilerOption("ion.warmup.trigger", 50);
var IsCallable = getSelfHostedValue("IsCallable");
function testSinglePrimitive() {
var f1 = function() { assertEq(IsCallable(undefined), false); };

Просмотреть файл

@ -1,6 +1,6 @@
var PossiblyWrappedArrayBufferByteLength = getSelfHostedValue("PossiblyWrappedArrayBufferByteLength");
// |jit-test| --ion-warmup-threshold=50
setJitCompilerOption("ion.warmup.trigger", 50);
var PossiblyWrappedArrayBufferByteLength = getSelfHostedValue("PossiblyWrappedArrayBufferByteLength");
function testBasic() {
var arr = [1, 2, 3];

Просмотреть файл

@ -1,4 +1,4 @@
setJitCompilerOption("ion.warmup.trigger", 20);
// |jit-test| --ion-warmup-threshold=20
function testBailout() {
function f(v, r) {

Просмотреть файл

@ -1,5 +1,4 @@
// |jit-test| crash; skip-if: getBuildConfiguration()['tsan'] || getBuildConfiguration()['wasi']
setJitCompilerOption("ion.warmup.trigger", 50);
// |jit-test| crash; skip-if: getBuildConfiguration()['tsan'] || getBuildConfiguration()['wasi']; --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
var opts = getJitCompilerOptions();