Bug 887921 - Don't toggle GC write barriers in parallel execution. (r=sstangl)

This commit is contained in:
Shu-yu Guo 2013-07-03 09:47:28 -07:00
parent 66ee89e766
commit fcd8c3ba4b

View File

@ -5476,11 +5476,21 @@ CodeGenerator::link()
if (callTargets.length() > 0)
ionScript->copyCallTargetEntries(callTargets.begin());
// The correct state for prebarriers is unknown until the end of compilation,
// since a GC can occur during code generation. All barriers are emitted
// off-by-default, and are toggled on here if necessary.
if (cx->zone()->needsBarrier())
ionScript->toggleBarriers(true);
switch (executionMode) {
case SequentialExecution:
// The correct state for prebarriers is unknown until the end of compilation,
// since a GC can occur during code generation. All barriers are emitted
// off-by-default, and are toggled on here if necessary.
if (cx->zone()->needsBarrier())
ionScript->toggleBarriers(true);
break;
case ParallelExecution:
// We don't run incremental GC during parallel execution; no need to
// turn on barriers.
break;
default:
MOZ_ASSUME_UNREACHABLE("No such execution mode");
}
return true;
}