зеркало из https://github.com/mozilla/pjs.git
Bug 753615 - Ensure we don't re-enter a GC phase (r=terrence)
This commit is contained in:
Родитель
97ee26bb24
Коммит
f8af37ee8f
|
@ -599,6 +599,9 @@ Statistics::endSlice()
|
|||
void
|
||||
Statistics::beginPhase(Phase phase)
|
||||
{
|
||||
/* Guard against re-entry */
|
||||
JS_ASSERT(!phaseStartTimes[phase]);
|
||||
|
||||
phaseStartTimes[phase] = PRMJ_Now();
|
||||
phaseStartFaults[phase] = gc::GetPageFaultCount();
|
||||
|
||||
|
@ -614,6 +617,7 @@ Statistics::endPhase(Phase phase)
|
|||
int64_t t = PRMJ_Now() - phaseStartTimes[phase];
|
||||
slices.back().phaseTimes[phase] += t;
|
||||
phaseTimes[phase] += t;
|
||||
phaseStartTimes[phase] = 0;
|
||||
|
||||
size_t faults = gc::GetPageFaultCount() - phaseStartFaults[phase];
|
||||
slices.back().phaseFaults[phase] += faults;
|
||||
|
|
|
@ -3449,7 +3449,6 @@ IncrementalMarkSlice(JSRuntime *rt, int64_t budget, JSGCInvocationKind gckind, b
|
|||
|
||||
*shouldSweep = false;
|
||||
if (rt->gcIncrementalState == MARK) {
|
||||
gcstats::AutoPhase ap(rt->gcStats, gcstats::PHASE_MARK);
|
||||
SliceBudget sliceBudget(budget);
|
||||
|
||||
/* If we needed delayed marking for gray roots, then collect until done. */
|
||||
|
@ -3466,7 +3465,11 @@ IncrementalMarkSlice(JSRuntime *rt, int64_t budget, JSGCInvocationKind gckind, b
|
|||
}
|
||||
#endif
|
||||
|
||||
bool finished = rt->gcMarker.drainMarkStack(sliceBudget);
|
||||
bool finished;
|
||||
{
|
||||
gcstats::AutoPhase ap(rt->gcStats, gcstats::PHASE_MARK);
|
||||
finished = rt->gcMarker.drainMarkStack(sliceBudget);
|
||||
}
|
||||
if (finished) {
|
||||
JS_ASSERT(rt->gcMarker.isDrained());
|
||||
if (initialState == MARK && !rt->gcLastMarkSlice && budget != SliceBudget::Unlimited) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче