Backed out changeset 2b29d8a00774 (bug 996509)

This commit is contained in:
Carsten "Tomcat" Book 2014-11-21 08:04:23 +01:00
parent 12c9723a30
commit da26f2d23e
9 changed files with 49 additions and 49 deletions

View File

@ -424,7 +424,9 @@ BaselineCompiler::emitEpilogue()
masm.Push(loggerReg);
masm.movePtr(ImmPtr(logger), loggerReg);
masm.tracelogStop(loggerReg, TraceLogger::Baseline);
masm.tracelogStop(loggerReg, TraceLogger::Scripts);
// Stop the script. Using a stop without checking the textId, since we
// we didn't save the textId for the script.
masm.tracelogStop(loggerReg);
masm.Pop(loggerReg);
#endif

View File

@ -757,7 +757,7 @@ HandleException(ResumeFromException *rfe)
probes::ExitScript(cx, script, script->functionNonDelazifying(), popSPSFrame);
if (!frames.more()) {
TraceLogStopEvent(logger, TraceLogger::IonMonkey);
TraceLogStopEvent(logger, TraceLogger::Scripts);
TraceLogStopEvent(logger);
break;
}
++frames;
@ -788,7 +788,7 @@ HandleException(ResumeFromException *rfe)
return;
TraceLogStopEvent(logger, TraceLogger::Baseline);
TraceLogStopEvent(logger, TraceLogger::Scripts);
TraceLogStopEvent(logger);
// Unwind profiler pseudo-stack
JSScript *script = iter.script();

View File

@ -1670,9 +1670,6 @@ MacroAssembler::printf(const char *output, Register value)
void
MacroAssembler::tracelogStart(Register logger, uint32_t textId)
{
if (!TraceLogTextIdEnabled(textId))
return;
void (&TraceLogFunc)(TraceLogger*, uint32_t) = TraceLogStartEvent;
PushRegsInMask(RegisterSet::Volatile());
@ -1709,14 +1706,15 @@ MacroAssembler::tracelogStart(Register logger, Register textId)
passABIArg(textId);
callWithABINoProfiling(JS_FUNC_TO_DATA_PTR(void *, TraceLogFunc));
regs.add(temp);
PopRegsInMask(RegisterSet::Volatile());
}
void
MacroAssembler::tracelogStop(Register logger, uint32_t textId)
{
if (!TraceLogTextIdEnabled(textId))
return;
void (&TraceLogFunc)(TraceLogger*, uint32_t) = TraceLogStopEvent;
PushRegsInMask(RegisterSet::Volatile());
@ -1725,35 +1723,27 @@ MacroAssembler::tracelogStop(Register logger, uint32_t textId)
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;
setupUnalignedABICall(1, temp);
passABIArg(logger);
#endif
callWithABINoProfiling(JS_FUNC_TO_DATA_PTR(void *, TraceLogFunc));
regs.add(temp);
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;
PushRegsInMask(RegisterSet::Volatile());
RegisterSet regs = RegisterSet::Volatile();
regs.takeUnchecked(logger);
regs.takeUnchecked(textId);
Register temp = regs.takeGeneral();
@ -1761,17 +1751,34 @@ MacroAssembler::tracelogStop(Register logger, Register textId)
setupUnalignedABICall(2, temp);
passABIArg(logger);
passABIArg(textId);
callWithABINoProfiling(JS_FUNC_TO_DATA_PTR(void *, TraceLogFunc));
regs.add(temp);
PopRegsInMask(RegisterSet::Volatile());
#else
tracelogStop(logger);
#endif
}
void
MacroAssembler::tracelogStop(Register logger)
{
void (&TraceLogFunc)(TraceLogger*) = TraceLogStopEvent;
PushRegsInMask(RegisterSet::Volatile());
RegisterSet regs = RegisterSet::Volatile();
regs.takeUnchecked(logger);
Register temp = regs.takeGeneral();
setupUnalignedABICall(1, temp);
passABIArg(logger);
#endif
callWithABINoProfiling(JS_FUNC_TO_DATA_PTR(void *, TraceLogFunc));
regs.add(temp);
PopRegsInMask(RegisterSet::Volatile());
}
#endif

View File

@ -1211,6 +1211,7 @@ class MacroAssembler : public MacroAssemblerSpecific
void tracelogStart(Register logger, Register textId);
void tracelogStop(Register logger, uint32_t textId);
void tracelogStop(Register logger, Register textId);
void tracelogStop(Register logger);
#endif
#define DISPATCH_FLOATING_POINT_OP(method, type, arg1d, arg1f, arg2) \

