Closed
Bug 739899
Opened 12 years ago
Closed 12 years ago
GC: Compartment creation during incremental GC shouldn't reset the GC
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: billm, Assigned: billm)
References
Details
Attachments
(1 file)
40.67 KB,
patch
|
igor
:
review+
|
Details | Diff | Splinter Review |
Right now, if a compartment is created during an incremental GC, we reset the current GC and finish with a non-incremental GC. This seems to happen pretty frequently during normal browsing. In theory, we should be able to carry on with the GC as normal without touching the new compartment (i.e., don't mark it and don't collect any of its objects). In practice, this could be a little difficult since it will be hard to avoid marking into the new compartment. Bug 716142 may simplify the problem: maybe we could switch the GC to a multi-compartment GC of every compartment except the newly-created one.
Assignee | ||
Comment 1•12 years ago
|
||
Now that multi-compartment GC has landed, we can make headway on this. Unfortunately, the multi-compartment GC patch preserved a difference between "full" GCs and compartment GCs (even if the compartment GC collected every compartment). This patch removes that distinction. The main changes in behavior from this patch are: 1. If a compartment is created during an incremental GC, we don't reset the GC or switch to non-incremental GC. In fact, we don't do anything. The new compartment won't be collected. 2. We now collect atoms only if every compartment that existed at the beginning of the GC is being collected. 3. Now any GC can delete a compartment if it has no live objects. Previously only "full" GCs could do this. Note that most of the time we'll still collect all compartments. It's just that collecting all compartments is no longer a special case.
Attachment #612375 -
Flags: review?(igor)
Comment 2•12 years ago
|
||
Comment on attachment 612375 [details] [diff] [review] patch Review of attachment 612375 [details] [diff] [review]: ----------------------------------------------------------------- nice cleanup! ::: js/src/jsatom.cpp @@ +241,5 @@ > return true; > } > > void > +js::FinishCommonAtoms(JSContext *cx) As you are changing this, replace the cx argument with the rt here ::: js/src/jsgc.cpp @@ +2277,5 @@ > + if (!c->isCollecting()) > + isFullGC = false; > + } > + } > + MarkAtomState(trc, rt->gcKeepAtoms || !isFullGC); We need a bug to stop marking atoms when the atom compartment is not under the GC itself.
Attachment #612375 -
Flags: review?(igor) → review+
Assignee | ||
Comment 3•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/94199cf080a3
Target Milestone: --- → mozilla14
Comment 5•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/94199cf080a3
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 6•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2f84376063fe https://hg.mozilla.org/mozilla-central/rev/153cbd729eba
You need to log in
before you can comment on or make changes to this bug.
Description
•