1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/ion/invalidation/recursive-invalidate.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,21 @@ 1.4 +var causeOSI = true; 1.5 + 1.6 +function rec(x, self) { 1.7 + if (x === 0 || x !== x) { 1.8 + if (causeOSI) { 1.9 + causeOSI = false; 1.10 + self(NaN, self) 1.11 + causeOSI = true; 1.12 + } 1.13 + return; 1.14 + } 1.15 + self(x - 1, self); 1.16 +} 1.17 + 1.18 +// Use enough iterations to type infer the script. 1.19 +causeOSI = false; 1.20 +for (var i = 0; i < 20; ++i) 1.21 + rec(1, rec); 1.22 +causeOSI = true; 1.23 + 1.24 +rec(2, rec)