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)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(1 file, 1 obsolete file)
9.93 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•12 years ago
|
||
Assignee | ||
Comment 2•12 years ago
|
||
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+
Assignee | ||
Comment 4•12 years ago
|
||
(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).
Assignee | ||
Comment 5•12 years ago
|
||
Assignee | ||
Comment 6•12 years ago
|
||
Backed out for breaking everything:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1bc1445ba415
Assignee | ||
Comment 7•12 years ago
|
||
Comment 8•12 years ago
|
||
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.
Description
•