michael@0: // |jit-test| exitstatus: 6; michael@0: michael@0: // One sneaky way to run GC during a parallel section is to invoke the michael@0: // gc() function during the parallel timeout! michael@0: michael@0: load(libdir + "parallelarray-helpers.js"); michael@0: michael@0: function iterate(x) { michael@0: while (x == 2046) { michael@0: // for exactly one index, this infinitely loops! michael@0: // this ensures that the warmup doesn't loop. michael@0: } michael@0: return 22; michael@0: } michael@0: michael@0: function timeoutfunc() { michael@0: print("Timed out, invoking the GC"); michael@0: gc(); michael@0: return false; michael@0: } michael@0: michael@0: timeout(1, timeoutfunc); michael@0: michael@0: if (getBuildConfiguration().parallelJS) michael@0: Array.buildPar(2048, iterate); michael@0: else michael@0: while(true);