lsra-bug1112164.js (970B)
1 setJitCompilerOption("baseline.warmup.trigger", 10); 2 setJitCompilerOption("ion.warmup.trigger", 30); 3 4 var atan2 = Math.atan2; 5 6 function reference(x, y, z, w) { 7 with({}) {}; /* prevent compilation */ 8 return [ atan2(x + 0.1, w), 9 atan2(y + 0.1, z), 10 atan2(z + 0.1, y), 11 atan2(w + 0.1, x) ]; 12 } 13 14 function generator(x, y, z, w) { 15 return [ atan2(x + 0.1, w), 16 atan2(y + 0.1, z), 17 atan2(z + 0.1, y), 18 atan2(w + 0.1, x) ]; 19 } 20 21 function test() { 22 var min = -0.99999, step = 0.1, max = 1; 23 for (var x = min; x < max; x += step) 24 for (var y = min; y < max; y += step) 25 for (var z = min; z < max; z += step) 26 for (var w = min; w < max; w += step) { 27 var ref = reference(x, y, z, w); 28 var gen = generator(x, y, z, w); 29 assertEq(gen[0], ref[0]); 30 assertEq(gen[1], ref[1]); 31 assertEq(gen[2], ref[2]); 32 assertEq(gen[3], ref[3]); 33 } 34 } 35 36 test();