Backed out changeset 8d040e2b9aff (bug 1072903)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 21 Nov 2014 08:04:20 +0100
changeset 241099 15a721c1319f9ddff8ee6134ce3ee124e9e2ac7f
parent 241098 ed071724d184b47a2d8b5e109f9b45833cbda4d0
child 241100 f460adc36fb6cdaf31ce85cfd4236545f5a84659
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)
bugs1072903
milestone36.0a1
backs out8d040e2b9affffcc42f722e6eaf3f2d848b0ee96
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 8d040e2b9aff (bug 1072903)
js/src/vm/TraceLogging.cpp
--- a/js/src/vm/TraceLogging.cpp
+++ b/js/src/vm/TraceLogging.cpp
@@ -74,29 +74,23 @@ rdtsc(void)
     result = result|lower;
 
     return result;
 }
 #endif
 
 TraceLogging traceLoggers;
 
-static const char *
-TLTextIdString(TraceLogger::TextId id)
+static const char* const text[] =
 {
-    switch (id) {
-      case TraceLogger::TL_Error:
-        return "TraceLogger failed to process text";
-#define NAME(textId) case TraceLogger::textId: return #textId;
-        TRACELOGGER_TEXT_ID_LIST(NAME)
+    "TraceLogger failed to process text",
+#define NAME(x) #x,
+    TRACELOGGER_TEXT_ID_LIST(NAME)
 #undef NAME
-      default:
-        MOZ_CRASH();
-    }
-}
+};
 
 TraceLogger::TraceLogger()
  : enabled(0),
    failed(false),
    nextTextId(0),
    treeOffset(0),
    top(nullptr)
 { }
@@ -156,18 +150,17 @@ TraceLogger::init(uint32_t loggerId)
     stackEntry.setActive(true);
 
     int written = fprintf(dictFile, "[");
     if (written < 0)
         fprintf(stderr, "TraceLogging: Error while writing.\n");
 
     // Eagerly create the default textIds, to match their Tracelogger::TextId.
     for (uint32_t i = 0; i < LAST; i++) {
-        TraceLogger::TextId id = TraceLogger::TextId(i);
-        mozilla::DebugOnly<uint32_t> textId = createTextId(TLTextIdString(id));
+        mozilla::DebugOnly<uint32_t> textId = createTextId(text[i]);
         MOZ_ASSERT(textId == i);
     }
 
     enabled = 1;
     return true;
 }
 
 bool
@@ -805,30 +798,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++) {
-            TraceLogger::TextId id = TraceLogger::TextId(i);
-            if (!TraceLogger::textIdIsToggable(id))
+            if (!TraceLogger::textIdIsToggable(i))
                 continue;
-            printf("  %s\n", TLTextIdString(id));
+            printf("  %s\n", text[i]);
         }
         printf("\n");
         exit(0);
         /*NOTREACHED*/
     }
 
     for (uint32_t i = 1; i < TraceLogger::LAST; i++) {
-        TraceLogger::TextId id = TraceLogger::TextId(i);
-        if (TraceLogger::textIdIsToggable(id))
-            enabledTextIds[i] = ContainsFlag(env, TLTextIdString(id));
+        if (TraceLogger::textIdIsToggable(i))
+            enabledTextIds[i] = ContainsFlag(env, text[i]);
         else
             enabledTextIds[i] = true;
     }
 
     if (ContainsFlag(env, "Default")) {
         enabledTextIds[TraceLogger::Bailout] = true;
         enabledTextIds[TraceLogger::Baseline] = true;
         enabledTextIds[TraceLogger::BaselineCompilation] = true;