Bug 1547104 - Add initial JS profiler subcategories r=mstange
authorMatthew Gaudet <mgaudet@mozilla.com>
Fri, 26 Apr 2019 13:47:40 +0000
changeset 530294 71d3155b4fa79dd6230aa1ab885617e1d2bc2fb3
parent 530293 bead97221072097029cf26069459a9fb5e1a0d49
child 530295 9c36551d262a0581a34d7a450bd2284d76f3e8cf
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1547104
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547104 - Add initial JS profiler subcategories r=mstange Differential Revision: https://phabricator.services.mozilla.com/D28901
js/public/ProfilingCategory.h
js/src/frontend/BytecodeCompiler.cpp
js/src/jit/BaselineJIT.cpp
js/src/jit/Ion.cpp
--- a/js/public/ProfilingCategory.h
+++ b/js/public/ProfilingCategory.h
@@ -42,16 +42,19 @@
     SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction, "Frame construction")       \
     SUBCATEGORY(LAYOUT, LAYOUT_Reflow, "Reflow")                              \
     SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing, "CSS parsing")                     \
     SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery, "Selector query")               \
     SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation, "Style computation")         \
   END_CATEGORY                                                                \
   BEGIN_CATEGORY(JS, "JavaScript", "yellow")                                  \
     SUBCATEGORY(JS, JS, "Other")                                              \
+    SUBCATEGORY(JS, JS_Parsing, "JS Parsing")                                 \
+    SUBCATEGORY(JS, JS_IonCompilation, "Ion JIT Compilation")                 \
+    SUBCATEGORY(JS, JS_BaselineCompilation, "Baseline JIT Compilation")       \
   END_CATEGORY                                                                \
   BEGIN_CATEGORY(GCCC, "GC / CC", "orange")                                   \
     SUBCATEGORY(GCCC, GCCC, "Other")                                          \
   END_CATEGORY                                                                \
   BEGIN_CATEGORY(NETWORK, "Network", "lightblue")                             \
     SUBCATEGORY(NETWORK, NETWORK, "Other")                                    \
   END_CATEGORY                                                                \
   BEGIN_CATEGORY(GRAPHICS, "Graphics", "green")                               \
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -523,26 +523,28 @@ JSScript* frontend::ScriptCompiler<Unit>
     return nullptr;
   }
 
   JSContext* cx = info.cx;
 
   for (;;) {
     ParseNode* pn;
     {
-      AutoGeckoProfilerEntry pseudoFrame(cx, "script parsing");
+      AutoGeckoProfilerEntry pseudoFrame(cx, "script parsing",
+                                         JS::ProfilingCategoryPair::JS_Parsing);
       if (sc->isEvalContext()) {
         pn = parser->evalBody(sc->asEvalContext());
       } else {
         pn = parser->globalBody(sc->asGlobalContext());
       }
     }
 
     // Successfully parsed. Emit the script.
-    AutoGeckoProfilerEntry pseudoFrame(cx, "script emit");
+    AutoGeckoProfilerEntry pseudoFrame(cx, "script emit",
+                                       JS::ProfilingCategoryPair::JS_Parsing);
     if (pn) {
       if (sc->isEvalContext() && sc->hasDebuggerStatement() &&
           !cx->helperThread()) {
         // If the eval'ed script contains any debugger statement, force
         // construction of arguments objects for the caller script and any other
         // scripts it is transitively nested inside. The debugger can access any
         // variable on the scope chain.
         if (!info.deoptimizeArgumentsInEnclosingScripts(cx, environment)) {
--- a/js/src/jit/BaselineJIT.cpp
+++ b/js/src/jit/BaselineJIT.cpp
@@ -200,17 +200,19 @@ JitExecStatus jit::EnterBaselineAtBranch
 }
 
 MethodStatus jit::BaselineCompile(JSContext* cx, JSScript* script,
                                   bool forceDebugInstrumentation) {
   cx->check(script);
   MOZ_ASSERT(!script->hasBaselineScript());
   MOZ_ASSERT(script->canBaselineCompile());
   MOZ_ASSERT(IsBaselineEnabled(cx));
-  AutoGeckoProfilerEntry pseudoFrame(cx, "Baseline script compilation");
+  AutoGeckoProfilerEntry pseudoFrame(
+      cx, "Baseline script compilation",
+      JS::ProfilingCategoryPair::JS_BaselineCompilation);
 
   script->ensureNonLazyCanonicalFunction();
 
   TempAllocator temp(&cx->tempLifoAlloc());
   JitContext jctx(cx, nullptr);
 
   BaselineCompiler compiler(cx, temp, script);
   if (!compiler.init()) {
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -2211,17 +2211,19 @@ static OptimizationLevel GetOptimization
 }
 
 static MethodStatus Compile(JSContext* cx, HandleScript script,
                             BaselineFrame* osrFrame, jsbytecode* osrPc,
                             bool forceRecompile = false) {
   MOZ_ASSERT(jit::IsIonEnabled(cx));
   MOZ_ASSERT(jit::IsBaselineEnabled(cx));
   MOZ_ASSERT_IF(osrPc != nullptr, LoopEntryCanIonOsr(osrPc));
-  AutoGeckoProfilerEntry pseudoFrame(cx, "Ion script compilation");
+  AutoGeckoProfilerEntry pseudoFrame(
+      cx, "Ion script compilation",
+      JS::ProfilingCategoryPair::JS_IonCompilation);
 
   if (!script->hasBaselineScript()) {
     return Method_Skipped;
   }
 
   if (script->isDebuggee() || (osrFrame && osrFrame->isDebuggee())) {
     TrackAndSpewIonAbort(cx, script, "debugging");
     return Method_Skipped;