mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1087799, part 1 - Loosen the invariant in nsCycleCollector::FinishAnyCurrentCollection(). r=smaug
If an Unlink() method ends up running JS, it can cause a GC, which will make us reenter the CC, which will not do anything because we're already in a CC. Therefore, FinishAnyCurrentCollection() won't finish the CC. This is safe because the CC only touches things it actually holds alive via the Root() method.
This commit is contained in:
parent
36e7a0430f
commit
14343f4a96
@ -3673,7 +3673,10 @@ nsCycleCollector::FinishAnyCurrentCollection()
|
||||
PrintPhase("FinishAnyCurrentCollection");
|
||||
// Use SliceCC because we only want to finish the CC in progress.
|
||||
Collect(SliceCC, unlimitedBudget, nullptr);
|
||||
MOZ_ASSERT(mIncrementalPhase == IdlePhase);
|
||||
|
||||
MOZ_ASSERT(mIncrementalPhase == IdlePhase ||
|
||||
(mIncrementalPhase == ScanAndCollectWhitePhase && mActivelyCollecting),
|
||||
"FinishAnyCurrentCollection should finish the collection, unless we've reentered the CC during unlinking");
|
||||
}
|
||||
|
||||
// Don't merge too many times in a row, and do at least a minimum
|
||||
|
Loading…
Reference in New Issue
Block a user