Bug 1342181 - Run weak mapping fixup after GC before CC r=mccr8

This commit is contained in:
Jon Coppeard 2017-03-05 09:19:24 +00:00
Родитель d3c6a4d9d9
Коммит 12f4fcc022
1 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -3519,9 +3519,20 @@ nsCycleCollector::FixGrayBits(bool aForceGC, TimeLog& aTimeLog)
mResults.mForcedGC = true;
}
mJSContext->GarbageCollect(aForceGC ? JS::gcreason::SHUTDOWN_CC :
JS::gcreason::CC_FORCED);
aTimeLog.Checkpoint("FixGrayBits GC");
uint32_t count = 0;
do {
mJSContext->GarbageCollect(aForceGC ? JS::gcreason::SHUTDOWN_CC :
JS::gcreason::CC_FORCED);
mJSContext->FixWeakMappingGrayBits();
// It's possible that FixWeakMappingGrayBits will hit OOM when unmarking
// gray and we will have to go round again. The second time there should not
// be any weak mappings to fix up so the loop body should run at most twice.
MOZ_RELEASE_ASSERT(count++ < 2);
} while (!mJSContext->AreGCGrayBitsValid());
aTimeLog.Checkpoint("FixGrayBits");
}
bool