Debian Codegraph @

js/src/jit-test/tests/ion/recover-autounsafe.js

raw
1 // |jit-test| --ion-eager; --ion-offthread-compile=off
2
3 // Some AutoUnsafeCallWithABI functions can be reached via recovery instructions.
4 // This testcase is designed to trigger all of the recovery paths that can reach
5 // AutoUnsafeCallWithABI functions, while an exception is being thrown.
6
7 (function() {
8 inputs = [];
9 f = (function(x) {
10 var o = {a: x};
11 4294967297 ** (x >>> 0) *
12 4294967297 / x >>> 0 *
13 4294967297 % x >>> 0 *
14 Math.max(4294967297, x >>> 0) *
15 Math.min(4294967, x >>> 0) *
16 Math.atan2(4294967, x >>> 0) *
17 Math.sin(x >>> 0) *
18 Math.sqrt(x >>> 0) *
19 Math.hypot(4294967, x >>> 0) *
20 Math.ceil((x >>> 0) * 0.5) *
21 Math.floor((x >>> 0) * 0.5) *
22 Math.trunc((x >>> 0) * 0.5) *
23 Math.round((x >>> 0) * 0.5) *
24 Math.sign(x >>> 0) *
25 Math.log(x >>> 0) *
26 !o *
27 Math.fround(y); // Exception thrown here; y is not defined.
28 });
29 if (f) {
30 for (var j = 0; j < 2; ++j) {
31 try {
32 f(inputs[0]);
33 } catch (e) {}
34 }
35 }
36 })();