js/src/jit-test/tests/parallel/alloc-too-many-objs.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 load(libdir + "parallelarray-helpers.js");
     3 function testMap() {
     5   // Note: This is the same kernel function as `alloc-many-objs`, but
     6   // with a larger bound.  This often fails par. exec. because it
     7   // triggers GC at inconvenient times.  But let's just test that it
     8   // doesn't crash or something!
    10   var ints = range(0, 100000);
    12   // The disqual occurs because each time we try to run we wind up
    13   // bailing due to running out of memory or requesting a GC.
    14   assertParallelExecWillBail(function (m) {
    15     ints.mapPar(kernel, m);
    16   });
    18   function kernel(v) {
    19     var x = [];
    21     if (inParallelSection()) {
    22       // don't bother to stress test the non-parallel paths!
    23       for (var i = 0; i < 50; i++) {
    24         x[i] = [];
    25         for (var j = 0; j < 1024; j++) {
    26           x[i][j] = j;
    27         }
    28       }
    29     }
    31     return x;
    32   }
    33 }
    35 if (getBuildConfiguration().parallelJS)
    36   testMap();

mercurial