Also most of the message manager tracing could happen similar way. Would it be possible to have separate slices for "black marking".
(In reply to Olli Pettay [:smaug] from comment #1) Yes, incrementalising root marking is already on our radar for decreasing pause times. This work is about incrementalising the roots marked by the embedding via callbacks. One issue is that you will need to ensure the snapshot invariant: everything that was live at the start of the GC eventually gets marked. I don't know how event listeners work but this may involve adding a write barrier or some other approach.
It should be fine to mark listeners as alive if they were alive when GC started. If nothing from C++ actually keeps them alive later, the next GC will just collect them, or at least mark them gray. forgetSkippable anyhow unmarks-gray tons of stuff, if at some point before CC actually runs the js stuff is kept alive by certainly alive C++. To collect such stuff CC needs GC to run and do the gray marking again, and if C++ isn't anymore certainly alive, unmarking won't happen and CC will trace through the gray JS.
Yes, the weird thing about these CC optimizations is that they can be done on a "best effort" basis. If we somehow mess up and fail to mark them black, it is okay because we're going to mark them as gray later.
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Last Resolved: 4 days ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.