View File

@ -780,7 +780,7 @@ DebugEpilogueOnBaselineReturn(JSContext *cx, BaselineFrame *frame, jsbytecode *p
// here before we enter the exception handler.
TraceLogger *logger = TraceLoggerForMainThread(cx->runtime());
TraceLogStopEvent(logger, TraceLogger::Baseline);
TraceLogStopEvent(logger, TraceLogger::Scripts);
TraceLogStopEvent(logger); // Leave script.
return false;
}

View File

@ -1402,9 +1402,6 @@ CodeGeneratorShared::computeDivisionConstants(int d) {
bool
CodeGeneratorShared::emitTracelogScript(bool isStart)
{
if (!TraceLogTextIdEnabled(TraceLogger::Scripts))
return true;
Label done;
RegisterSet regs = RegisterSet::Volatile();
@ -1458,10 +1455,15 @@ CodeGeneratorShared::emitTracelogTree(bool isStart, uint32_t textId)
Address enabledAddress(logger, TraceLogger::offsetOfEnabled());
masm.branch32(Assembler::Equal, enabledAddress, Imm32(0), &done);
if (isStart)
if (isStart) {
masm.tracelogStart(logger, textId);
else
} else {
#ifdef DEBUG
masm.tracelogStop(logger, textId);
#else
masm.tracelogStop(logger);
#endif
}
masm.bind(&done);

View File

@ -1764,7 +1764,8 @@ CASE(JSOP_RETRVAL)
// Stop the engine. (No details about which engine exactly, could be
// interpreter, Baseline or IonMonkey.)
TraceLogStopEvent(logger);
TraceLogStopEvent(logger, TraceLogger::Scripts);
// Stop the script. (Again no details about which script exactly.)
TraceLogStopEvent(logger);
interpReturnOK = Debugger::onLeaveFrame(cx, REGS.fp(), interpReturnOK);

View File

@ -378,11 +378,6 @@ TraceLogger::createTextId(JSScript *script)
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;
PointerHashMap::AddPtr p = pointerMap.lookupForAdd(script);
if (p)
return p->value();
@ -414,11 +409,6 @@ TraceLogger::createTextId(const JS::ReadOnlyCompileOptions &compileOptions)
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;
PointerHashMap::AddPtr p = pointerMap.lookupForAdd(&compileOptions);
if (p)
return p->value();
@ -681,10 +671,10 @@ void
TraceLogger::stopEvent(uint32_t id)
{
#ifdef DEBUG
if (stack.size() > 1 && id != TraceLogger::Scripts && stack.lastEntry().active()) {
if (stack.size() > 1) {
TreeEntry entry;
MOZ_ASSERT(getTreeEntry(stack.lastEntry().treeId(), &entry));
MOZ_ASSERT(entry.textId() == id);
MOZ_ASSERT_IF(stack.lastEntry().active(), getTreeEntry(stack.lastEntry().treeId(), &entry));
MOZ_ASSERT_IF(stack.lastEntry().active(), entry.textId() == id);
}
#endif
stopEvent();
@ -831,7 +821,6 @@ TraceLogging::lazyInit()
enabledTextIds[TraceLogger::ParserCompileScript] = true;
enabledTextIds[TraceLogger::IrregexpCompile] = true;
enabledTextIds[TraceLogger::IrregexpExecute] = true;
enabledTextIds[TraceLogger::Scripts] = true;
}
if (ContainsFlag(env, "IonCompiler")) {
@ -856,7 +845,6 @@ TraceLogging::lazyInit()
enabledTextIds[TraceLogger::GenerateLIR] = true;
enabledTextIds[TraceLogger::RegisterAllocation] = true;
enabledTextIds[TraceLogger::GenerateCode] = true;
enabledTextIds[TraceLogger::Scripts] = true;
}
const char *options = getenv("TLOPTIONS");

View File

@ -119,14 +119,13 @@ namespace jit {
_(IonCompilationPaused) \
_(IonLinking) \
_(IonMonkey) \
_(IrregexpCompile) \
_(IrregexpExecute) \
_(MinorGC) \
_(ParserCompileFunction) \
_(ParserCompileLazy) \
_(ParserCompileScript) \
_(Scripts) \
_(TL) \
_(IrregexpCompile) \
_(IrregexpExecute) \
_(VM) \
\
/* Specific passes during ion compilation */ \