Bug 895015 - OdinMonkey: make asm.js entries show up builtin FF profiler (r=bbouvier)

--HG--
extra : rebase_source : 0f682fde81ef8e9dc89f0b9ad76e928d24358394
This commit is contained in:
Luke Wagner 2013-07-17 17:22:39 -05:00
parent 992fab173b
commit e55b0aa8d9
2 changed files with 7 additions and 1 deletions

View File

@ -261,8 +261,12 @@ AsmJSActivation::AsmJSActivation(JSContext *cx, AsmJSModule &module)
resumePC_(NULL)
{
if (cx->runtime()->spsProfiler.enabled()) {
// Use a profiler string that matches jsMatch regex in
// browser/devtools/profiler/cleopatra/js/parserWorker.js.
// (For now use a single static string to avoid further slowing down
// calls into asm.js.)
profiler_ = &cx->runtime()->spsProfiler;
profiler_->enterNative("asm.js code", this);
profiler_->enterNative("asm.js code :0", this);
}
prev_ = cx_->runtime()->mainThread.asmJSActivationStack_;

View File

@ -205,6 +205,8 @@ SPSProfiler::pop()
const char*
SPSProfiler::allocProfileString(JSContext *cx, JSScript *script, JSFunction *maybeFun)
{
// Note: this profiler string is regexp-matched by
// browser/devtools/profiler/cleopatra/js/parserWorker.js.
DebugOnly<uint64_t> gcBefore = cx->runtime()->gcNumber;
StringBuffer buf(cx);
bool hasAtom = maybeFun != NULL && maybeFun->displayAtom() != NULL;