Open Bug 791127 Opened 13 years ago Updated 3 years ago

Mark things held live by documents black during GC, instead of unmarking them later

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

People

(Reporter: mccr8, Unassigned)

References

Details

Attachments

(3 files)

Right now, we UnmarkGray a bunch of JS things during the first CC cleanup phase after a GC. We could change these to be held as black roots during the GC, which should reduce the time of that initial long CC cleanup phase.
This parameterizes the MarkContentViewer/MarkDocShell/MarkSHEntry/etc. functions over a new class, DocumentVisitor, that has a single callback method that takes a document. It then implements the current cleanupJS etc stuff using it. This patch should not change the behavior.
Once that is in place, you can drop in a chunk of code like this into TraceBlackJS: + if (!++nsCCUncollectableMarker::sGeneration) { + ++nsCCUncollectableMarker::sGeneration; + } + GCDocumentVisitor docVisitor(aTrc); + MarkLiveWindows(&docVisitor); ...where GCDocumentVisitor is a subclass of DocumentVisitor that uses the JS tracer on things hanging off of the document. In my measurements in an optimized debug build, this MarkLiveWindows can take a millisecond or two, which will add to the GC time. So that's not super great. It seems to be mostly just iterating over all of the stuff.
Blocks: 827392
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: