Debian Codegraph @

js/src/jit-test/tests/ion/osr-with-optimized-out.js

raw
1 // |jit-test| --ion-offthread-compile=off; --ion-warmup-threshold=30
2
3 // We disable any off-main thread compilation, and set a definite trigger for
4 // Ion compilation, such that we can garantee that we would OSR into the inner
5 // loop before we reach the end of the loop.
6 gcPreserveCode();
7
8 function f (n) {
9 while (!inIon()) {
10 var inner = 0;
11 let x = {};
12 for (var i = 0; i < n; i++) {
13 inner += inIon() == true ? 1 : 0;
14 if (inner <= 1)
15 bailout();
16 }
17 assertEq(inner != 1, true);
18 }
19 }
20
21 // Iterate enough to ensure that we OSR in this inner loop.
22 f(300);