Closed Bug 838265 Opened 12 years ago Closed 12 years ago

JavaScript profiling should use static function names

Categories

(Core :: Gecko Profiler, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: BenWa, Unassigned)

References

()

Details

As of bug 433529 and http://javascript-reverse.tumblr.com/post/34328529526/javascript-function-name-inference-aka-stop-function we can statically name function but the profiler doesn't pick this up unfortunately leaving a lot of anonymous functions.
I just test this and confirmed it by looking at the source code. In the JS engine we always tell SPS the inferred name. For example var f = function() in Scratchpad shows up as f() @ 2:10. Looking at the source confirms the usage of displayAtom() http://dxr.mozilla.org/mozilla-central/js/src/vm/SPSProfiler.cpp.html#l191. I think we could do a better job with naming stuff as "eval" or "global" scope.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.