Bug 970427 - Push ForkJoinActivation after calling the bounds function. (r=nmatsakis)

This commit is contained in:
Shu-yu Guo 2014-02-13 19:14:14 -08:00
parent 6ac6899383
commit 1cf7a78420
2 changed files with 16 additions and 2 deletions

View File

@ -0,0 +1,15 @@
// XXXshu: I tried wrapping the entire test in an |if (pjs)|, but the timing
// is fragile and it no longer reproduced the bug, thus getting this value at
// the beginning.
var pjs = getBuildConfiguration().parallelJS;
function f(a, b) {
var o = a;
gczeal(2);
}
f(3, 4);
var len = 5000;
var iters = 100;
for (var i = 0; i < iters; i++) {
var par = pjs ? Array.buildPar(len, fill) : true;
}
function fill(i) { return 10/i; }

View File

@ -1175,8 +1175,6 @@ ForkJoinOperation::parallelExecution(ExecutionStatus *status)
// functions such as ForkJoin().
JS_ASSERT(ForkJoinContext::current() == nullptr);
ForkJoinActivation activation(cx_);
uint16_t from, to;
if (!computeBounds(&from, &to)) {
*status = ExecutionFatal;
@ -1189,6 +1187,7 @@ ForkJoinOperation::parallelExecution(ExecutionStatus *status)
return RedLight;
}
ForkJoinActivation activation(cx_);
ThreadPool *threadPool = &cx_->runtime()->threadPool;
ForkJoinShared shared(cx_, threadPool, fun_, from, to, &bailoutRecords_[0]);
if (!shared.init()) {