js/src/jit-test/tests/basic/testBug686274.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Don't Baseline-compile the huge array literal with --baseline-eager
     2 // as it's slow, especially in debug builds.
     3 setJitCompilerOption("baseline.usecount.trigger", 2);
     5 function f(N) {
     6     var body = "return [";
     7     for (var i = 0; i < N-1; i++)
     8         body += "1,";
     9     body += "2]";
    10     var f = new Function(body);
    11     var arr = f();
    12     assertEq(arr.length, N);
    13     assertEq(arr[N-1], 2);
    14 }
    15 f(1000000);

mercurial