Closed Bug 1642783 Opened 5 years ago Closed 4 years ago

Missing JavaScript stack frames in the profiler when executing in the Interpreter

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mstange, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

When loading https://show.apartposters.com/C4HMrDZ/showroom-3 , some JS code is running on a DOM Worker thread, and it all shows up as time spent in the self-hosted "next" function: https://share.firefox.dev/3eJ5Al1

Severity: -- → S4
Priority: -- → P3

Markus, is this blocking you, and also is there a reduction of this into some reproducible test case?

Flags: needinfo?(mstange)
Priority: P3 → --

It's not blocking me now, but missing JS stack frames in general have the potential to waste time for others.
I don't have a reduction of this, unfortunately.

Flags: needinfo?(mstange)

Does this happen only when running in interpreter-only mode? Or is jitcode running here?

From the profile, it looks like there is jitcode running but it's the interpreter's jit code (Baseline interpreter?). More specifically, if you look at https://share.firefox.dev/2UbIBan , the child nodes of Interpret are unsymbolicated addresses, which usually indicates jit code, and those frames call into functions such as js::jit::FreshenLexicalEnv, js::jit::PushLexicalEnv, js::NativeGetElement.

It is also possible that I misdiagnosed this bug and that all the time really is spent in next. But I'd be curious to learn how that can happen.

My best guess looking at this is that we have a js-generator-function that is running in baseline-interpreter. When we are inside next() we resume the generator and do some stack surgery. We are probably not updating the profiler activation data.

The issue that we don't end up with a frame for the resumed function and it all gets assigned to next() which is the generator resume code. This looks like an issue with interpreter.

This might be solvable with the same approach as when we OSR from C++ to Baseline in the middle of a function. https://searchfox.org/mozilla-central/source/tools/profiler/core/platform.cpp#1631-1639

Assignee: nobody → tcampbell
Priority: -- → P2

The hubs code seems to have changed so I don't see the same DOM Worker behavior. I believe the underlying issue here was fixed by the profiler fixups around merging samples so closing this bug.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.