Closed
Bug 1386660
Opened 4 years ago
Closed 4 years ago
Refactor and fix the code that sets the GC prefs
Categories
(Core :: JavaScript: GC, enhancement)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: pbone, Assigned: pbone)
References
(Blocks 2 open bugs)
Details
Attachments
(6 files, 14 obsolete files)
1.02 KB,
patch
|
pbone
:
review+
|
Details | Diff | Splinter Review |
10.50 KB,
patch
|
pbone
:
review+
|
Details | Diff | Splinter Review |
2.76 KB,
patch
|
pbone
:
review+
|
Details | Diff | Splinter Review |
11.65 KB,
patch
|
pbone
:
review+
|
Details | Diff | Splinter Review |
10.50 KB,
patch
|
pbone
:
review+
|
Details | Diff | Splinter Review |
16.68 KB,
patch
|
pbone
:
review+
|
Details | Diff | Splinter Review |
Refactor and generally improve the rather ad-hoc pref setting code. Also fix code that either deliberately or in some cases accidentally resets a preference by setting it to -1 and hoping that SpiderMonkey does the right thing.
Assignee | ||
Updated•4 years ago
|
Comment 1•4 years ago
|
||
E.g. https://searchfox.org/mozilla-central/source/dom/base/nsJSEnvironment.cpp#2602
Assignee | ||
Comment 2•4 years ago
|
||
Attachment #8893226 -
Flags: review?(jcoppeard)
Assignee | ||
Comment 3•4 years ago
|
||
I've asked Steve to review this since we talked about it on IRC a few days ago.
Attachment #8893227 -
Flags: review?(sphink)
Assignee | ||
Comment 4•4 years ago
|
||
I'm having problems with this patch and clang with address sanitisation. (Thanks try!). So maybe wait until I figure it out before reviewing it? https://treeherder.mozilla.org/logviewer.html#?job_id=120400145&repo=try&lineNumber=2200 But if someone knows what I've done wrong (looks like it's a C++ thing that I don't know yet) I'd appreciate it.
Assignee | ||
Comment 5•4 years ago
|
||
Attachment #8893229 -
Flags: review?(jcoppeard)
Comment 6•4 years ago
|
||
Comment on attachment 8893226 [details] [diff] [review] Bug 1386660 (part 1) - Update a comment to reflect current code r=jonco Review of attachment 8893226 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/gc/GCRuntime.h @@ +155,4 @@ > ActiveThreadData<size_t> gcMaxNurseryBytes_; > > /* > + * The base value used to compute zone->trigger.gcTriggerBytes(). When We should also change this to say zone->threshold as that was wrong too :)
Attachment #8893226 -
Flags: review?(jcoppeard) → review+
Comment 7•4 years ago
|
||
Comment on attachment 8893229 [details] [diff] [review] Bug 1386660 (part 4) - Refactor pref code in nsJSEnvironment.cpp r=jonco Review of attachment 8893229 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for cleaning this up. This looks good to me, but you'll need a review from DOM peer for this. ::: dom/base/nsJSEnvironment.cpp @@ +2622,5 @@ > + ResetGCParameter((JSGCParamKey)(uintptr_t)aClosure); > +} > + > +static void > +SetMemoryPrefChangedCallbackNat(const char* aPrefName, void* aClosure) What does 'Nat' mean here? I think 'Int' would be clearer. @@ +2796,5 @@ > + "javascript.options.mem.max", > + (void*)JSGC_MAX_BYTES); > + Preferences::RegisterCallbackAndCall(SetMemoryPrefChangedCallbackKB, > + "javascript.options.mem.nursery.max_kb", > + (void*)JSGC_MAX_NURSERY_BYTES); Pre-existing question: I wonder why this is in KB when we only allocate the nursery in chunks of 1 MiB?
Attachment #8893229 -
Flags: review?(jcoppeard)
Attachment #8893229 -
Flags: review?(bugs)
Attachment #8893229 -
Flags: feedback+
Comment 8•4 years ago
|
||
Comment on attachment 8893229 [details] [diff] [review] Bug 1386660 (part 4) - Refactor pref code in nsJSEnvironment.cpp r=jonco Please don't use *Nat (I have no idea what it means). *Int is clear. Always {} with if. So, if (...) { ... } else { ... } Local variable naming should use camelCase. So, not pref_mb, but prefMB or so. Since SetMemoryPrefChangedCallbackKB is used only by one pref, could you not change the name but just keep the name SetMemoryNurseryMaxPrefChangedCallback (the change to the behavior looks ok). The behavior of SetMemoryPrefChangedCallbackKB is hard to understand from its name.
Attachment #8893229 -
Flags: review?(bugs) → review+
Updated•4 years ago
|
Attachment #8893227 -
Flags: review?(sphink) → review+
Assignee | ||
Comment 9•4 years ago
|
||
> > + > > +static void > > +SetMemoryPrefChangedCallbackNat(const char* aPrefName, void* aClosure) > > What does 'Nat' mean here? I think 'Int' would be clearer. Natural number, but that's actually incorrect, Int is better. > @@ +2796,5 @@ > > + "javascript.options.mem.max", > > + (void*)JSGC_MAX_BYTES); > > + Preferences::RegisterCallbackAndCall(SetMemoryPrefChangedCallbackKB, > > + "javascript.options.mem.nursery.max_kb", > > + (void*)JSGC_MAX_NURSERY_BYTES); > > Pre-existing question: I wonder why this is in KB when we only allocate the > nursery in chunks of 1 MiB? Because sometimes it is allocated in chunks of 256K, like on mobile.
Assignee | ||
Comment 10•4 years ago
|
||
Updated based on jonco's review.
Attachment #8893226 -
Attachment is obsolete: true
Attachment #8894747 -
Flags: review+
Assignee | ||
Comment 11•4 years ago
|
||
Attachment #8893228 -
Attachment is obsolete: true
Attachment #8894750 -
Flags: review?(jcoppeard)
Assignee | ||
Comment 12•4 years ago
|
||
Updated based on review feedback
Attachment #8893229 -
Attachment is obsolete: true
Attachment #8894751 -
Flags: review+
Assignee | ||
Comment 13•4 years ago
|
||
Hi jonco / sfink. In some cases default values are specified both in SpiderMonkey (in GCRuntime.h) and in Firefox (all.js), often they're the same value, for example javascript.options.mem.gc_allocation_threshold_mb. When they're identical should I set the Firefox ones to -1 so that we're not repeating this in multiple places? I'm happy to add another patch for that change. Thanks.
Flags: needinfo?(jcoppeard)
Comment 14•4 years ago
|
||
(In reply to Paul Bone [:pbone] from comment #9) > Because sometimes it is allocated in chunks of 256K, like on mobile. That's a good point.
Comment 15•4 years ago
|
||
(In reply to Paul Bone [:pbone] from comment #4) > I'm having problems with this patch and clang with address sanitisation. I think this is to do with having the defaults as static constexpr members that are initialised in the body of the class. Before constexpr, you would have used static const and inline initialisation was only allowed for integral values. It looks like what you have here should work, but the linker error indicates that somehow we're trying to create a reference to this member and that requires it to be defined outside the class too. I don't see why this is happening but it's probably some complexity of the ActiveThreadOrGCTaskData<> template that I don't understand. The simplest thing would be to move these constants out of the class definition (and you can just use const rather than constexpr in that case too).
Comment 16•4 years ago
|
||
(In reply to Paul Bone [:pbone] from comment #13) > When they're > identical should I set the Firefox ones to -1 so that we're not repeating > this in multiple places? What do you think Steve? I know it's duplication but I think I'd rather have all the browser defaults in one place in the browser.
Flags: needinfo?(jcoppeard) → needinfo?(sphink)
Comment 17•4 years ago
|
||
Comment on attachment 8894750 [details] [diff] [review] Bug 1386660 (part 3) - Provide code to reset SM/GC parameters r=jonco Review of attachment 8894750 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/gc/GCRuntime.h @@ +235,5 @@ > public: > + /* > + * The casts here are necessary to prevent C++ from generating references > + * to these types and confusing the linker in asan builds. > + */ Ah, I see I should have read this patch first before commenting above. Please move the constants out of the class body. That should fix things without casts. ::: js/src/jsgc.cpp @@ +1327,5 @@ > + defaultTimeBudget_ = > + static_cast<int64_t>(SliceBudget::UnlimitedTimeBudget); > + break; > + case JSGC_MARK_STACK_LIMIT: > + setMarkStackLimit(0xffffffff, lock); The initial value is actually set to size_t(-1) so we should set that here. @@ +1367,5 @@ > + highFrequencyLowLimitBytes_ = > + static_cast<uint64_t>(highFrequencyLowLimitBytesDefault); > + if (highFrequencyLowLimitBytes_ >= highFrequencyHighLimitBytes_) > + highFrequencyHighLimitBytes_ = highFrequencyLowLimitBytes_ + 1; > + MOZ_ASSERT(highFrequencyHighLimitBytes_ > highFrequencyLowLimitBytes_); This duplicates a lot of the verification logic from setParameter. Where necessary, could you split out separate methods to set/verify the individual parameters and call them from both setParameter and resetParameter?
Attachment #8894750 -
Flags: review?(jcoppeard)
Assignee | ||
Comment 18•4 years ago
|
||
(In reply to Jon Coppeard (:jonco) from comment #15) > (In reply to Paul Bone [:pbone] from comment #4) > > I'm having problems with this patch and clang with address sanitisation. > > I think this is to do with having the defaults as static constexpr members > that are initialised in the body of the class. Before constexpr, you would > have used static const and inline initialisation was only allowed for > integral values. It looks like what you have here should work, but the > linker error indicates that somehow we're trying to create a reference to > this member and that requires it to be defined outside the class too. I experimented and got the same problem with const and constexpr (at least for integers). So I made the integers const and the floats/doubles constexpr. > I don't see why this is happening but it's probably some complexity of the > ActiveThreadOrGCTaskData<> template that I don't understand. I found that either assigning to one of these, or calling its constructor, would attempt to use const int& rather than just int, and therefore create a reference to it. At least for clang with address sanitisation. GCC worked fine, I didn't try clang without address sanitisation. Hence the patch with the casts works. > The simplest thing would be to move these constants out of the class > definition (and you can just use const rather than constexpr in that case > too). Okay, I'll fix it in the morning.
Comment 19•4 years ago
|
||
(In reply to Jon Coppeard (:jonco) from comment #16) > (In reply to Paul Bone [:pbone] from comment #13) > > When they're > > identical should I set the Firefox ones to -1 so that we're not repeating > > this in multiple places? > > What do you think Steve? I know it's duplication but I think I'd rather > have all the browser defaults in one place in the browser. Hm, maybe I should change my opinion on this. I definitely want the settings to appear in about:config, which I think means listing them in all.js. If they are always going to be identical between the shell and the browser, then it seems like repeating the logic to result in the same settings in both places is error-prone, so we ought to use -1 or whatever in all.js to use the default. But if we *do* imagine that we might want browser-specific settings, ones that won't always match the compiled-in constants, then it makes sense to repeat the logic in both places. ("Logic" as in, "if on mobile set to X else set to Y".) So for me, it hinges on whether browser-specific settings make sense. And when I think through an example, I unfortunately hit some complexity: we are seeing some guaranteed nursery resizing that slows down browser startup, so it seems like our initial nursery size should be larger in the browser. Yet workers probably ought to start small. So yes, it seems like browser-specific settings make sense, but to do it right might require more complexity than we currently have. (Or do we have worker-specific or startup-specific settings? I don't actually know offhand.) I guess that means I'm voting for putting the actual values in all.js, and filing bugs for splitting out settings for different configurations if we don't already.
Flags: needinfo?(sphink)
Assignee | ||
Comment 20•4 years ago
|
||
Why not put all the defaults that are identical in GCRuntime.h, using -1 in all.js, and when they're different giving the different value in all.js and a comment about why it's different. If we can decide I can write a patch and add it to this bug. Maybe jonco and I will talk about it tonight in our meeting. Startup / worker settings is a separate issue IMHO, and should probably be done case-by-case. For example SpiderMonkey could have two different default nursery sizes, one for the main thread and one for workers. Then Firefox should mostly defer to SpiderMonkey except perhaps during startup. I'd like to discuss this in Bug 1387950, since I think it is a separate issue, and I don't what it's discussion to get lost after this bug is closed.
Assignee | ||
Comment 21•4 years ago
|
||
Attachment #8895320 -
Flags: review?(jcoppeard)
Assignee | ||
Updated•4 years ago
|
Attachment #8894750 -
Attachment is obsolete: true
Comment 22•4 years ago
|
||
Comment on attachment 8895320 [details] [diff] [review] Bug 1386660 (part 3) - Provide code to reset SM/GC parameters Review of attachment 8895320 [details] [diff] [review]: ----------------------------------------------------------------- Great, thanks for the updates. ::: js/src/jsgc.cpp @@ +1302,4 @@ > return true; > } > > +void GCSchedulingTunables::setHighFrequencyLowLimit(uint64_t newLimit) { nit: When defining a method outside the class statement the type goes on a separate line here as does the open brace, e.g. like this: void GCSchedulingTunables::setHighFrequencyLowLimit(uint64_t newLimit) { @@ +1329,5 @@ > + minEmptyChunkCount_ = maxEmptyChunkCount_; > + MOZ_ASSERT(maxEmptyChunkCount_ >= minEmptyChunkCount_); > +} > + > +static const size_t gcZoneAllocThresholdBaseDefault = 30 * 1024 * 1024; I can't find where it says it in the coding style guide but in general constants start with a capital letter e.g GCZoneAllocThresholdDefault.
Attachment #8895320 -
Flags: review?(jcoppeard) → review+
Comment 23•4 years ago
|
||
proper values in all.js are self-documenting for whoever uses about:config to tweak them.
Assignee | ||
Comment 24•4 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #23) > proper values in all.js are self-documenting for whoever uses about:config > to tweak them. Jon and I met last night and taking into account the other comments on this thread we have decided to duplicate these values, so that they can be seen in about:config. With your vote added it's pretty clear that this is preferred.
Assignee | ||
Comment 25•4 years ago
|
||
(In reply to Jon Coppeard (:jonco) from comment #22) > Comment on attachment 8895320 [details] [diff] [review] > Bug 1386660 (part 3) - Provide code to reset SM/GC parameters > > Review of attachment 8895320 [details] [diff] [review]: > ----------------------------------------------------------------- > > Great, thanks for the updates. > > ::: js/src/jsgc.cpp > @@ +1302,4 @@ > > return true; > > } > > > > +void GCSchedulingTunables::setHighFrequencyLowLimit(uint64_t newLimit) { > > nit: When defining a method outside the class statement the type goes on a > separate line here as does the open brace, e.g. like this: > > void > GCSchedulingTunables::setHighFrequencyLowLimit(uint64_t newLimit) > { > > @@ +1329,5 @@ > > + minEmptyChunkCount_ = maxEmptyChunkCount_; > > + MOZ_ASSERT(maxEmptyChunkCount_ >= minEmptyChunkCount_); > > +} > > + > > +static const size_t gcZoneAllocThresholdBaseDefault = 30 * 1024 * 1024; > > I can't find where it says it in the coding style guide but in general > constants start with a capital letter e.g GCZoneAllocThresholdDefault. Sorry, I should have at least noticed both of these conventions, even if I didn't remember what I read on the style document. I was careless.
Assignee | ||
Comment 26•4 years ago
|
||
jonco reviewed this patch already, I've made the minor changes he requested in that review.
Attachment #8895320 -
Attachment is obsolete: true
Attachment #8895635 -
Flags: review+
Assignee | ||
Comment 27•4 years ago
|
||
Attachment #8896300 -
Flags: review?(sphink)
Assignee | ||
Comment 28•4 years ago
|
||
Attachment #8896301 -
Flags: review?(sphink)
Assignee | ||
Comment 29•4 years ago
|
||
The try job for these changes is https://treeherder.mozilla.org/#/jobs?repo=try&revision=91646bc62f788ec0c62acfdd82072e66991752a2
Assignee | ||
Comment 30•4 years ago
|
||
Attachment #8896301 -
Attachment is obsolete: true
Attachment #8896301 -
Flags: review?(sphink)
Attachment #8896814 -
Flags: review?(sphink)
Assignee | ||
Comment 31•4 years ago
|
||
After fixing a bug the updated try job is here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b267beb55909aeb836f913f310b61b1dac38dd81
Assignee | ||
Comment 32•4 years ago
|
||
Assignee | ||
Comment 33•4 years ago
|
||
Comment on attachment 8897301 [details] [diff] [review] Bug 1386660 (part 7) - Fix build error on Windows After fixing this I ran try again: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f53353f047daaf304684fbf73dc5272a310980d4
Attachment #8897301 -
Flags: review?(jcoppeard)
Updated•4 years ago
|
Attachment #8897301 -
Flags: review?(jcoppeard) → review+
Comment 34•4 years ago
|
||
Comment on attachment 8896300 [details] [diff] [review] Bug 1386660 (part 5) - Add constants to avoid multiple hard-coded values Review of attachment 8896300 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsgc.cpp @@ +284,5 @@ > + * JSGC_SLICE_TIME_BUDGET. > + * javascript.options.mem.gc_incremental_slice_ms > + */ > +static const int64_t DefaultTimeBudgetDefault = > + SliceBudget::UnlimitedTimeBudget; The Default...Default name bothers me for reasons that I couldn't initially put a finger on. But I think I know now. Those two "Defaults" don't mean the same thing. It's the default setting for defaultTimeBudget_. So the first default (from defaultTimeBudget_) is "what to use for GCs where no other time budget is specified." The trailing default is "what to set the above default to if configuration does not say otherwise." But I can't come up with a better name for either, given that they both really are defaults. What would you think about putting all of this stuff into a namespace or struct with "default" in its name, perhaps js::gc::DefaultSettings? Then this would be DefaultSettings::DefaultTimeBudget, alongside things like DefaultSettings::MaxEmptyChunkCount etc. To me at least, that seems more understandable. (I'm not settled on the exact name or anything. JS::GCTuningDefaults is a totally different name that would work too.) Anyway, I trust your instincts on naming, so even if you want to leave it exactly as-is, I'm fine with it.
Attachment #8896300 -
Flags: review?(sphink) → review+
Comment 35•4 years ago
|
||
Comment on attachment 8896814 [details] [diff] [review] Bug 1386660 (part 6) - Clarify relationships between prefs, JSGC params, and their defaults Review of attachment 8896814 [details] [diff] [review]: ----------------------------------------------------------------- Very nice! This stuff is way easier to follow. So far, I've just been searching through code whenever someone asks me about one of these. ::: js/src/gc/GCRuntime.h @@ +1328,5 @@ > /* > * Whether compacting GC can is enabled globally. > + * > + * JSGC_COMPACTING_ENABLED > + * pref: javascript.options.mem.gc_compacting all of these javascript.options.mem.gc_* names make me wonder if we could rename them all to javascript.options.gc.*. The 'mem' part doesn't seem helpful. But don't hold up this bug for that. ::: js/src/jsapi.h @@ +1855,5 @@ > + /** > + * Maximum size the GC mark stack can grow to. > + * > + * Pref: none > + * Shell default: size_t(-1) Can you comment what -1 means? ::: js/src/jsgc.cpp @@ +315,4 @@ > static const int64_t DefaultTimeBudgetDefault = > SliceBudget::UnlimitedTimeBudget; > > +// JSGC_MODE */ Unmatched comment markers
Attachment #8896814 -
Flags: review?(sphink) → review+
Assignee | ||
Comment 36•4 years ago
|
||
(In reply to Steve Fink [:sfink] [:s:] (PTO Aug 16-23) from comment #34) > Comment on attachment 8896300 [details] [diff] [review] > Bug 1386660 (part 5) - Add constants to avoid multiple hard-coded values > > Review of attachment 8896300 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: js/src/jsgc.cpp > @@ +284,5 @@ > > + * JSGC_SLICE_TIME_BUDGET. > > + * javascript.options.mem.gc_incremental_slice_ms > > + */ > > +static const int64_t DefaultTimeBudgetDefault = > > + SliceBudget::UnlimitedTimeBudget; > > The Default...Default name bothers me for reasons that I couldn't initially > put a finger on. But I think I know now. > > Those two "Defaults" don't mean the same thing. It's the default setting for > defaultTimeBudget_. So the first default (from defaultTimeBudget_) is "what > to use for GCs where no other time budget is specified." The trailing > default is "what to set the above default to if configuration does not say > otherwise." > > But I can't come up with a better name for either, given that they both > really are defaults. I agree, and me neither :-\ > What would you think about putting all of this stuff into a namespace or > struct with "default" in its name, perhaps js::gc::DefaultSettings? Then > this would be DefaultSettings::DefaultTimeBudget, alongside things like > DefaultSettings::MaxEmptyChunkCount etc. To me at least, that seems more > understandable. (I'm not settled on the exact name or anything. > JS::GCTuningDefaults is a totally different name that would work too.) I had this idea also, but I didn't know if this was a "normal" thing to do (C++ style wise) and didn't want to overcomplicate things. I like js::gc::TuningDefaults (or similar). > Anyway, I trust your instincts on naming, so even if you want to leave it > exactly as-is, I'm fine with it. I'll consider this, I might add another patch or just let it land the way it is. Cheers.
Assignee | ||
Comment 37•4 years ago
|
||
(In reply to Steve Fink [:sfink] [:s:] (PTO Aug 16-23) from comment #35) > Comment on attachment 8896814 [details] [diff] [review] > Bug 1386660 (part 6) - Clarify relationships between prefs, JSGC params, and > their defaults > > Review of attachment 8896814 [details] [diff] [review]: > ----------------------------------------------------------------- > > Very nice! This stuff is way easier to follow. So far, I've just been > searching through code whenever someone asks me about one of these. Cool. They've all got the JSGC_ symbol name near them so if you use editor tags or searchfox, you can follow it for more information. This was part of my intention with cleaning it up. > ::: js/src/gc/GCRuntime.h > @@ +1328,5 @@ > > /* > > * Whether compacting GC can is enabled globally. > > + * > > + * JSGC_COMPACTING_ENABLED > > + * pref: javascript.options.mem.gc_compacting > > all of these javascript.options.mem.gc_* names make me wonder if we could > rename them all to javascript.options.gc.*. The 'mem' part doesn't seem > helpful. But don't hold up this bug for that. I like that, but I also heard that we try to avoid renaming these. Maybe because it breaks something else, or maybe because it breaks user's configurations. Maybe make this a separate bug? What are your thoughts Jon? > ::: js/src/jsapi.h > @@ +1855,5 @@ > > + /** > > + * Maximum size the GC mark stack can grow to. > > + * > > + * Pref: none > > + * Shell default: size_t(-1) > > Can you comment what -1 means? Nope. I don't know, it was like that when I got here. :-) I think it just means "unlimited" but in a really bad way. Unless jonco knows what was intended I'll add a comment saying that we don't know.
Flags: needinfo?(jcoppeard)
Assignee | ||
Comment 38•4 years ago
|
||
Updated to address review comments. I did choose to add a namespace for the defaults. Thanks.
Attachment #8896300 -
Attachment is obsolete: true
Attachment #8897743 -
Flags: review+
Assignee | ||
Comment 39•4 years ago
|
||
Updated to address review comments.
Attachment #8896814 -
Attachment is obsolete: true
Attachment #8897744 -
Flags: review+
Assignee | ||
Comment 40•4 years ago
|
||
Updated to merge cleanly after other changes.
Attachment #8897746 -
Flags: review+
Assignee | ||
Comment 41•4 years ago
|
||
(In reply to Paul Bone [:pbone] from comment #37) > (In reply to Steve Fink [:sfink] [:s:] (PTO Aug 16-23) from comment #35) > > Comment on attachment 8896814 [details] [diff] [review] > > Bug 1386660 (part 6) - Clarify relationships between prefs, JSGC params, and > > their defaults > > > > Review of attachment 8896814 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > Very nice! This stuff is way easier to follow. So far, I've just been > > searching through code whenever someone asks me about one of these. > > Cool. They've all got the JSGC_ symbol name near them so if you use editor > tags or searchfox, you can follow it for more information. This was part of > my intention with cleaning it up. > > > ::: js/src/gc/GCRuntime.h > > @@ +1328,5 @@ > > > /* > > > * Whether compacting GC can is enabled globally. > > > + * > > > + * JSGC_COMPACTING_ENABLED > > > + * pref: javascript.options.mem.gc_compacting > > > > all of these javascript.options.mem.gc_* names make me wonder if we could > > rename them all to javascript.options.gc.*. The 'mem' part doesn't seem > > helpful. But don't hold up this bug for that. > > I like that, but I also heard that we try to avoid renaming these. Maybe > because it breaks something else, or maybe because it breaks user's > configurations. Maybe make this a separate bug? What are your thoughts Jon? > > > ::: js/src/jsapi.h > > @@ +1855,5 @@ > > > + /** > > > + * Maximum size the GC mark stack can grow to. > > > + * > > > + * Pref: none > > > + * Shell default: size_t(-1) > > > > Can you comment what -1 means? > > Nope. I don't know, it was like that when I got here. :-) I think it just > means "unlimited" but in a really bad way. > > Unless jonco knows what was intended I'll add a comment saying that we don't > know. Nevermind, I referred to the constant in Marker.cpp where this is defined. I should have done that like I had done with the other defaults. I still don't know why it's size_t(-1), but now it points at the original code for that.
Flags: needinfo?(jcoppeard)
Assignee | ||
Comment 42•4 years ago
|
||
This is ready for checkin. There are two try links in previous comments, the failing tests from the first one were repeated in the second one after fixing a problem. Thank you.
Keywords: checkin-needed
Comment 43•4 years ago
|
||
Can you please fold the Windows bustage fix into whatever patch caused it so bisection isn't broken?
Flags: needinfo?(pbone)
Keywords: checkin-needed
Updated•4 years ago
|
Attachment #8897301 -
Attachment is obsolete: true
Comment 44•4 years ago
|
||
(In reply to Paul Bone [:pbone] from comment #37) > > Can you comment what -1 means? > > I think it just means "unlimited" but in a really bad way. That is correct. We should use SIZE_MAX instead.
Assignee | ||
Comment 45•4 years ago
|
||
Re-upload to fix compilation on Windows.
Attachment #8893227 -
Attachment is obsolete: true
Attachment #8898091 -
Flags: review+
Assignee | ||
Comment 46•4 years ago
|
||
Re-upload to fix compilation on windows.
Attachment #8895635 -
Attachment is obsolete: true
Attachment #8898097 -
Flags: review+
Assignee | ||
Comment 47•4 years ago
|
||
Re-upload to fix build on windows, also use SIZE_MAX rather than size_t(-1).
Attachment #8897743 -
Attachment is obsolete: true
Attachment #8898098 -
Flags: review+
Assignee | ||
Updated•4 years ago
|
Attachment #8897746 -
Flags: review+
Assignee | ||
Comment 48•4 years ago
|
||
Hi Ryan, I've re-uploaded 3 of the patches since this code was moved in some of them and even if I changed 0.9 to 0.9f in the first one, it wouldn't have been clear where that code is moved to by the others. This is why I didn't do it earlier, I wasn't sure if we considered it important to be able to bisect history (I like to be able to, personally, but I don't know what we do as an organization). Thanks.
Flags: needinfo?(pbone)
Keywords: checkin-needed
Comment 49•4 years ago
|
||
seems there are some problems like patching file js/src/jsgc.cpp Hunk #1 FAILED at 266 1 out of 1 hunks FAILED -- saving rejects to file js/src/jsgc.cpp.rej patch failed, unable to continue (try -v) patch failed, rejects left in working directory errors during apply, please fix and qrefresh pref-6a when applying part 6
Flags: needinfo?(pbone)
Keywords: checkin-needed
Assignee | ||
Comment 50•4 years ago
|
||
Sorry Tomcat, This should apply cleanly.
Attachment #8897744 -
Attachment is obsolete: true
Flags: needinfo?(pbone)
Attachment #8898156 -
Flags: review+
Updated•4 years ago
|
Attachment #8897746 -
Attachment is obsolete: true
Comment 51•4 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/88057095fa2f Part 1: Update a comment to reflect current code. r=jonco https://hg.mozilla.org/integration/mozilla-inbound/rev/32e58ff6a1ee Part 2: Use float for zoneAllocThresholdFactor. r=sfink https://hg.mozilla.org/integration/mozilla-inbound/rev/6f05eb69802f Part 3: Provide code to reset SM/GC parameters. r=jonco https://hg.mozilla.org/integration/mozilla-inbound/rev/a1c53785fd4b Part 4: Refactor pref code in nsJSEnvironment.cpp. r=jonco https://hg.mozilla.org/integration/mozilla-inbound/rev/f1fcbcb67951 Part 5: Add constants to avoid multiple hard-coded values. r=sfink https://hg.mozilla.org/integration/mozilla-inbound/rev/ed8427cb4342 Part 6: Clarify relationships between prefs. r=sfink
Comment 52•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/88057095fa2f https://hg.mozilla.org/mozilla-central/rev/32e58ff6a1ee https://hg.mozilla.org/mozilla-central/rev/6f05eb69802f https://hg.mozilla.org/mozilla-central/rev/a1c53785fd4b https://hg.mozilla.org/mozilla-central/rev/f1fcbcb67951 https://hg.mozilla.org/mozilla-central/rev/ed8427cb4342
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•