michael@0: var wait = 100; michael@0: michael@0: var method_A = function() { michael@0: for (var t = 0; t < wait; ++t) {} michael@0: } michael@0: michael@0: var method_B = function() { michael@0: for (var t = 0; t < wait; ++t) {} michael@0: } michael@0: michael@0: var method_C = function() { michael@0: for (var t = 0; t < wait; ++t) {} michael@0: } michael@0: michael@0: var method_D = function() { michael@0: for (var t = 0; t < wait; ++t) {} michael@0: } michael@0: michael@0: var func = [method_A, method_B, method_C, method_D] michael@0: michael@0: for (var n = 0; n < 4; ++n) { michael@0: setJitCompilerOption("baseline.enable", n & 1); michael@0: setJitCompilerOption("ion.enable", n & 2 ? 1: 0); michael@0: var opt = getJitCompilerOptions(); michael@0: assertEq(opt["baseline.enable"], n & 1); michael@0: assertEq(opt["ion.enable"], n & 2 ? 1 : 0); michael@0: for (var i = 0; i < 1001; ++i) michael@0: func[n](); michael@0: }