Closed Bug 1729439 Opened 3 years ago Closed 3 years ago

Simplify gray marking a little in preparation for making it incremental

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(2 files)

I've been looking into how we might mark gray roots incrementally. In preparation for that here are a couple of patches to simplify and tidy up the current gray root marking.

We try to do as much black marking as possible before gray marking. Cross
compartment pointers between marking zones are followed when marking black, but
not when marking gray. Instead they are put on a list and we delay marking them
until we start gray marking their zone.

This code checked for any cross compartment pointers on the list whose souce
had become black due to gray unmarking, and marked their target black. This was
unnecessary because gray unmarking already results in marking the target black
since it invokes the standard barrier on targets in collecting zones.

The patch removes this code and adds an assertion that no black marking is
necessary when traversing this list.

This splits the markGrayReferencesInCurrentGroup action into
markGrayRootsInCurrentGroup and markGray, which means we don't need the extra
state to check whether it's the first time it's called. Now
markGrayRootsInCurrentGroup will run once, and then markGray will run to
process the mark stack. If we exhast the budget, we will re-enter in markGray
and won't try to mark the roots again.

Depends on D124780

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0c12e7b5aea2
We don't need to mark incoming cross compartment pointers black at the start of gray marking r=sfink
https://hg.mozilla.org/integration/autoland/rev/fcf04373f799
Split gray marking into separate actions r=sfink
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: