From 00bb3f089f9c37f262aeb1836712b739bc46584e Mon Sep 17 00:00:00 2001 From: Jim Chen Date: Fri, 6 Jun 2014 18:39:39 -0400 Subject: [PATCH] Bug 1013326 - Change js::RunScript to a JS pseudostack entry; r=djvj --- js/src/vm/Interpreter.cpp | 2 +- js/src/vm/SPSProfiler.cpp | 6 ++++-- js/src/vm/SPSProfiler.h | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index 12452d30a10b..be3ce0718b59 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -368,7 +368,7 @@ js::RunScript(JSContext *cx, RunState &state) { JS_CHECK_RECURSION(cx, return false); - SPSEntryMarker marker(cx->runtime()); + SPSEntryMarker marker(cx->runtime(), state.script()); state.script()->ensureNonLazyCanonicalFunction(cx); diff --git a/js/src/vm/SPSProfiler.cpp b/js/src/vm/SPSProfiler.cpp index e8b40bd1da44..aa6832573713 100644 --- a/js/src/vm/SPSProfiler.cpp +++ b/js/src/vm/SPSProfiler.cpp @@ -318,7 +318,8 @@ SPSProfiler::allocProfileString(JSScript *script, JSFunction *maybeFun) return cstr; } -SPSEntryMarker::SPSEntryMarker(JSRuntime *rt +SPSEntryMarker::SPSEntryMarker(JSRuntime *rt, + JSScript *script MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL) : profiler(&rt->spsProfiler) { @@ -328,8 +329,9 @@ SPSEntryMarker::SPSEntryMarker(JSRuntime *rt return; } size_before = *profiler->size_; - profiler->push("js::RunScript", this, nullptr, nullptr, /* copy = */ false); + profiler->push("js::RunScript", nullptr, script, script->code(), /* copy = */ false); } + SPSEntryMarker::~SPSEntryMarker() { if (profiler != nullptr) { diff --git a/js/src/vm/SPSProfiler.h b/js/src/vm/SPSProfiler.h index 639b17270fd1..2736d331faf4 100644 --- a/js/src/vm/SPSProfiler.h +++ b/js/src/vm/SPSProfiler.h @@ -246,8 +246,9 @@ SPSProfiler::stringsReset() class SPSEntryMarker { public: - explicit SPSEntryMarker(JSRuntime *rt - MOZ_GUARD_OBJECT_NOTIFIER_PARAM); + explicit SPSEntryMarker(JSRuntime *rt, + JSScript *script + MOZ_GUARD_OBJECT_NOTIFIER_PARAM); ~SPSEntryMarker(); private: