Closed Bug 974980 Opened 8 years ago Closed 8 years ago

Always push a js::RunScript frame in PseudoStack

Categories

(Core :: Gecko Profiler, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: jchen, Assigned: jchen)

Details

Attachments

(1 file)

For hangs (ANR or BHR) that happen inside JS, we don't get JS frames in the pseudostack because the profiler is not running in JS mode when we collect the ANR/BHR. However, we should still push a JS marker frame so we know the hang happened inside JS.

Right now we only push a "js::RunScript" frame if JS mode is enabled. I think we should switch to always pushing a "js::RunScript" frame.
This patch makes SPSEntryMarker always push a "js::RunScript" frame regardless of whether JS profiling is enabled, as long as the profiler is installed. A "no-copy" frame is needed because BHR only saves no-copy frames during hangs.
Attachment #8379115 - Flags: review?(bgirard)
Comment on attachment 8379115 [details] [diff] [review]
Always push a js:RunScript frame in pseudostack (v1)

Review of attachment 8379115 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/vm/SPSProfiler.h
@@ +130,5 @@
>      void push(const char *string, void *sp, JSScript *script, jsbytecode *pc);
> +    void pushNoCopy(const char *string, void *sp,
> +                    JSScript *script, jsbytecode *pc) {
> +        push(string, reinterpret_cast<void*>(
> +            reinterpret_cast<uintptr_t>(sp) | 0x1), script, pc);

Ideally 0x1 would be shared global const. If you don't want to make that larger change at least use a temporary:
uintptr_t NO_COPY_BIT = 0x1
...
reinterpret_cast<uintptr_t>(sp) | NO_COPY_BIT
Attachment #8379115 - Flags: review?(bgirard) → review+
https://hg.mozilla.org/mozilla-central/rev/33f11ad7ef1e
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.