Closed Bug 826673 Opened 12 years ago Closed 12 years ago

GC: Only finish sweeping the current compartment group on reset

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file, 1 obsolete file)

When a GC reset occurs in the sweep phase, the current behaviour is to finish the entire collection before starting a new one. This is unnecessary. Only the compartment group that is currently being swept needs to be swept to completion.
Attached patch Proposed fix (obsolete) — Splinter Review
Attached patch Proposed fixSplinter Review
Attachment #697961 - Attachment is obsolete: true
Attachment #698760 - Flags: review?(wmccloskey)
Comment on attachment 698760 [details] [diff] [review] Proposed fix Review of attachment 698760 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsgc.cpp @@ +3097,5 @@ > rt->gcCurrentCompartmentGroup = rt->gcCompartmentGroups; > rt->gcCompartmentGroupIndex = 0; > } > > +static void ResetGrayList(JSCompartment* comp); Could you put a newline after void? Also, the * should go after the space. @@ +3110,5 @@ > ComponentFinder<JSCompartment>::mergeCompartmentGroups(rt->gcCurrentCompartmentGroup); > + > + if (rt->gcAbortSweepAfterCurrentGroup) { > + JS_ASSERT(!rt->gcIsIncremental); > + for (GCCompartmentGroupIter c(rt); !c.done(); c.next()) { Could you put a comment above this loop that says something like "Iterate over all compartments that haven't been swept yet."? @@ +3314,5 @@ > return false; > } > > +static void > +ResetGrayList(JSCompartment* comp) The * should go after the space. @@ +3844,5 @@ > + JS_ASSERT(c->isGCMarking()); > + c->setNeedsBarrier(false, JSCompartment::UpdateIon); > + c->setGCState(JSCompartment::NoGC); > + ArrayBufferObject::resetArrayBufferList(c); > + ResetGrayList(c); Was missing the ResetGrayList an existing bug? I wonder why it didn't assert before. It looks like we have an assertion to check that this is empty at the beginning and the end of every GC.
Attachment #698760 - Flags: review?(wmccloskey) → review+
(In reply to Bill McCloskey (:billm) from comment #3) Comments addressed. > Was missing the ResetGrayList an existing bug? I wonder why it didn't assert > before. It looks like we have an assertion to check that this is empty at > the beginning and the end of every GC. Yes as far as I can see it was an existing bug - I guess we just never tripped over this (also, we need better tests for gray marking).
Depends on: 826649
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: