These annotations aren't doing anything useful. The important thing with
the PseudoStack is that, during pushes, the stack pointer incrementing happens
after the new entry is written, and this is ensured by the stack pointer being
Atomic.
The patch also improves the comments on PseudoStack.
--HG--
extra : rebase_source : 100f8a5e4b750c15fac66175550c4c284a141f16
There are three flags in ProfileEntry::Flags, which suggests there are 2**3 = 8
combinations. But there are only actually 4 valid combinations.
This patch converts the three flags to a single "kind" enum, which makes things
clearer. Note also that the patch moves the condition at the start of
AddPseudoEntry() to its callsite, for consistency with the earlier JS_OSR entry
kind check.
--HG--
extra : rebase_source : 0950769ee1530291860ef3be47d240df5939e871
This patch:
- renames flags_ as flagsAndCategory_ because it contains both the flags and
the category;
- uses << for some bitfield definitions, because it's easier to read;
- removes some dead methods from ProfileEntry;
- removes the unnecessary JS_FRIEND_API from setPC().
--HG--
extra : rebase_source : 24e24b2f6c948b770293ea497be4933f58be3722
- The profiler gives the JS engine a reference to the pseudo-stack via
SetContextProfiilngStack(). That function now takes a |PseudoStack*| instead
of a |ProfileEntry*| and pointer to the stack pointer.
- PseudoStack now has a |kMaxEntries| field, which is easier to work with than
|mozilla::ArrayLength(entries)|.
- AddressOfStackPointer() is no longer needed.
- The patch also neatens up the push operations significantly. PseudoStack now
has pushCppFrame() and pushJsFrame(), which nicely encapsulate the two main
cases. These delegate to the updated initCppFrame() and initJsFrame()
functions in ProfileEntry.
- Renames max_stck in testProfileStrings.cpp as peakStackPointer, which is a
clearer name.
- Removes a couple of checks from testProfileStrings.cpp. These checks made
sense when the pseudo-stack was accessed via raw manipulation, but are not
applicable now because we can't artificially limit the maximum stack size so
easily.
This includes renaming its fields to match SpiderMonkey naming conventions
instead of Gecko naming conventions.
This patch is just about moving the code. The next patch will change
SpiderMonkey to actually use PseudoStack directly.
--HG--
extra : rebase_source : 27e77ddf950201eb6bdba60003218056442cf7ab
ProfileEntry has |string|, which can be static or dynamic, and |dynamicString|.
If |string| is dynamic, the FRAME_LABEL_COPY flag must be set, and it will be
copied into profiler output.
But there is only one place that uses dynamic |string| values, in SpiderMonkey.
And that place doesn't use |dynamicString|. So this patch changes that place to
use an empty |string| and put the old dynamic |string| value in
|dynamicString|. This in turn removes the need for FRAME_LABEL_COPY.
One minor wrinkle is that when |dynamicString| is used the old code put a space
between |string| and |dynamicString|. The new code omits the space if |string|
is empty.
The patch also renames ProfileEntry::string as ProfileEntry::label_, which
better matches how it's used, and ProfileEntry::dynamicString as
ProfileEntry::dynamicString_ so the getter can be renamed dynamicString().
AddPseudoEntry() has a single callsite which always passes nullptr for the
last argument. This means that js::ProfilingGetPC() is never called, and so can
be removed. (Even if it was called, it always returns nullptr because ipToPC()
always returns nullptr!)
--HG--
extra : rebase_source : 1260d726c79bf5116143da9904d39b38e3c93837
Remove the definition of sig_safe_t, which is only used by PseudoStack,
and replace the uses with mozilla::Atomic<uint32_t>.
MozReview-Commit-ID: GcPd9R94Vci
--HG--
extra : rebase_source : dcc05a219d59ffdc0486ef2e7118d888c6a93fda
Instead of copying and concatenating strings into an mDest buffer in
SamplerStackFramePrintfRAII, require callers to keep the string buffer alive
for the duration of the current scope, and store the pointer to the annotation
string in the ProfileEntry. During stackwalking, concatenate the label and the
annotation (separated by a space) and store the resulting string in the
profile buffer.
MozReview-Commit-ID: GEjcLrhhdvb
--HG--
extra : rebase_source : 683749421ee2122805a249cf413e882ee5f33331
The most significant thing about this is that it changes some built-in function
names:
- enableSPSProfiling() -> enableGeckoProfiling()
- enableSPSProfilingWithSlowAssertions() -> enableGeckoProfiling(WithSlowAssertions)
- disableSPSProfiling() -> disableGeckoProfiling()
- {en,dis}ableSPSProfiling*() -> {en,dis}ableGeckoProfiling*()
- readSPSProfilingStack() -> readGeckoProfilingStack()
It also requires two filename changes:
- SPSProfiler.{h,cpp} -> GeckoProfiler.{h,cpp}
And some type name changes, e.g.:
- AutoSPSEntry -> AutoGeckoProfilerEntry
- SPSProfiler -> GeckoProfiler
- SPSInstrumentation -> GeckoProfilerInstrumentation
- SPSEntryMarker -> GeckoProfilerEntryMarker
- SPSBaselineOSRMarker -> GeckoProfilerBaselineOSRMarker
And various method/function/variable name changes, and some comment changes.
--HG--
rename : js/src/vm/SPSProfiler.cpp => js/src/vm/GeckoProfiler.cpp
rename : js/src/vm/SPSProfiler.h => js/src/vm/GeckoProfiler.h
extra : rebase_source : f681e2c3c269aec483bba9d60c7afc39776e14bf
This commit renames ProfileEntry::set{Js,Cpp}Frame methods to
ProfileEntry::init{Js,Cpp}Frame to highlight the fact that they are intended to
initialize the entry, and that setting other flags should happen after one of
these calls.