JavaScript profiling should use static function names

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
6 years ago
6 years ago

People

(Reporter: BenWa, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

6 years ago
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.
(Reporter)

Updated

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