michael@0: // Don't Baseline-compile the huge array literal with --baseline-eager michael@0: // as it's slow, especially in debug builds. michael@0: setJitCompilerOption("baseline.usecount.trigger", 2); michael@0: michael@0: function f(N) { michael@0: var body = "return ["; michael@0: for (var i = 0; i < N-1; i++) michael@0: body += "1,"; michael@0: body += "2]"; michael@0: var f = new Function(body); michael@0: var arr = f(); michael@0: assertEq(arr.length, N); michael@0: assertEq(arr[N-1], 2); michael@0: } michael@0: f(1000000);