Closed
Bug 1206596
Opened 9 years ago
Closed 9 years ago
[jsdbg2] Use FastBernoulliTrial class to control object allocation site tracking
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: jimb, Assigned: jimb)
References
Details
Attachments
(3 files)
4.35 KB,
patch
|
fitzgen
:
review+
|
Details | Diff | Splinter Review |
8.54 KB,
patch
|
fitzgen
:
review+
|
Details | Diff | Splinter Review |
1.71 KB,
patch
|
Details | Diff | Splinter Review |
In preparation for supporting string allocation site tracking, I've abstracted out the Bernoulli trial logic into its own MFBT class, implemented in bug 1206357. Our object allocation site tracking should use this class, instead of integrating the logic into the SavedStacks class.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8663514 -
Flags: review?(nfitzgerald)
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8663515 -
Flags: review?(nfitzgerald)
Assignee | ||
Comment 3•9 years ago
|
||
This patch depends on the refactoring implemented in bug 1206594.
Depends on: 1206594
Updated•9 years ago
|
Attachment #8663514 -
Flags: review?(nfitzgerald) → review+
Comment 4•9 years ago
|
||
Comment on attachment 8663515 [details] [diff] [review] Change js::SavedStacks to use mozilla::FastBernoulliTrial. Review of attachment 8663515 [details] [diff] [review]: ----------------------------------------------------------------- \o/ ::: js/src/builtin/TestingFunctions.cpp @@ +858,5 @@ > int32_t seed; > if (!ToInt32(cx, args[0], &seed)) > return false; > > + cx->compartment()->savedStacks().setRNGState(seed, seed * 33); Yay! Less magical bitwise arithmetic incantations! But... what is 33? I guess it doesn't matter that much for testing functions? ::: js/src/vm/SavedStacks.cpp @@ +1331,5 @@ > > if ((*dbgp)->trackingAllocationSites && (*dbgp)->enabled) { > foundAnyDebuggers = true; > + probability = std::max((*dbgp)->allocationSamplingProbability, > + probability); Aside: this whole for loop makes me think we should have a template <class Iterable, class Initial, class F> Reduce(Iterable& iter, Initial val, F f); template. It /should/ be relatively easy, fast, generic, and expressive now with lambdas, range-based-for-loops and the inlining implied/enabled by templates, right? /me wonders how much push back this style might beget... ::: js/src/vm/SavedStacks.h @@ +152,5 @@ > friend bool JS::ubi::ConstructSavedFrameStackSlow(JSContext* cx, > JS::ubi::StackFrame& ubiFrame, > MutableHandleObject outSavedFrameStack); > > + Nit: I don't think we need this extra line. @@ +179,1 @@ > bool creatingSavedFrame; Nit: can you either align all of these members' names again or revert them all to one space after the type?
Attachment #8663515 -
Flags: review?(nfitzgerald) → review+
Assignee | ||
Comment 5•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2a4b512df31d589ff52000cd172be8eb8cf17851 Bug 1206596: Make random_generateSeed visible, and let it generate wider seeds. r=fitzgen https://hg.mozilla.org/integration/mozilla-inbound/rev/df0f9214b22402bd7badcd4d3547da1e3bf7ff5a Bug 1206596: Change js::SavedStacks to use mozilla::FastBernoulliTrial. r=fitzgen
Assignee | ||
Comment 6•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/0c9a1a3a654eddc1df3506406564e0221ec033bf Bug 1206596: Address review nits. DONTBUILD r=fitzgen
Assignee | ||
Comment 7•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Flags: in-testsuite+
Target Milestone: --- → mozilla44
Comment 8•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2a4b512df31d https://hg.mozilla.org/mozilla-central/rev/df0f9214b224 https://hg.mozilla.org/mozilla-central/rev/0c9a1a3a654e
You need to log in
before you can comment on or make changes to this bug.
Description
•