Closed
Bug 1337450
Opened 8 years ago
Closed 8 years ago
Simplify the implementation of GC resets
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(1 file)
7.38 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
At the moment we call GCRuntime::resetIncrementalGC from several places. This patch changes things so that this always happens from budgetIncrementalGC. The implementation of abortGC now just starts a collection with the ABORT_GC reason which that method checks for.
This is needed for running the GC from its own thread because it means that resets now always happen on the GC thread.
Attachment #8834504 -
Flags: review?(sphink)
Comment 1•8 years ago
|
||
Comment on attachment 8834504 [details] [diff] [review]
simplify-abort-incremental
Review of attachment 8834504 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jsgc.cpp
@@ +6224,1 @@
> if (prevState != State::NotActive && !isIncrementalGCInProgress())
Would it be possible to eliminate this test? It feels like it's inferring what budgetIncrementalGC did, instead of having it just tell it directly. Maybe:
budgetIncrementalGC(nonincrementalByAPI, reason, budget, &resetGC, session.lock);
if (resetGC)
return true;
Unless there's some nuance I'm missing.
Or, given that we're already using a boolean return from gcCycle to mean wasReset, I suppose we could do the same here. Or better, change both of them to an enum { GCWasReset, GCWasNotReset }. Ugh, those names are pretty bad. enum class GCResult { Ok, Reset }?
@@ -6471,5 @@
> checkCanCallAPI();
> MOZ_ASSERT(!TlsContext.get()->suppressGC);
>
> - AutoStopVerifyingBarriers av(rt, false);
> - AutoEnqueuePendingParseTasksAfterGC aept(*this);
Heh, seems we had another batch of these nested inside collect(). Yay for getting rid of lots of redundant goop here.
Attachment #8834504 -
Flags: review?(sphink) → review+
Assignee | ||
Comment 2•8 years ago
|
||
(In reply to Steve Fink [:sfink] [:s:] from comment #1)
> Or, given that we're already using a boolean return from gcCycle to mean
> wasReset, I suppose we could do the same here. Or better, change both of
> them to an enum { GCWasReset, GCWasNotReset }. Ugh, those names are pretty
> bad. enum class GCResult { Ok, Reset }?
That is a great idea, I'll do that.
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/67160e6118d1
Simplify GC resets and aborts r=sfink
Comment 4•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in
before you can comment on or make changes to this bug.
Description
•