Bug 1072903 - TraceLogger: Part 2: Adjust how to retrieve the tracelogger text ids, r=bbouvier
☠☠ backed out by 195c6cc03cca ☠ ☠
authorHannes Verschore <hv1989@gmail.com>
Thu, 20 Nov 2014 17:43:59 +0100
changeset 216666 5485b455c029f97e7cd397603fe023a036479016
parent 216665 7d0eb79dd247629bc8af9e0fb57d0a99b186c48d
child 216667 8b9390d62ecd27b2bd65b0301ddabac5cbaf0c9d
push id27858
push userkwierso@gmail.com
push dateFri, 21 Nov 2014 01:35:46 +0000
treeherdermozilla-central@6309710dd71d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1072903
milestone36.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 1072903 - TraceLogger: Part 2: Adjust how to retrieve the tracelogger text ids, r=bbouvier
js/src/frontend/BytecodeCompiler.cpp
js/src/jit/Bailouts.cpp
js/src/jit/BaselineBailouts.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineJIT.cpp
js/src/jit/CodeGenerator.cpp
js/src/jit/Ion.cpp
js/src/jit/IonFrames.cpp
js/src/jit/VMFunctions.cpp
js/src/jit/shared/CodeGenerator-shared.cpp
js/src/jit/shared/CodeGenerator-x86-shared.cpp
js/src/jsgc.cpp
js/src/vm/HelperThreads.cpp
js/src/vm/Interpreter.cpp
js/src/vm/RegExpObject.cpp
js/src/vm/TraceLogging.cpp
js/src/vm/TraceLogging.h
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -222,17 +222,17 @@ frontend::CompileScript(ExclusiveContext
 
     js::TraceLogger *logger = nullptr;
     if (cx->isJSContext())
         logger = TraceLoggerForMainThread(cx->asJSContext()->runtime());
     else
         logger = TraceLoggerForCurrentThread();
     uint32_t logId = js::TraceLogCreateTextId(logger, options);
     js::AutoTraceLog scriptLogger(logger, logId);
-    js::AutoTraceLog typeLogger(logger, TraceLogger::ParserCompileScript);
+    js::AutoTraceLog typeLogger(logger, TraceLogger_ParserCompileScript);
 
     /*
      * The scripted callerFrame can only be given for compile-and-go scripts
      * and non-zero static level requires callerFrame.
      */
     MOZ_ASSERT_IF(evalCaller, options.compileAndGo);
     MOZ_ASSERT_IF(evalCaller, options.forEval);
     MOZ_ASSERT_IF(staticLevel != 0, evalCaller);
@@ -473,17 +473,17 @@ frontend::CompileLazyFunction(JSContext 
            .setColumn(lazy->column())
            .setCompileAndGo(true)
            .setNoScriptRval(false)
            .setSelfHostingMode(false);
 
     js::TraceLogger *logger = js::TraceLoggerForMainThread(cx->runtime());
     uint32_t logId = js::TraceLogCreateTextId(logger, options);
     js::AutoTraceLog scriptLogger(logger, logId);
-    js::AutoTraceLog typeLogger(logger, TraceLogger::ParserCompileLazy);
+    js::AutoTraceLog typeLogger(logger, TraceLogger_ParserCompileLazy);
 
     Parser<FullParseHandler> parser(cx, &cx->tempLifoAlloc(), options, chars, length,
                                     /* foldConstants = */ true, nullptr, lazy);
     if (!parser.checkOptions())
         return false;
 
     uint32_t staticLevel = lazy->staticLevel(cx);
 
@@ -531,17 +531,17 @@ frontend::CompileLazyFunction(JSContext 
 static bool
 CompileFunctionBody(JSContext *cx, MutableHandleFunction fun, const ReadOnlyCompileOptions &options,
                     const AutoNameVector &formals, SourceBufferHolder &srcBuf,
                     HandleObject enclosingScope, GeneratorKind generatorKind)
 {
     js::TraceLogger *logger = js::TraceLoggerForMainThread(cx->runtime());
     uint32_t logId = js::TraceLogCreateTextId(logger, options);
     js::AutoTraceLog scriptLogger(logger, logId);
-    js::AutoTraceLog typeLogger(logger, TraceLogger::ParserCompileFunction);
+    js::AutoTraceLog typeLogger(logger, TraceLogger_ParserCompileFunction);
 
     // FIXME: make Function pass in two strings and parse them as arguments and
     // ProgramElements respectively.
 
     if (!CheckLength(cx, srcBuf))
         return false;
 
     RootedScriptSource sourceObject(cx, CreateScriptSourceObject(cx, options));
--- a/js/src/jit/Bailouts.cpp
+++ b/js/src/jit/Bailouts.cpp
@@ -37,17 +37,17 @@ jit::Bailout(BailoutStack *sp, BaselineB
     cx->mainThread().jitTop = FAKE_JIT_TOP_FOR_BAILOUT;
 
     JitActivationIterator jitActivations(cx->runtime());
     BailoutFrameInfo bailoutData(jitActivations, sp);
     JitFrameIterator iter(jitActivations);
     MOZ_ASSERT(!iter.ionScript()->invalidated());
 
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
-    TraceLogTimestamp(logger, TraceLogger::Bailout);
+    TraceLogTimestamp(logger, TraceLogger_Bailout);
 
     JitSpew(JitSpew_IonBailouts, "Took bailout! Snapshot offset: %d", iter.snapshotOffset());
 
     MOZ_ASSERT(IsBaselineEnabled(cx));
 
     *bailoutInfo = nullptr;
     bool poppedLastSPSFrame = false;
     uint32_t retval = BailoutIonToBaseline(cx, bailoutData.activation(), iter, false, bailoutInfo,
@@ -103,17 +103,17 @@ jit::InvalidationBailout(InvalidationBai
     // We don't have an exit frame.
     cx->mainThread().jitTop = FAKE_JIT_TOP_FOR_BAILOUT;
 
     JitActivationIterator jitActivations(cx->runtime());
     BailoutFrameInfo bailoutData(jitActivations, sp);
     JitFrameIterator iter(jitActivations);
 
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
-    TraceLogTimestamp(logger, TraceLogger::Invalidation);
+    TraceLogTimestamp(logger, TraceLogger_Invalidation);
 
     JitSpew(JitSpew_IonBailouts, "Took invalidation bailout! Snapshot offset: %d", iter.snapshotOffset());
 
     // Note: the frame size must be computed before we return from this function.
     *frameSizeOut = iter.frameSize();
 
     MOZ_ASSERT(IsBaselineEnabled(cx));
 
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -1343,18 +1343,18 @@ jit::BailoutIonToBaseline(JSContext *cx,
 {
     MOZ_ASSERT(bailoutInfo != nullptr);
     MOZ_ASSERT(*bailoutInfo == nullptr);
 
     MOZ_ASSERT(poppedLastSPSFrameOut);
     MOZ_ASSERT(!*poppedLastSPSFrameOut);
 
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
-    TraceLogStopEvent(logger, TraceLogger::IonMonkey);
-    TraceLogStartEvent(logger, TraceLogger::Baseline);
+    TraceLogStopEvent(logger, TraceLogger_IonMonkey);
+    TraceLogStartEvent(logger, TraceLogger_Baseline);
 
     // The caller of the top frame must be one of the following:
     //      IonJS - Ion calling into Ion.
     //      BaselineStub - Baseline calling into Ion.
     //      Entry - Interpreter or other calling into Ion.
     //      Rectifier - Arguments rectifier calling into Ion.
     MOZ_ASSERT(iter.isBailoutJS());
     FrameType prevFrameType = iter.prevType();
@@ -1456,17 +1456,17 @@ jit::BailoutIonToBaseline(JSContext *cx,
     gc::AutoSuppressGC suppress(cx);
 
     while (true) {
         // Skip recover instructions as they are already recovered by |initInstructionResults|.
         snapIter.settleOnFrame();
 
         if (frameNo > 0) {
             TraceLogStartEvent(logger, TraceLogCreateTextId(logger, scr));
-            TraceLogStartEvent(logger, TraceLogger::Baseline);
+            TraceLogStartEvent(logger, TraceLogger_Baseline);
         }
 
         JitSpew(JitSpew_BaselineBailouts, "    FrameNo %d", frameNo);
 
         // If we are bailing out to a catch or finally block in this frame,
         // pass excInfo to InitFromBailout and don't unpack any other frames.
         bool handleException = (catchingException && excInfo->frameNo() == frameNo);
 
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -78,17 +78,17 @@ BaselineCompiler::compile()
     JitSpew(JitSpew_BaselineScripts, "Baseline compiling script %s:%d (%p)",
             script->filename(), script->lineno(), script);
 
     JitSpew(JitSpew_Codegen, "# Emitting baseline code for script %s:%d",
             script->filename(), script->lineno());
 
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
     AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, script));
-    AutoTraceLog logCompile(logger, TraceLogger::BaselineCompilation);
+    AutoTraceLog logCompile(logger, TraceLogger_BaselineCompilation);
 
     if (!script->ensureHasTypes(cx) || !script->ensureHasAnalyzedArgsUsage(cx))
         return Method_Error;
 
     // Pin analysis info during compilation.
     types::AutoEnterAnalysis autoEnterAnalysis(cx);
 
     MOZ_ASSERT(!script->hasBaselineScript());
@@ -373,17 +373,17 @@ BaselineCompiler::emitPrologue()
         masm.bind(&earlyStackCheckFailed);
 
 #ifdef JS_TRACE_LOGGING
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
     Register loggerReg = RegisterSet::Volatile().takeGeneral();
     masm.Push(loggerReg);
     masm.movePtr(ImmPtr(logger), loggerReg);
     masm.tracelogStart(loggerReg, TraceLogCreateTextId(logger, script));
-    masm.tracelogStart(loggerReg, TraceLogger::Baseline);
+    masm.tracelogStart(loggerReg, TraceLogger_Baseline);
     masm.Pop(loggerReg);
 #endif
 
     // Record the offset of the prologue, because Ion can bailout before
     // the scope chain is initialized.
     prologueOffset_ = CodeOffsetLabel(masm.currentOffset());
 
     // Initialize the scope chain before any operation that may
@@ -418,18 +418,18 @@ BaselineCompiler::emitEpilogue()
 
     masm.bind(&return_);
 
 #ifdef JS_TRACE_LOGGING
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
     Register loggerReg = RegisterSet::Volatile().takeGeneral();
     masm.Push(loggerReg);
     masm.movePtr(ImmPtr(logger), loggerReg);
-    masm.tracelogStop(loggerReg, TraceLogger::Baseline);
-    masm.tracelogStop(loggerReg, TraceLogger::Scripts);
+    masm.tracelogStop(loggerReg, TraceLogger_Baseline);
+    masm.tracelogStop(loggerReg, TraceLogger_Scripts);
     masm.Pop(loggerReg);
 #endif
 
     // Pop SPS frame if necessary
     emitSPSPop();
 
     masm.mov(BaselineFrameReg, BaselineStackReg);
     masm.pop(BaselineFrameReg);
--- a/js/src/jit/BaselineJIT.cpp
+++ b/js/src/jit/BaselineJIT.cpp
@@ -186,18 +186,18 @@ jit::EnterBaselineAtBranch(JSContext *cx
         // For eval function frames, set the callee token to the enclosing function.
         if (fp->isFunctionFrame())
             data.calleeToken = CalleeToToken(&fp->callee(), /* constructing = */ false);
         else
             data.calleeToken = CalleeToToken(fp->script());
     }
 
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
-    TraceLogStopEvent(logger, TraceLogger::Interpreter);
-    TraceLogStartEvent(logger, TraceLogger::Baseline);
+    TraceLogStopEvent(logger, TraceLogger_Interpreter);
+    TraceLogStartEvent(logger, TraceLogger_Baseline);
 
     IonExecStatus status = EnterBaseline(cx, data);
     if (status != IonExec_Ok)
         return status;
 
     fp->setReturnValue(data.result);
     return IonExec_Ok;
 }
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -2085,19 +2085,19 @@ bool
 CodeGenerator::visitOsrEntry(LOsrEntry *lir)
 {
     // Remember the OSR entry offset into the code buffer.
     masm.flushBuffer();
     setOsrEntryOffset(masm.size());
 
 #ifdef JS_TRACE_LOGGING
     if (gen->info().executionMode() == SequentialExecution) {
-        if (!emitTracelogStopEvent(TraceLogger::Baseline))
+        if (!emitTracelogStopEvent(TraceLogger_Baseline))
             return false;
-        if (!emitTracelogStartEvent(TraceLogger::IonMonkey))
+        if (!emitTracelogStartEvent(TraceLogger_IonMonkey))
             return false;
     }
 #endif
 
     // Allocate the full frame for this function
     // Note we have a new entry here. So we reset MacroAssembler::framePushed()
     // to 0, before reserving the stack.
     MOZ_ASSERT(masm.framePushed() == frameSize());
@@ -7647,17 +7647,17 @@ CodeGenerator::generate()
         return false;
 
     masm.bind(&skipPrologue);
 
 #ifdef JS_TRACE_LOGGING
     if (!gen->compilingAsmJS() && gen->info().executionMode() == SequentialExecution) {
         if (!emitTracelogScriptStart())
             return false;
-        if (!emitTracelogStartEvent(TraceLogger::IonMonkey))
+        if (!emitTracelogStartEvent(TraceLogger_IonMonkey))
             return false;
     }
 #endif
 
 #ifdef DEBUG
     // Assert that the argument types are correct.
     if (!generateArgumentsChecks(/* bailout = */ false))
         return false;
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -536,17 +536,17 @@ jit::LazyLinkTopActivation(JSContext *cx
     RootedScript script(cx, builder->script());
 
     // Remove from pending.
     builder->remove();
 
     if (CodeGenerator *codegen = builder->backgroundCodegen()) {
         js::TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
         AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, script));
-        AutoTraceLog logLink(logger, TraceLogger::IonLinking);
+        AutoTraceLog logLink(logger, TraceLogger_IonLinking);
 
         IonContext ictx(cx, &builder->alloc());
 
         // Root the assembler until the builder is finished below. As it
         // was constructed off thread, the assembler has not been rooted
         // previously, though any GC activity would discard the builder.
         codegen->masm.constructRoot(cx);
 
@@ -1302,59 +1302,59 @@ OptimizeMIR(MIRGenerator *mir)
 
     IonSpewPass("BuildSSA");
     AssertBasicGraphCoherency(graph);
 
     if (mir->shouldCancel("Start"))
         return false;
 
     if (!mir->compilingAsmJS()) {
-        AutoTraceLog log(logger, TraceLogger::FoldTests);
+        AutoTraceLog log(logger, TraceLogger_FoldTests);
         FoldTests(graph);
         IonSpewPass("Fold Tests");
         AssertBasicGraphCoherency(graph);
 
         if (mir->shouldCancel("Fold Tests"))
             return false;
     }
 
     {
-        AutoTraceLog log(logger, TraceLogger::SplitCriticalEdges);
+        AutoTraceLog log(logger, TraceLogger_SplitCriticalEdges);
         if (!SplitCriticalEdges(graph))
             return false;
         IonSpewPass("Split Critical Edges");
         AssertGraphCoherency(graph);
 
         if (mir->shouldCancel("Split Critical Edges"))
             return false;
     }
 
     {
-        AutoTraceLog log(logger, TraceLogger::RenumberBlocks);
+        AutoTraceLog log(logger, TraceLogger_RenumberBlocks);
         if (!RenumberBlocks(graph))
             return false;
         IonSpewPass("Renumber Blocks");
         AssertGraphCoherency(graph);
 
         if (mir->shouldCancel("Renumber Blocks"))
             return false;
     }
 
     {
-        AutoTraceLog log(logger, TraceLogger::DominatorTree);
+        AutoTraceLog log(logger, TraceLogger_DominatorTree);
         if (!BuildDominatorTree(graph))
             return false;
         // No spew: graph not changed.
 
         if (mir->shouldCancel("Dominator Tree"))
             return false;
     }
 
     {
-        AutoTraceLog log(logger, TraceLogger::PhiAnalysis);
+        AutoTraceLog log(logger, TraceLogger_PhiAnalysis);
         // Aggressive phi elimination must occur before any code elimination. If the
         // script contains a try-statement, we only compiled the try block and not
         // the catch or finally blocks, so in this case it's also invalid to use
         // aggressive phi elimination.
         Observability observability = graph.hasTryBlock()
                                       ? ConservativeObservability
                                       : AggressiveObservability;
         if (!EliminatePhis(mir, graph, observability))
@@ -1370,43 +1370,43 @@ OptimizeMIR(MIRGenerator *mir)
         AssertExtendedGraphCoherency(graph);
         // No spew: graph not changed.
 
         if (mir->shouldCancel("Phi reverse mapping"))
             return false;
     }
 
     if (mir->optimizationInfo().scalarReplacementEnabled()) {
-        AutoTraceLog log(logger, TraceLogger::ScalarReplacement);
+        AutoTraceLog log(logger, TraceLogger_ScalarReplacement);
         if (!ScalarReplacement(mir, graph))
             return false;
         IonSpewPass("Scalar Replacement");
         AssertGraphCoherency(graph);
 
         if (mir->shouldCancel("Scalar Replacement"))
             return false;
     }
 
     if (!mir->compilingAsmJS()) {
-        AutoTraceLog log(logger, TraceLogger::ApplyTypes);
+        AutoTraceLog log(logger, TraceLogger_ApplyTypes);
         if (!ApplyTypeInformation(mir, graph))
             return false;
         IonSpewPass("Apply types");
         AssertExtendedGraphCoherency(graph);
 
         if (mir->shouldCancel("Apply types"))
             return false;
     }
 
     // Parallel Safety Analysis. Note that this may delete blocks containing
     // instructions pointed to by the dependency() field of instructions which
     // are not deleted, leaving them dangling. This is ok, since we'll rerun
     // AliasAnalysis, which recomputes them, before they're needed.
     if (graph.entryBlock()->info().executionMode() == ParallelExecution) {
-        AutoTraceLog log(logger, TraceLogger::ParallelSafetyAnalysis);
+        AutoTraceLog log(logger, TraceLogger_ParallelSafetyAnalysis);
         ParallelSafetyAnalysis analysis(mir, graph);
         if (!analysis.analyze())
             return false;
         IonSpewPass("Parallel Safety Analysis");
         AssertExtendedGraphCoherency(graph);
         if (mir->shouldCancel("Parallel Safety Analysis"))
             return false;
     }
@@ -1415,17 +1415,17 @@ OptimizeMIR(MIRGenerator *mir)
     if (!gvn.init())
         return false;
 
     // Alias analysis is required for LICM and GVN so that we don't move
     // loads across stores.
     if (mir->optimizationInfo().licmEnabled() ||
         mir->optimizationInfo().gvnEnabled())
     {
-        AutoTraceLog log(logger, TraceLogger::AliasAnalysis);
+        AutoTraceLog log(logger, TraceLogger_AliasAnalysis);
         AliasAnalysis analysis(mir, graph);
         if (!analysis.analyze())
             return false;
         IonSpewPass("Alias analysis");
         AssertExtendedGraphCoherency(graph);
 
         if (mir->shouldCancel("Alias analysis"))
             return false;
@@ -1438,45 +1438,45 @@ OptimizeMIR(MIRGenerator *mir)
                 return false;
 
             if (mir->shouldCancel("Eliminate dead resume point operands"))
                 return false;
         }
     }
 
     if (mir->optimizationInfo().gvnEnabled()) {
-        AutoTraceLog log(logger, TraceLogger::GVN);
+        AutoTraceLog log(logger, TraceLogger_GVN);
         if (!gvn.run(ValueNumberer::UpdateAliasAnalysis))
             return false;
         IonSpewPass("GVN");
         AssertExtendedGraphCoherency(graph);
 
         if (mir->shouldCancel("GVN"))
             return false;
     }
 
     if (mir->optimizationInfo().licmEnabled()) {
-        AutoTraceLog log(logger, TraceLogger::LICM);
+        AutoTraceLog log(logger, TraceLogger_LICM);
         // LICM can hoist instructions from conditional branches and trigger
         // repeated bailouts. Disable it if this script is known to bailout
         // frequently.
         JSScript *script = mir->info().script();
         if (!script || !script->hadFrequentBailouts()) {
             if (!LICM(mir, graph))
                 return false;
             IonSpewPass("LICM");
             AssertExtendedGraphCoherency(graph);
 
             if (mir->shouldCancel("LICM"))
                 return false;
         }
     }
 
     if (mir->optimizationInfo().rangeAnalysisEnabled()) {
-        AutoTraceLog log(logger, TraceLogger::RangeAnalysis);
+        AutoTraceLog log(logger, TraceLogger_RangeAnalysis);
         RangeAnalysis r(mir, graph);
         if (!r.addBetaNodes())
             return false;
         IonSpewPass("Beta");
         AssertExtendedGraphCoherency(graph);
 
         if (mir->shouldCancel("RA Beta"))
             return false;
@@ -1524,79 +1524,79 @@ OptimizeMIR(MIRGenerator *mir)
             IonSpewPass("Truncate Doubles");
             AssertExtendedGraphCoherency(graph);
 
             if (mir->shouldCancel("Truncate Doubles"))
                 return false;
         }
 
         if (mir->optimizationInfo().loopUnrollingEnabled()) {
-            AutoTraceLog log(logger, TraceLogger::LoopUnrolling);
+            AutoTraceLog log(logger, TraceLogger_LoopUnrolling);
 
             if (!UnrollLoops(graph, r.loopIterationBounds))
                 return false;
 
             IonSpewPass("Unroll Loops");
             AssertExtendedGraphCoherency(graph);
         }
     }
 
     if (mir->optimizationInfo().eaaEnabled()) {
-        AutoTraceLog log(logger, TraceLogger::EffectiveAddressAnalysis);
+        AutoTraceLog log(logger, TraceLogger_EffectiveAddressAnalysis);
         EffectiveAddressAnalysis eaa(graph);
         if (!eaa.analyze())
             return false;
         IonSpewPass("Effective Address Analysis");
         AssertExtendedGraphCoherency(graph);
 
         if (mir->shouldCancel("Effective Address Analysis"))
             return false;
     }
 
     {
-        AutoTraceLog log(logger, TraceLogger::EliminateDeadCode);
+        AutoTraceLog log(logger, TraceLogger_EliminateDeadCode);
         if (!EliminateDeadCode(mir, graph))
             return false;
         IonSpewPass("DCE");
         AssertExtendedGraphCoherency(graph);
 
         if (mir->shouldCancel("DCE"))
             return false;
     }
 
     // Make loops contiguous. We do this after GVN/UCE and range analysis,
     // which can remove CFG edges, exposing more blocks that can be moved.
     {
-        AutoTraceLog log(logger, TraceLogger::MakeLoopsContiguous);
+        AutoTraceLog log(logger, TraceLogger_MakeLoopsContiguous);
         if (!MakeLoopsContiguous(graph))
             return false;
         IonSpewPass("Make loops contiguous");
         AssertExtendedGraphCoherency(graph);
 
         if (mir->shouldCancel("Make loops contiguous"))
             return false;
     }
 
     // Passes after this point must not move instructions; these analyses
     // depend on knowing the final order in which instructions will execute.
 
     if (mir->optimizationInfo().edgeCaseAnalysisEnabled()) {
-        AutoTraceLog log(logger, TraceLogger::EdgeCaseAnalysis);
+        AutoTraceLog log(logger, TraceLogger_EdgeCaseAnalysis);
         EdgeCaseAnalysis edgeCaseAnalysis(mir, graph);
         if (!edgeCaseAnalysis.analyzeLate())
             return false;
         IonSpewPass("Edge Case Analysis (Late)");
         AssertGraphCoherency(graph);
 
         if (mir->shouldCancel("Edge Case Analysis (Late)"))
             return false;
     }
 
     if (mir->optimizationInfo().eliminateRedundantChecksEnabled()) {
-        AutoTraceLog log(logger, TraceLogger::EliminateRedundantChecks);
+        AutoTraceLog log(logger, TraceLogger_EliminateRedundantChecks);
         // Note: check elimination has to run after all other passes that move
         // instructions. Since check uses are replaced with the actual index,
         // code motion after this pass could incorrectly move a load or store
         // before its bounds check.
         if (!EliminateRedundantChecks(graph))
             return false;
         IonSpewPass("Bounds Check Elimination");
         AssertGraphCoherency(graph);
@@ -1617,29 +1617,29 @@ GenerateLIR(MIRGenerator *mir)
         logger = TraceLoggerForCurrentThread();
 
     LIRGraph *lir = mir->alloc().lifoAlloc()->new_<LIRGraph>(&graph);
     if (!lir || !lir->init())
         return nullptr;
 
     LIRGenerator lirgen(mir, graph, *lir);
     {
-        AutoTraceLog log(logger, TraceLogger::GenerateLIR);
+        AutoTraceLog log(logger, TraceLogger_GenerateLIR);
         if (!lirgen.generate())
             return nullptr;
         IonSpewPass("Generate LIR");
 
         if (mir->shouldCancel("Generate LIR"))
             return nullptr;
     }
 
     AllocationIntegrityState integrity(*lir);
 
     {
-        AutoTraceLog log(logger, TraceLogger::RegisterAllocation);
+        AutoTraceLog log(logger, TraceLogger_RegisterAllocation);
 
         switch (mir->optimizationInfo().registerAllocator()) {
           case RegisterAllocator_LSRA: {
 #ifdef DEBUG
             if (!integrity.record())
                 return nullptr;
 #endif
 
@@ -1704,17 +1704,17 @@ GenerateLIR(MIRGenerator *mir)
 CodeGenerator *
 GenerateCode(MIRGenerator *mir, LIRGraph *lir)
 {
     TraceLogger *logger;
     if (GetIonContext()->runtime->onMainThread())
         logger = TraceLoggerForMainThread(GetIonContext()->runtime);
     else
         logger = TraceLoggerForCurrentThread();
-    AutoTraceLog log(logger, TraceLogger::GenerateCode);
+    AutoTraceLog log(logger, TraceLogger_GenerateCode);
 
     CodeGenerator *codegen = js_new<CodeGenerator>(mir, lir);
     if (!codegen)
         return nullptr;
 
     if (!codegen->generate()) {
         js_delete(codegen);
         return nullptr;
@@ -1799,17 +1799,17 @@ AttachFinishedCompilations(JSContext *cx
                 continue;
             }
         }
 
         if (CodeGenerator *codegen = builder->backgroundCodegen()) {
             RootedScript script(cx, builder->script());
             IonContext ictx(cx, &builder->alloc());
             AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, script));
-            AutoTraceLog logLink(logger, TraceLogger::IonLinking);
+            AutoTraceLog logLink(logger, TraceLogger_IonLinking);
 
             // Root the assembler until the builder is finished below. As it
             // was constructed off thread, the assembler has not been rooted
             // previously, though any GC activity would discard the builder.
             codegen->masm.constructRoot(cx);
 
             bool success;
             {
@@ -1879,17 +1879,17 @@ TrackPropertiesForSingletonScopes(JSCont
 static AbortReason
 IonCompile(JSContext *cx, JSScript *script,
            BaselineFrame *baselineFrame, jsbytecode *osrPc, bool constructing,
            ExecutionMode executionMode, bool recompile,
            OptimizationLevel optimizationLevel)
 {
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
     AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, script));
-    AutoTraceLog logCompile(logger, TraceLogger::IonCompilation);
+    AutoTraceLog logCompile(logger, TraceLogger_IonCompilation);
 
     MOZ_ASSERT(optimizationLevel > Optimization_DontCompile);
 
     // Make sure the script's canonical function isn't lazy. We can't de-lazify
     // it in a helper thread.
     script->ensureNonLazyCanonicalFunction(cx);
 
     TrackPropertiesForSingletonScopes(cx, script, baselineFrame);
--- a/js/src/jit/IonFrames.cpp
+++ b/js/src/jit/IonFrames.cpp
@@ -751,18 +751,18 @@ HandleException(ResumeFromException *rfe
 
                 // When profiling, each frame popped needs a notification that
                 // the function has exited, so invoke the probe that a function
                 // is exiting.
 
                 JSScript *script = frames.script();
                 probes::ExitScript(cx, script, script->functionNonDelazifying(), popSPSFrame);
                 if (!frames.more()) {
-                    TraceLogStopEvent(logger, TraceLogger::IonMonkey);
-                    TraceLogStopEvent(logger, TraceLogger::Scripts);
+                    TraceLogStopEvent(logger, TraceLogger_IonMonkey);
+                    TraceLogStopEvent(logger, TraceLogger_Scripts);
                     break;
                 }
                 ++frames;
             }
 
             if (invalidated)
                 ionScript->decrementInvalidationCount(cx->runtime()->defaultFreeOp());
 
@@ -782,18 +782,18 @@ HandleException(ResumeFromException *rfe
             //
             // We cannot delete it immediately because of the call to
             // iter.baselineScriptAndPc below.
             AutoDeleteDebugModeOSRInfo deleteDebugModeOSRInfo(iter.baselineFrame());
 
             if (rfe->kind != ResumeFromException::RESUME_ENTRY_FRAME)
                 return;
 
-            TraceLogStopEvent(logger, TraceLogger::Baseline);
-            TraceLogStopEvent(logger, TraceLogger::Scripts);
+            TraceLogStopEvent(logger, TraceLogger_Baseline);
+            TraceLogStopEvent(logger, TraceLogger_Scripts);
 
             // Unwind profiler pseudo-stack
             JSScript *script = iter.script();
             probes::ExitScript(cx, script, script->functionNonDelazifying(),
                                iter.baselineFrame()->hasPushedSPSFrame());
             // After this point, any pushed SPS frame would have been popped if it needed
             // to be.  Unset the flag here so that if we call DebugEpilogue below,
             // it doesn't try to pop the SPS frame again.
--- a/js/src/jit/VMFunctions.cpp
+++ b/js/src/jit/VMFunctions.cpp
@@ -774,18 +774,18 @@ DebugPrologue(JSContext *cx, BaselineFra
 
 bool
 DebugEpilogueOnBaselineReturn(JSContext *cx, BaselineFrame *frame, jsbytecode *pc)
 {
     if (!DebugEpilogue(cx, frame, pc, true)) {
         // DebugEpilogue popped the frame by updating jitTop, so run the stop event
         // here before we enter the exception handler.
         TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
-        TraceLogStopEvent(logger, TraceLogger::Baseline);
-        TraceLogStopEvent(logger, TraceLogger::Scripts);
+        TraceLogStopEvent(logger, TraceLogger_Baseline);
+        TraceLogStopEvent(logger, TraceLogger_Scripts);
         return false;
     }
 
     return true;
 }
 
 bool
 DebugEpilogue(JSContext *cx, BaselineFrame *frame, jsbytecode *pc, bool ok)
--- a/js/src/jit/shared/CodeGenerator-shared.cpp
+++ b/js/src/jit/shared/CodeGenerator-shared.cpp
@@ -1006,17 +1006,17 @@ CodeGeneratorShared::callVM(const VMFunc
     if (ins->mirRaw()) {
         MOZ_ASSERT(ins->mirRaw()->isInstruction());
         MInstruction *mir = ins->mirRaw()->toInstruction();
         MOZ_ASSERT_IF(mir->needsResumePoint(), mir->resumePoint());
     }
 #endif
 
 #ifdef JS_TRACE_LOGGING
-    if (!emitTracelogStartEvent(TraceLogger::VM))
+    if (!emitTracelogStartEvent(TraceLogger_VM))
         return false;
 #endif
 
     // Stack is:
     //    ... frame ...
     //    [args]
 #ifdef DEBUG
     MOZ_ASSERT(pushedArgs_ == fun.explicitArgs);
@@ -1051,17 +1051,17 @@ CodeGeneratorShared::callVM(const VMFunc
     int framePop = sizeof(IonExitFrameLayout) - sizeof(void*);
 
     // Pop arguments from framePushed.
     masm.implicitPop(fun.explicitStackSlots() * sizeof(void *) + framePop);
     // Stack is:
     //    ... frame ...
 
 #ifdef JS_TRACE_LOGGING
-    if (!emitTracelogStopEvent(TraceLogger::VM))
+    if (!emitTracelogStopEvent(TraceLogger_VM))
         return false;
 #endif
 
     return true;
 }
 
 class OutOfLineTruncateSlow : public OutOfLineCodeBase<CodeGeneratorShared>
 {
@@ -1397,17 +1397,17 @@ CodeGeneratorShared::computeDivisionCons
 }
 
 
 #ifdef JS_TRACE_LOGGING
 
 bool
 CodeGeneratorShared::emitTracelogScript(bool isStart)
 {
-    if (!TraceLogTextIdEnabled(TraceLogger::Scripts))
+    if (!TraceLogTextIdEnabled(TraceLogger_Scripts))
         return true;
 
     Label done;
 
     RegisterSet regs = RegisterSet::Volatile();
     Register logger = regs.takeGeneral();
     Register script = regs.takeGeneral();
 
--- a/js/src/jit/shared/CodeGenerator-x86-shared.cpp
+++ b/js/src/jit/shared/CodeGenerator-x86-shared.cpp
@@ -53,17 +53,17 @@ bool
 CodeGeneratorX86Shared::generateEpilogue()
 {
     MOZ_ASSERT(!gen->compilingAsmJS());
 
     masm.bind(&returnLabel_);
 
 #ifdef JS_TRACE_LOGGING
     if (gen->info().executionMode() == SequentialExecution) {
-        if (!emitTracelogStopEvent(TraceLogger::IonMonkey))
+        if (!emitTracelogStopEvent(TraceLogger_IonMonkey))
             return false;
         if (!emitTracelogScriptStop())
             return false;
     }
 #endif
 
     // Pop the stack we allocated at the start of the function.
     masm.freeStack(frameSize());
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -3609,17 +3609,17 @@ GCHelperState::work()
 
     switch (state()) {
 
       case IDLE:
         MOZ_CRASH("GC helper triggered on idle state");
         break;
 
       case SWEEPING: {
-        AutoTraceLog logSweeping(logger, TraceLogger::GCSweeping);
+        AutoTraceLog logSweeping(logger, TraceLogger_GCSweeping);
         doSweep(lock);
         MOZ_ASSERT(state() == SWEEPING);
         break;
       }
 
     }
 
     setState(IDLE);
@@ -3634,17 +3634,17 @@ BackgroundAllocTask::BackgroundAllocTask
     enabled_(CanUseExtraThreads() && GetCPUCount() >= 2)
 {
 }
 
 /* virtual */ void
 BackgroundAllocTask::run()
 {
     TraceLogger *logger = TraceLoggerForCurrentThread();
-    AutoTraceLog logAllocation(logger, TraceLogger::GCAllocation);
+    AutoTraceLog logAllocation(logger, TraceLogger_GCAllocation);
 
     AutoLockGC lock(runtime);
     while (!cancel_ && runtime->gc.wantBackgroundAllocation(lock)) {
         Chunk *chunk;
         {
             AutoUnlockGC unlock(lock);
             chunk = Chunk::allocate(runtime);
             if (!chunk)
@@ -6245,17 +6245,17 @@ GCRuntime::collect(bool incremental, Sli
 
     /* The engine never locks across anything that could GC. */
     MOZ_ASSERT(!rt->currentThreadHasExclusiveAccess());
 
     if (rt->mainThread.suppressGC)
         return;
 
     TraceLogger *logger = TraceLoggerForMainThread(rt);
-    AutoTraceLog logGC(logger, TraceLogger::GC);
+    AutoTraceLog logGC(logger, TraceLogger_GC);
 
 #ifdef JS_GC_ZEAL
     if (deterministicOnly && !IsDeterministicGCReason(reason))
         return;
 #endif
 
     MOZ_ASSERT_IF(!incremental || !budget.isUnlimited(), JSGC_INCREMENTAL);
 
@@ -6452,31 +6452,31 @@ GCRuntime::onOutOfMallocMemory(const Aut
 }
 
 void
 GCRuntime::minorGC(JS::gcreason::Reason reason)
 {
 #ifdef JSGC_GENERATIONAL
     minorGCRequested = false;
     TraceLogger *logger = TraceLoggerForMainThread(rt);
-    AutoTraceLog logMinorGC(logger, TraceLogger::MinorGC);
+    AutoTraceLog logMinorGC(logger, TraceLogger_MinorGC);
     nursery.collect(rt, reason, nullptr);
     MOZ_ASSERT_IF(!rt->mainThread.suppressGC, nursery.isEmpty());
 #endif
 }
 
 void
 GCRuntime::minorGC(JSContext *cx, JS::gcreason::Reason reason)
 {
     // Alternate to the runtime-taking form above which allows marking type
     // objects as needing pretenuring.
 #ifdef JSGC_GENERATIONAL
     minorGCRequested = false;
     TraceLogger *logger = TraceLoggerForMainThread(rt);
-    AutoTraceLog logMinorGC(logger, TraceLogger::MinorGC);
+    AutoTraceLog logMinorGC(logger, TraceLogger_MinorGC);
     Nursery::TypeObjectList pretenureTypes;
     nursery.collect(rt, reason, &pretenureTypes);
     for (size_t i = 0; i < pretenureTypes.length(); i++) {
         if (pretenureTypes[i]->canPreTenure())
             pretenureTypes[i]->setShouldPreTenure(cx);
     }
     MOZ_ASSERT_IF(!rt->mainThread.suppressGC, nursery.isEmpty());
 #endif
--- a/js/src/vm/HelperThreads.cpp
+++ b/js/src/vm/HelperThreads.cpp
@@ -1044,17 +1044,17 @@ HelperThread::handleIonWorkload()
         other->pause = true;
     }
 
     ionBuilder = builder;
     ionBuilder->setPauseFlag(&pause);
 
     TraceLogger *logger = TraceLoggerForCurrentThread();
     AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, ionBuilder->script()));
-    AutoTraceLog logCompile(logger, TraceLogger::IonCompilation);
+    AutoTraceLog logCompile(logger, TraceLogger_IonCompilation);
 
     JSRuntime *rt = ionBuilder->script()->compartment()->runtimeFromAnyThread();
 
     {
         AutoUnlockHelperThreadState unlock;
         PerThreadData::AutoEnterRuntime enter(threadData.ptr(),
                                               ionBuilder->script()->runtimeFromAnyThread());
         jit::IonContext ictx(jit::CompileRuntime::get(rt),
@@ -1113,17 +1113,17 @@ CurrentHelperThread()
     MOZ_ASSERT(thread);
     return thread;
 }
 
 void
 js::PauseCurrentHelperThread()
 {
     TraceLogger *logger = TraceLoggerForCurrentThread();
-    AutoTraceLog logPaused(logger, TraceLogger::IonCompilationPaused);
+    AutoTraceLog logPaused(logger, TraceLogger_IonCompilationPaused);
 
     HelperThread *thread = CurrentHelperThread();
 
     AutoLockHelperThreadState lock;
     while (thread->pause)
         HelperThreadState().wait(GlobalHelperThreadState::PAUSE);
 }
 
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1460,17 +1460,17 @@ Interpret(JSContext *cx, RunState &state
 
     /* The script is used frequently, so keep a local copy. */
     RootedScript script(cx);
     SET_SCRIPT(REGS.fp()->script());
 
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
     uint32_t scriptLogId = TraceLogCreateTextId(logger, script);
     TraceLogStartEvent(logger, scriptLogId);
-    TraceLogStartEvent(logger, TraceLogger::Interpreter);
+    TraceLogStartEvent(logger, TraceLogger_Interpreter);
 
     /*
      * Pool of rooters for use in this interpreter frame. References to these
      * are used for local variables within interpreter cases. This avoids
      * creating new rooters each time an interpreter case is entered, and also
      * correctness pitfalls due to incorrect compilation of destructor calls
      * around computed gotos.
      */
@@ -1758,18 +1758,18 @@ 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, TraceLogger::Scripts);
+        TraceLogStopEvent(logger, TraceLogger_Engine);
+        TraceLogStopEvent(logger, TraceLogger_Scripts);
 
         interpReturnOK = Debugger::onLeaveFrame(cx, REGS.fp(), interpReturnOK);
 
         REGS.fp()->epilogue(cx);
 
   jit_return_pop_frame:
 
         activation.popInlineFrame(REGS.fp());
@@ -2574,17 +2574,17 @@ CASE(JSOP_FUNCALL)
 
     if (newType)
         REGS.fp()->setUseNewType();
 
     SET_SCRIPT(REGS.fp()->script());
 
     uint32_t scriptLogId = TraceLogCreateTextId(logger, script);
     TraceLogStartEvent(logger, scriptLogId);
-    TraceLogStartEvent(logger, TraceLogger::Interpreter);
+    TraceLogStartEvent(logger, TraceLogger_Interpreter);
 
     if (!REGS.fp()->prologue(cx))
         goto error;
 
     switch (Debugger::onEnterFrame(cx, REGS.fp())) {
       case JSTRAP_CONTINUE:
         break;
       case JSTRAP_RETURN:
@@ -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, TraceLogger_Engine);
     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/RegExpObject.cpp
+++ b/js/src/vm/RegExpObject.cpp
@@ -454,17 +454,17 @@ RegExpShared::trace(JSTracer *trc)
     }
 }
 
 bool
 RegExpShared::compile(JSContext *cx, HandleLinearString input,
                       CompilationMode mode, ForceByteCodeEnum force)
 {
     TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
-    AutoTraceLog logCompile(logger, TraceLogger::IrregexpCompile);
+    AutoTraceLog logCompile(logger, TraceLogger_IrregexpCompile);
 
     if (!sticky()) {
         RootedAtom pattern(cx, source);
         return compile(cx, pattern, input, mode, force);
     }
 
     /*
      * The sticky case we implement hackily by prepending a caret onto the front
@@ -599,17 +599,17 @@ RegExpShared::execute(JSContext *cx, Han
 
     do {
         jit::JitCode *code = compilation(mode, input->hasLatin1Chars()).jitCode;
         if (!code)
             break;
 
         RegExpRunStatus result;
         {
-            AutoTraceLog logJIT(logger, TraceLogger::IrregexpExecute);
+            AutoTraceLog logJIT(logger, TraceLogger_IrregexpExecute);
             AutoCheckCannotGC nogc;
             if (input->hasLatin1Chars()) {
                 const Latin1Char *chars = input->latin1Chars(nogc) + charsOffset;
                 result = irregexp::ExecuteCode(cx, code, chars, start, length, matches);
             } else {
                 const char16_t *chars = input->twoByteChars(nogc) + charsOffset;
                 result = irregexp::ExecuteCode(cx, code, chars, start, length, matches);
             }
@@ -638,17 +638,17 @@ RegExpShared::execute(JSContext *cx, Han
         return RegExpRunStatus_Success;
     } while (false);
 
     // Compile bytecode for the RegExp if necessary.
     if (!compileIfNecessary(cx, input, mode, ForceByteCode))
         return RegExpRunStatus_Error;
 
     uint8_t *byteCode = compilation(mode, input->hasLatin1Chars()).byteCode;
-    AutoTraceLog logInterpreter(logger, TraceLogger::IrregexpExecute);
+    AutoTraceLog logInterpreter(logger, TraceLogger_IrregexpExecute);
 
     AutoStableStringChars inputChars(cx);
     if (!inputChars.init(cx, input))
         return RegExpRunStatus_Error;
 
     RegExpRunStatus result;
     if (inputChars.isLatin1()) {
         const Latin1Char *chars = inputChars.latin1Range().start().get() + charsOffset;
--- a/js/src/vm/TraceLogging.cpp
+++ b/js/src/vm/TraceLogging.cpp
@@ -75,22 +75,22 @@ rdtsc(void)
 
     return result;
 }
 #endif
 
 TraceLogging traceLoggers;
 
 static const char *
-TLTextIdString(TraceLogger::TextId id)
+TLTextIdString(TraceLoggerTextId id)
 {
     switch (id) {
-      case TraceLogger::TL_Error:
+      case TraceLogger_Error:
         return "TraceLogger failed to process text";
-#define NAME(textId) case TraceLogger::textId: return #textId;
+#define NAME(textId) case TraceLogger_ ## textId: return #textId;
         TRACELOGGER_TEXT_ID_LIST(NAME)
 #undef NAME
       default:
         MOZ_CRASH();
     }
 }
 
 TraceLogger::TraceLogger()
@@ -154,19 +154,19 @@ TraceLogger::init(uint32_t loggerId)
     stackEntry.setTreeId(0);
     stackEntry.setLastChildId(0);
     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);
+    // Eagerly create the default textIds, to match their TraceLoggerTextId.
+    for (uint32_t i = 0; i < TraceLogger_LAST; i++) {
+        TraceLoggerTextId id = TraceLoggerTextId(i);
         mozilla::DebugOnly<uint32_t> textId = createTextId(TLTextIdString(id));
         MOZ_ASSERT(textId == i);
     }
 
     enabled = 1;
     return true;
 }
 
@@ -210,24 +210,24 @@ TraceLogger::enable(JSContext *cx)
 
             while (!it.isScripted() && !it.done())
                 ++it;
 
             MOZ_ASSERT(!it.done());
             MOZ_ASSERT(it.isIonJS() || it.isBaselineJS());
 
             script = it.script();
-            engine = it.isIonJS() ? IonMonkey : Baseline;
+            engine = it.isIonJS() ? TraceLogger_IonMonkey : TraceLogger_Baseline;
         } else {
             MOZ_ASSERT(act->isInterpreter());
             InterpreterFrame *fp = act->asInterpreter()->current();
             MOZ_ASSERT(!fp->runningInJit());
 
             script = fp->script();
-            engine = Interpreter;
+            engine = TraceLogger_Interpreter;
             if (script->compartment() != cx->compartment()) {
                 failed = true;
                 enabled = 0;
                 return false;
             }
         }
 
         startEvent(createTextId(script));
@@ -343,98 +343,98 @@ TraceLogger::createTextId(const char *te
     assertNoQuotes(text);
 
     PointerHashMap::AddPtr p = pointerMap.lookupForAdd((const void *)text);
     if (p)
         return p->value();
 
     uint32_t textId = nextTextId++;
     if (!pointerMap.add(p, text, textId))
-        return TraceLogger::TL_Error;
+        return TraceLogger_Error;
 
     int written;
     if (textId > 0)
         written = fprintf(dictFile, ",\n\"%s\"", text);
     else
         written = fprintf(dictFile, "\"%s\"", text);
 
     if (written < 0)
-        return TraceLogger::TL_Error;
+        return TraceLogger_Error;
 
     return textId;
 }
 
 uint32_t
 TraceLogger::createTextId(JSScript *script)
 {
     if (!script->filename())
         return createTextId("");
 
     assertNoQuotes(script->filename());
 
     // Only log scripts when enabled otherwise return the global Scripts textId,
     // which will get filtered out.
-    if (!traceLoggers.isTextIdEnabled(TraceLogger::Scripts))
-        return TraceLogger::Scripts;
+    if (!traceLoggers.isTextIdEnabled(TraceLogger_Scripts))
+        return TraceLogger_Scripts;
 
     PointerHashMap::AddPtr p = pointerMap.lookupForAdd(script);
     if (p)
         return p->value();
 
     uint32_t textId = nextTextId++;
     if (!pointerMap.add(p, script, textId))
-        return TraceLogger::TL_Error;
+        return TraceLogger_Error;
 
     int written;
     if (textId > 0) {
         written = fprintf(dictFile, ",\n\"script %s:%u:%u\"", script->filename(),
                           (unsigned)script->lineno(), (unsigned)script->column());
     } else {
         written = fprintf(dictFile, "\"script %s:%u:%u\"", script->filename(),
                           (unsigned)script->lineno(), (unsigned)script->column());
     }
 
     if (written < 0)
-        return TraceLogger::TL_Error;
+        return TraceLogger_Error;
 
     return textId;
 }
 
 uint32_t
 TraceLogger::createTextId(const JS::ReadOnlyCompileOptions &compileOptions)
 {
     if (!compileOptions.filename())
         return createTextId("");
 
     assertNoQuotes(compileOptions.filename());
 
     // Only log scripts when enabled. Else return the global Scripts textId,
     // which will get filtered out.
-    if (!traceLoggers.isTextIdEnabled(TraceLogger::Scripts))
-        return TraceLogger::Scripts;
+    if (!traceLoggers.isTextIdEnabled(TraceLogger_Scripts))
+        return TraceLogger_Scripts;
 
     PointerHashMap::AddPtr p = pointerMap.lookupForAdd(&compileOptions);
     if (p)
         return p->value();
 
     uint32_t textId = nextTextId++;
     if (!pointerMap.add(p, &compileOptions, textId))
-        return TraceLogger::TL_Error;
+        return TraceLogger_Error;
 
     int written;
     if (textId > 0) {
         written = fprintf(dictFile, ",\n\"script %s:%d:%d\"", compileOptions.filename(),
                           compileOptions.lineno, compileOptions.column);
     } else {
         written = fprintf(dictFile, "\"script %s:%d:%d\"", compileOptions.filename(),
                           compileOptions.lineno, compileOptions.column);
     }
 
     if (written < 0)
-        return TraceLogger::TL_Error;
+        return TraceLogger_Error;
 
     return textId;
 }
 
 void
 TraceLogger::logTimestamp(uint32_t id)
 {
     if (enabled == 0)
@@ -578,17 +578,17 @@ TraceLogger::startEvent(uint32_t id)
                 enabled = 0;
                 failed = true;
                 return;
             }
         }
 
         // Log the time it took to flush the events as being from the
         // Tracelogger.
-        if (!startEvent(TraceLogger::TL, start)) {
+        if (!startEvent(TraceLogger_Internal, start)) {
             fprintf(stderr, "TraceLogging: Failed to start an event.\n");
             enabled = 0;
             failed = true;
             return;
         }
         stopEvent();
     }
 
@@ -668,17 +668,17 @@ TraceLogger::startEvent(uint32_t id, uin
 
     return true;
 }
 
 void
 TraceLogger::stopEvent(uint32_t id)
 {
 #ifdef DEBUG
-    if (id != TraceLogger::Scripts && id != TraceLogger::Engine &&
+    if (id != TraceLogger_Scripts && id != TraceLogger_Engine &&
         stack.size() > 1 && stack.lastEntry().active())
     {
         TreeEntry entry;
         MOZ_ASSERT(getTreeEntry(stack.lastEntry().treeId(), &entry));
         MOZ_ASSERT(entry.textId() == id);
     }
 #endif
     stopEvent();
@@ -789,84 +789,84 @@ TraceLogging::lazyInit()
             "usage: TLLOG=option,option,option,... where options can be:\n"
             "\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);
+        for (uint32_t i = 1; i < TraceLogger_LAST; i++) {
+            TraceLoggerTextId id = TraceLoggerTextId(i);
             if (!TraceLogger::textIdIsToggable(id))
                 continue;
             printf("  %s\n", TLTextIdString(id));
         }
         printf("\n");
         exit(0);
         /*NOTREACHED*/
     }
 
-    for (uint32_t i = 1; i < TraceLogger::LAST; i++) {
-        TraceLogger::TextId id = TraceLogger::TextId(i);
+    for (uint32_t i = 1; i < TraceLogger_LAST; i++) {
+        TraceLoggerTextId id = TraceLoggerTextId(i);
         if (TraceLogger::textIdIsToggable(id))
             enabledTextIds[i] = ContainsFlag(env, TLTextIdString(id));
         else
             enabledTextIds[i] = 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;
-        enabledTextIds[TraceLogger::Interpreter] = true;
-        enabledTextIds[TraceLogger::IonCompilation] = true;
-        enabledTextIds[TraceLogger::IonLinking] = true;
-        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;
+        enabledTextIds[TraceLogger_Bailout] = true;
+        enabledTextIds[TraceLogger_Baseline] = true;
+        enabledTextIds[TraceLogger_BaselineCompilation] = true;
+        enabledTextIds[TraceLogger_GC] = true;
+        enabledTextIds[TraceLogger_GCAllocation] = true;
+        enabledTextIds[TraceLogger_GCSweeping] = true;
+        enabledTextIds[TraceLogger_Interpreter] = true;
+        enabledTextIds[TraceLogger_IonCompilation] = true;
+        enabledTextIds[TraceLogger_IonLinking] = true;
+        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;
-        enabledTextIds[TraceLogger::DominatorTree] = true;
-        enabledTextIds[TraceLogger::PhiAnalysis] = true;
-        enabledTextIds[TraceLogger::ApplyTypes] = true;
-        enabledTextIds[TraceLogger::ParallelSafetyAnalysis] = true;
-        enabledTextIds[TraceLogger::AliasAnalysis] = true;
-        enabledTextIds[TraceLogger::GVN] = true;
-        enabledTextIds[TraceLogger::LICM] = true;
-        enabledTextIds[TraceLogger::RangeAnalysis] = true;
-        enabledTextIds[TraceLogger::LoopUnrolling] = true;
-        enabledTextIds[TraceLogger::EffectiveAddressAnalysis] = true;
-        enabledTextIds[TraceLogger::EliminateDeadCode] = true;
-        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_IonCompilation] = true;
+        enabledTextIds[TraceLogger_IonLinking] = true;
+        enabledTextIds[TraceLogger_FoldTests] = true;
+        enabledTextIds[TraceLogger_SplitCriticalEdges] = true;
+        enabledTextIds[TraceLogger_RenumberBlocks] = true;
+        enabledTextIds[TraceLogger_DominatorTree] = true;
+        enabledTextIds[TraceLogger_PhiAnalysis] = true;
+        enabledTextIds[TraceLogger_ApplyTypes] = true;
+        enabledTextIds[TraceLogger_ParallelSafetyAnalysis] = true;
+        enabledTextIds[TraceLogger_AliasAnalysis] = true;
+        enabledTextIds[TraceLogger_GVN] = true;
+        enabledTextIds[TraceLogger_LICM] = true;
+        enabledTextIds[TraceLogger_RangeAnalysis] = true;
+        enabledTextIds[TraceLogger_LoopUnrolling] = true;
+        enabledTextIds[TraceLogger_EffectiveAddressAnalysis] = true;
+        enabledTextIds[TraceLogger_EliminateDeadCode] = true;
+        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];
+    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"
--- a/js/src/vm/TraceLogging.h
+++ b/js/src/vm/TraceLogging.h
@@ -109,30 +109,30 @@ namespace jit {
 #define TRACELOGGER_TEXT_ID_LIST(_)                   \
     _(Bailout)                                        \
     _(Baseline)                                       \
     _(BaselineCompilation)                            \
     _(Engine)                                         \
     _(GC)                                             \
     _(GCAllocation)                                   \
     _(GCSweeping)                                     \
+    _(Internal)                                       \
     _(Interpreter)                                    \
     _(Invalidation)                                   \
     _(IonCompilation)                                 \
     _(IonCompilationPaused)                           \
     _(IonLinking)                                     \
     _(IonMonkey)                                      \
     _(IrregexpCompile)                                \
     _(IrregexpExecute)                                \
     _(MinorGC)                                        \
     _(ParserCompileFunction)                          \
     _(ParserCompileLazy)                              \
     _(ParserCompileScript)                            \
     _(Scripts)                                        \
-    _(TL)                                             \
     _(VM)                                             \
                                                       \
     /* Specific passes during ion compilation */      \
     _(FoldTests)                                      \
     _(SplitCriticalEdges)                             \
     _(RenumberBlocks)                                 \
     _(ScalarReplacement)                              \
     _(DominatorTree)                                  \
@@ -148,16 +148,25 @@ namespace jit {
     _(EffectiveAddressAnalysis)                       \
     _(EliminateDeadCode)                              \
     _(EdgeCaseAnalysis)                               \
     _(EliminateRedundantChecks)                       \
     _(GenerateLIR)                                    \
     _(RegisterAllocation)                             \
     _(GenerateCode)                                   \
 
+// Predefined IDs for common operations. These IDs can be used
+// without using TraceLogCreateTextId, because they are already created.
+enum TraceLoggerTextId {
+    TraceLogger_Error = 0,
+#   define DEFINE_TEXT_ID(textId) TraceLogger_ ## textId,
+    TRACELOGGER_TEXT_ID_LIST(DEFINE_TEXT_ID)
+#   undef DEFINE_TEXT_ID
+    TraceLogger_LAST
+};
 class AutoTraceLog;
 
 template <class T>
 class ContinuousSpace {
     T *data_;
     uint32_t size_;
     uint32_t capacity_;
 
@@ -248,25 +257,16 @@ class ContinuousSpace {
     void clear() {
         size_ = 0;
     }
 };
 
 class TraceLogger
 {
   public:
-    // Predefined IDs for common operations. These IDs can be used
-    // without using TraceLogCreateTextId, because there are already created.
-    enum TextId {
-        TL_Error = 0,
-#   define DEFINE_TEXT_ID(textId) textId,
-        TRACELOGGER_TEXT_ID_LIST(DEFINE_TEXT_ID)
-#   undef DEFINE_TEXT_ID
-        LAST
-    };
 
 #ifdef JS_TRACE_LOGGING
   private:
     typedef HashMap<const void *,
                     uint32_t,
                     PointerHasher<const void *, 3>,
                     SystemAllocPolicy> PointerHashMap;
 
@@ -428,23 +428,23 @@ class TraceLogger
 
   public:
     TraceLogger();
     ~TraceLogger();
 
     bool init(uint32_t loggerId);
 
     static bool textIdIsToggable(uint32_t id) {
-        if (id == TL_Error)
+        if (id == TraceLogger_Error)
             return false;
-        if (id == TL)
+        if (id == TraceLogger_Internal)
             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)
+        if (id == TraceLogger_IonMonkey || id == TraceLogger_Baseline || id == TraceLogger_Interpreter)
             return false;
         return true;
     }
 
     bool enable();
     bool enable(JSContext *cx);
     bool disable();
 
@@ -487,17 +487,17 @@ class TraceLogging
     typedef HashMap<PRThread *,
                     TraceLogger *,
                     PointerHasher<PRThread *, 3>,
                     SystemAllocPolicy> ThreadLoggerHashMap;
     typedef Vector<TraceLogger *, 1, js::SystemAllocPolicy > MainThreadLoggers;
 
     bool initialized;
     bool enabled;
-    bool enabledTextIds[TraceLogger::LAST];
+    bool enabledTextIds[TraceLogger_LAST];
     bool mainThreadEnabled;
     bool offThreadEnabled;
     ThreadLoggerHashMap threadLoggers;
     MainThreadLoggers mainThreadLoggers;
     uint32_t loggerId;
     FILE *out;
 
   public:
@@ -507,17 +507,17 @@ class TraceLogging
     TraceLogging();
     ~TraceLogging();
 
     TraceLogger *forMainThread(JSRuntime *runtime);
     TraceLogger *forMainThread(jit::CompileRuntime *runtime);
     TraceLogger *forThread(PRThread *thread);
 
     bool isTextIdEnabled(uint32_t textId) {
-        if (textId < TraceLogger::LAST)
+        if (textId < TraceLogger_LAST)
             return enabledTextIds[textId];
         return true;
     }
 
   private:
     TraceLogger *forMainThread(PerThreadData *mainThread);
     TraceLogger *create();
     bool lazyInit();
@@ -562,33 +562,33 @@ inline bool TraceLoggerDisable(TraceLogg
     return false;
 }
 
 inline uint32_t TraceLogCreateTextId(TraceLogger *logger, JSScript *script) {
 #ifdef JS_TRACE_LOGGING
     if (logger)
         return logger->createTextId(script);
 #endif
-    return TraceLogger::TL_Error;
+    return TraceLogger_Error;
 }
 inline uint32_t TraceLogCreateTextId(TraceLogger *logger,
                                      const JS::ReadOnlyCompileOptions &compileOptions)
 {
 #ifdef JS_TRACE_LOGGING
     if (logger)
         return logger->createTextId(compileOptions);
 #endif
-    return TraceLogger::TL_Error;
+    return TraceLogger_Error;
 }
 inline uint32_t TraceLogCreateTextId(TraceLogger *logger, const char *text) {
 #ifdef JS_TRACE_LOGGING
     if (logger)
         return logger->createTextId(text);
 #endif
-    return TraceLogger::TL_Error;
+    return TraceLogger_Error;
 }
 #ifdef JS_TRACE_LOGGING
 bool TraceLogTextIdEnabled(uint32_t textId);
 #else
 inline bool TraceLogTextIdEnabled(uint32_t textId) {
     return false;
 }
 #endif