Backed out changeset 5c168f572252 (bug 996509)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 21 Nov 2014 08:04:21 +0100
changeset 241100 f460adc36fb6cdaf31ce85cfd4236545f5a84659
parent 241099 15a721c1319f9ddff8ee6134ce3ee124e9e2ac7f
child 241101 d2f30e292c15f1585f5a1d2e6ffcd777a3e9ca54
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs996509
milestone36.0a1
backs out5c168f5722527ba41882f316220a6206549ecb8e
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
Backed out changeset 5c168f572252 (bug 996509)
js/src/jit/IonMacroAssembler.cpp
js/src/vm/Interpreter.cpp
js/src/vm/TraceLogging.cpp
js/src/vm/TraceLogging.h
--- a/js/src/jit/IonMacroAssembler.cpp
+++ b/js/src/jit/IonMacroAssembler.cpp
@@ -1720,42 +1720,62 @@ MacroAssembler::tracelogStop(Register lo
 
     PushRegsInMask(RegisterSet::Volatile());
 
     RegisterSet regs = RegisterSet::Volatile();
     regs.takeUnchecked(logger);
 
     Register temp = regs.takeGeneral();
 
+#ifdef DEBUG
+    void (&TraceLogFunc)(TraceLogger*, uint32_t) = TraceLogStopEvent;
+
     setupUnalignedABICall(2, temp);
     passABIArg(logger);
     move32(Imm32(textId), temp);
     passABIArg(temp);
+#else
+    void (&TraceLogFunc)(TraceLogger*) = TraceLogStopEvent;
 
-    callWithABINoProfiling(JS_FUNC_TO_DATA_PTR(void *, TraceLogStopEvent));
+    setupUnalignedABICall(1, temp);
+    passABIArg(logger);
+#endif
+
+    callWithABINoProfiling(JS_FUNC_TO_DATA_PTR(void *, TraceLogFunc));
 
     PopRegsInMask(RegisterSet::Volatile());
 }
 
 void
 MacroAssembler::tracelogStop(Register logger, Register textId)
 {
     PushRegsInMask(RegisterSet::Volatile());
     RegisterSet regs = RegisterSet::Volatile();
     regs.takeUnchecked(logger);
 
+#ifdef DEBUG
+    void (&TraceLogFunc)(TraceLogger*, uint32_t) = TraceLogStopEvent;
+
     regs.takeUnchecked(textId);
 
     Register temp = regs.takeGeneral();
 
     setupUnalignedABICall(2, temp);
     passABIArg(logger);
     passABIArg(textId);
+#else
+    void (&TraceLogFunc)(TraceLogger*) = TraceLogStopEvent;
 
-    callWithABINoProfiling(JS_FUNC_TO_DATA_PTR(void *, TraceLogStopEvent));
+    Register temp = regs.takeGeneral();
+
+    setupUnalignedABICall(1, temp);
+    passABIArg(logger);
+#endif
+
+    callWithABINoProfiling(JS_FUNC_TO_DATA_PTR(void *, TraceLogFunc));
 
     PopRegsInMask(RegisterSet::Volatile());
 }
 #endif
 
 void
 MacroAssembler::convertInt32ValueToDouble(const Address &address, Register scratch, Label *done)
 {
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1758,17 +1758,17 @@ CASE(JSOP_RETRVAL)
     CHECK_BRANCH();
 
   successful_return_continuation:
     interpReturnOK = true;
   return_continuation:
     if (activation.entryFrame() != REGS.fp()) {
         // Stop the engine. (No details about which engine exactly, could be
         // interpreter, Baseline or IonMonkey.)
-        TraceLogStopEvent(logger, TraceLogger::Engine);
+        TraceLogStopEvent(logger);
         TraceLogStopEvent(logger, TraceLogger::Scripts);
 
         interpReturnOK = Debugger::onLeaveFrame(cx, REGS.fp(), interpReturnOK);
 
         REGS.fp()->epilogue(cx);
 
   jit_return_pop_frame:
 
@@ -3486,17 +3486,17 @@ DEFAULT()
 
   exit:
     interpReturnOK = Debugger::onLeaveFrame(cx, REGS.fp(), interpReturnOK);
 
     REGS.fp()->epilogue(cx);
 
     gc::MaybeVerifyBarriers(cx, true);
 
-    TraceLogStopEvent(logger, TraceLogger::Engine);
+    TraceLogStopEvent(logger);
     TraceLogStopEvent(logger, scriptLogId);
 
     /*
      * This path is used when it's guaranteed the method can be finished
      * inside the JIT.
      */
   leave_on_safe_point:
 
--- a/js/src/vm/TraceLogging.cpp
+++ b/js/src/vm/TraceLogging.cpp
@@ -676,19 +676,17 @@ TraceLogger::startEvent(uint32_t id, uin
 
     return true;
 }
 
 void
 TraceLogger::stopEvent(uint32_t id)
 {
 #ifdef DEBUG
-    if (id != TraceLogger::Scripts && id != TraceLogger::Engine &&
-        stack.size() > 1 && stack.lastEntry().active())
-    {
+    if (stack.size() > 1 && id != TraceLogger::Scripts && stack.lastEntry().active()) {
         TreeEntry entry;
         MOZ_ASSERT(getTreeEntry(stack.lastEntry().treeId(), &entry));
         MOZ_ASSERT(entry.textId() == id);
     }
 #endif
     stopEvent();
 }
 
@@ -798,31 +796,28 @@ TraceLogging::lazyInit()
             "\n"
             "Collections:\n"
             "  Default        Output all default\n"
             "  IonCompiler    Output all information about compilation\n"
             "\n"
             "Specific log items:\n"
         );
         for (uint32_t i = 1; i < TraceLogger::LAST; i++) {
-            if (!TraceLogger::textIdIsToggable(i))
-                continue;
             printf("  %s\n", text[i]);
         }
         printf("\n");
         exit(0);
         /*NOTREACHED*/
     }
 
-    for (uint32_t i = 1; i < TraceLogger::LAST; i++) {
-        if (TraceLogger::textIdIsToggable(i))
-            enabledTextIds[i] = ContainsFlag(env, text[i]);
-        else
-            enabledTextIds[i] = true;
-    }
+    for (uint32_t i = 1; i < TraceLogger::LAST; i++)
+        enabledTextIds[i] = ContainsFlag(env, text[i]);
+
+    enabledTextIds[TraceLogger::TL_Error] = true;
+    enabledTextIds[TraceLogger::TL] = true;
 
     if (ContainsFlag(env, "Default")) {
         enabledTextIds[TraceLogger::Bailout] = true;
         enabledTextIds[TraceLogger::Baseline] = true;
         enabledTextIds[TraceLogger::BaselineCompilation] = true;
         enabledTextIds[TraceLogger::GC] = true;
         enabledTextIds[TraceLogger::GCAllocation] = true;
         enabledTextIds[TraceLogger::GCSweeping] = true;
@@ -832,17 +827,16 @@ TraceLogging::lazyInit()
         enabledTextIds[TraceLogger::IonMonkey] = true;
         enabledTextIds[TraceLogger::MinorGC] = true;
         enabledTextIds[TraceLogger::ParserCompileFunction] = true;
         enabledTextIds[TraceLogger::ParserCompileLazy] = true;
         enabledTextIds[TraceLogger::ParserCompileScript] = true;
         enabledTextIds[TraceLogger::IrregexpCompile] = true;
         enabledTextIds[TraceLogger::IrregexpExecute] = true;
         enabledTextIds[TraceLogger::Scripts] = true;
-        enabledTextIds[TraceLogger::Engine] = true;
     }
 
     if (ContainsFlag(env, "IonCompiler")) {
         enabledTextIds[TraceLogger::IonCompilation] = true;
         enabledTextIds[TraceLogger::IonLinking] = true;
         enabledTextIds[TraceLogger::FoldTests] = true;
         enabledTextIds[TraceLogger::SplitCriticalEdges] = true;
         enabledTextIds[TraceLogger::RenumberBlocks] = true;
@@ -860,20 +854,16 @@ TraceLogging::lazyInit()
         enabledTextIds[TraceLogger::EdgeCaseAnalysis] = true;
         enabledTextIds[TraceLogger::EliminateRedundantChecks] = true;
         enabledTextIds[TraceLogger::GenerateLIR] = true;
         enabledTextIds[TraceLogger::RegisterAllocation] = true;
         enabledTextIds[TraceLogger::GenerateCode] = true;
         enabledTextIds[TraceLogger::Scripts] = true;
     }
 
-    enabledTextIds[TraceLogger::Interpreter] = enabledTextIds[TraceLogger::Engine];
-    enabledTextIds[TraceLogger::Baseline] = enabledTextIds[TraceLogger::Engine];
-    enabledTextIds[TraceLogger::IonMonkey] = enabledTextIds[TraceLogger::Engine];
-
     const char *options = getenv("TLOPTIONS");
     if (options) {
         if (strstr(options, "help")) {
             fflush(nullptr);
             printf(
                 "\n"
                 "usage: TLOPTIONS=option,option,option,... where options can be:\n"
                 "\n"
--- a/js/src/vm/TraceLogging.h
+++ b/js/src/vm/TraceLogging.h
@@ -105,17 +105,16 @@ namespace jit {
  *    or the duration with a RAII class:
  *    - AutoTraceLog logger(logger, textId);
  */
 
 #define TRACELOGGER_TEXT_ID_LIST(_)                   \
     _(Bailout)                                        \
     _(Baseline)                                       \
     _(BaselineCompilation)                            \
-    _(Engine)                                         \
     _(GC)                                             \
     _(GCAllocation)                                   \
     _(GCSweeping)                                     \
     _(Interpreter)                                    \
     _(Invalidation)                                   \
     _(IonCompilation)                                 \
     _(IonCompilationPaused)                           \
     _(IonLinking)                                     \
@@ -427,28 +426,16 @@ class TraceLogger
     bool flush();
 
   public:
     TraceLogger();
     ~TraceLogger();
 
     bool init(uint32_t loggerId);
 
-    static bool textIdIsToggable(uint32_t id) {
-        if (id == TL_Error)
-            return false;
-        if (id == TL)
-            return false;
-        // Cannot toggle the logging of one engine on/off, because at the stop
-        // event it is sometimes unknown which engine was running.
-        if (id == IonMonkey || id == Baseline || id == Interpreter)
-            return false;
-        return true;
-    }
-
     bool enable();
     bool enable(JSContext *cx);
     bool disable();
 
     // The createTextId functions map a unique input to a logger ID.
     // This ID can be used to log something. Calls to these functions should be
     // limited if possible, because of the overhead.
     uint32_t createTextId(const char *text);
@@ -458,20 +445,18 @@ class TraceLogger
     // Log an event (no start/stop, only the timestamp is recorded).
     void logTimestamp(uint32_t id);
 
     // Record timestamps for start and stop of an event.
     // In the stop method, the ID is only used in debug builds to test
     // correctness.
     void startEvent(uint32_t id);
     void stopEvent(uint32_t id);
-  private:
     void stopEvent();
 
-  public:
     static unsigned offsetOfEnabled() {
         return offsetof(TraceLogger, enabled);
     }
 
   private:
     void assertNoQuotes(const char *text) {
 #ifdef DEBUG
         const char *quote = strchr(text, '"');
@@ -605,16 +590,22 @@ inline void TraceLogStartEvent(TraceLogg
 #endif
 }
 inline void TraceLogStopEvent(TraceLogger *logger, uint32_t textId) {
 #ifdef JS_TRACE_LOGGING
     if (logger)
         logger->stopEvent(textId);
 #endif
 }
+inline void TraceLogStopEvent(TraceLogger *logger) {
+#ifdef JS_TRACE_LOGGING
+    if (logger)
+        logger->stopEvent();
+#endif
+}
 
 // Automatic logging at the start and end of function call.
 class AutoTraceLog {
 #ifdef JS_TRACE_LOGGING
     TraceLogger *logger;
     uint32_t textId;
     bool executed;
     AutoTraceLog *prev;