1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/ion/inlining/inline-callarg-bailout.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +function add(x, y) { 1.5 + return x + y; 1.6 +} 1.7 + 1.8 +function runBinop(binop, lhs, rhs) { 1.9 + return binop(lhs, rhs); 1.10 +} 1.11 + 1.12 +//dis(run_binop); 1.13 + 1.14 +// Get the add function to compile. 1.15 +var accum = 0; 1.16 +for (var i = 0; i < 1000; ++i) 1.17 + accum += add(1, 1); 1.18 +assertEq(accum, 2000); 1.19 + 1.20 +// Get the runBinop function to compile and inline the add function. 1.21 +var accum = 0; 1.22 +for (var i = 0; i < 10100; ++i) 1.23 + accum = runBinop(add, i, i); 1.24 +assertEq(accum, 20198); 1.25 + 1.26 +var t30 = 1 << 30; 1.27 +var t31 = t30 + t30; 1.28 +var result = runBinop(add, t31, t31); 1.29 +assertEq(result, Math.pow(2, 32));