Closed Bug 1833114 Opened 3 years ago Closed 3 years ago

Use separate mark stacks for black and gray marking

Categories

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

task

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox115 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

I know we've flip-flopped on this a few times before but using separate stacks simplifies the code and should make some parallel marking optimisaitons easier. However we need to do this without regressing memory usage.

This adds a separate auxililary mark stack and switches to it when necessary.
Switching is done by std::swap so that |stack| is always the stack for the
current mark color. We avoid swapping if both stacks are empty so that we don't
always use the auxiliary stack.

This removes a bunch of state from MarkStack and assertions around ensuring
that state is valid.

We can now make a few simplifications now |stack| is always the current stack.

Depends on D178040

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8b4f4da78faa Use separate mark stacks for black and gray marking r=sfink https://hg.mozilla.org/integration/autoland/rev/0d1f0b668a79 Simplify marking code now |stack| represents the mark stack for the current color r=sfink
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch

(In reply to Jon Coppeard (:jonco) from comment #3)

I'm never sure how to interpret these results, but all the Windows ones are same or negative on size, so I don't think this will cause a regression:

Ok, I'm not sure why my version was so problematic, but I definitely prefer the simplicity of separate stacks and so I'm happy to rely on these results.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: