Debian Codegraph @

js/src/jit-test/tests/ion/bug1239075.js

raw
1
2 function g0() { with({}){}; }
3 function f0(y, x) {
4 var a = y >>> 0;
5 a = a - 1 + 1;
6 g0(); // Capture the truncate result after the call.
7 var b = x / 2; // bailout.
8 return ~(a + b);
9 }
10 assertEq(f0(-1, 0), 0);
11 assertEq(f0(-1, 1), 0);
12
13
14 function g1() { with({}){}; }
15 function f1(y, x) {
16 var a = y >>> 0;
17 a = a - 1 + 1;
18 g1(); // Capture the truncate result after the call.
19 var b = Math.pow(x / 2, x); // bailout.
20 return ~(a + b);
21 }
22 assertEq(f1(-1, 0), -1);
23 assertEq(f1(-1, 1), 0);
24
25 function f2(x) {
26 return ~(((~0 | 0) >>> 0 || 0) + Math.pow(Math.cos(x >>> 0), Math.atan2(0, x)))
27 }
28 assertEq(f2(0), -1);
29 assertEq(f2(-9999), 0);