summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/self-test/inJit.js
blob: dd218b5160be2efbc94e6b059fa468c274b918b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Test that inJit eventually becomes truthy.
// This code should never timeout.

function callInJit() {
    return inJit();
};

function test() {
    // Test with OSR.
    while(!inJit());

    // Test with inlining.
    while(!callInJit());

    // Test with zealous gc preventing compilation.
    while(!inJit()) gc();
};

test();