mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 4ba3f3e635fc (bug 1083694)
This commit is contained in:
parent
3379156fd3
commit
aa18f84950
@ -225,7 +225,7 @@ frontend::CompileScript(ExclusiveContext *cx, LifoAlloc *alloc, HandleObject sco
|
||||
logger = TraceLoggerForMainThread(cx->asJSContext()->runtime());
|
||||
else
|
||||
logger = TraceLoggerForCurrentThread();
|
||||
uint32_t logId = js::TraceLogCreateTextId(logger, TraceLogger_AnnotateScripts, options);
|
||||
uint32_t logId = js::TraceLogCreateTextId(logger, options);
|
||||
js::AutoTraceLog scriptLogger(logger, logId);
|
||||
js::AutoTraceLog typeLogger(logger, TraceLogger_ParserCompileScript);
|
||||
|
||||
@ -476,7 +476,7 @@ frontend::CompileLazyFunction(JSContext *cx, Handle<LazyScript*> lazy, const cha
|
||||
.setSelfHostingMode(false);
|
||||
|
||||
js::TraceLoggerThread *logger = js::TraceLoggerForMainThread(cx->runtime());
|
||||
uint32_t logId = js::TraceLogCreateTextId(logger, TraceLogger_AnnotateScripts, options);
|
||||
uint32_t logId = js::TraceLogCreateTextId(logger, options);
|
||||
js::AutoTraceLog scriptLogger(logger, logId);
|
||||
js::AutoTraceLog typeLogger(logger, TraceLogger_ParserCompileLazy);
|
||||
|
||||
@ -534,7 +534,7 @@ CompileFunctionBody(JSContext *cx, MutableHandleFunction fun, const ReadOnlyComp
|
||||
HandleObject enclosingScope, GeneratorKind generatorKind)
|
||||
{
|
||||
js::TraceLoggerThread *logger = js::TraceLoggerForMainThread(cx->runtime());
|
||||
uint32_t logId = js::TraceLogCreateTextId(logger, TraceLogger_AnnotateScripts, options);
|
||||
uint32_t logId = js::TraceLogCreateTextId(logger, options);
|
||||
js::AutoTraceLog scriptLogger(logger, logId);
|
||||
js::AutoTraceLog typeLogger(logger, TraceLogger_ParserCompileFunction);
|
||||
|
||||
|
@ -1460,10 +1460,7 @@ jit::BailoutIonToBaseline(JSContext *cx, JitActivation *activation, JitFrameIter
|
||||
snapIter.settleOnFrame();
|
||||
|
||||
if (frameNo > 0) {
|
||||
// TraceLogger doesn't create entries for inlined frames. But we
|
||||
// see them in Baseline. Here we create the start events of those
|
||||
// entries. So they correspond to what we will see in Baseline.
|
||||
TraceLogStartEvent(logger, TraceLogCreateTextId(logger, TraceLogger_Scripts, scr));
|
||||
TraceLogStartEvent(logger, TraceLogCreateTextId(logger, scr));
|
||||
TraceLogStartEvent(logger, TraceLogger_Baseline);
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ BaselineCompiler::compile()
|
||||
script->filename(), script->lineno());
|
||||
|
||||
TraceLoggerThread *logger = TraceLoggerForMainThread(cx->runtime());
|
||||
AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, TraceLogger_AnnotateScripts, script));
|
||||
AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, script));
|
||||
AutoTraceLog logCompile(logger, TraceLogger_BaselineCompilation);
|
||||
|
||||
if (!script->ensureHasTypes(cx) || !script->ensureHasAnalyzedArgsUsage(cx))
|
||||
|
@ -859,7 +859,7 @@ BaselineScript::toggleTraceLoggerScripts(JSRuntime *runtime, JSScript *script, b
|
||||
// Patch the logging script textId to be correct.
|
||||
// When logging log the specific textId else the global Scripts textId.
|
||||
TraceLoggerThread *logger = TraceLoggerForMainThread(runtime);
|
||||
uint32_t textId = TraceLogCreateTextId(logger, TraceLogger_Scripts, script);
|
||||
uint32_t textId = TraceLogCreateTextId(logger, script);
|
||||
CodeLocationLabel patchLocation(method()->raw() + traceLoggerScriptTextIdOffset_);
|
||||
if (enable) {
|
||||
Assembler::PatchDataWithValueCheck(patchLocation,
|
||||
|
@ -7935,7 +7935,7 @@ CodeGenerator::link(JSContext *cx, types::CompilerConstraintList *constraints)
|
||||
ImmPtr(logger),
|
||||
ImmPtr(nullptr));
|
||||
}
|
||||
uint32_t scriptId = TraceLogCreateTextId(logger, TraceLogger_Scripts, script);
|
||||
uint32_t scriptId = TraceLogCreateTextId(logger, script);
|
||||
for (uint32_t i = 0; i < patchableTLScripts_.length(); i++) {
|
||||
patchableTLScripts_[i].fixup(&masm);
|
||||
Assembler::PatchDataWithValueCheck(CodeLocationLabel(code, patchableTLScripts_[i]),
|
||||
|
@ -540,8 +540,7 @@ jit::LazyLinkTopActivation(JSContext *cx)
|
||||
|
||||
if (CodeGenerator *codegen = builder->backgroundCodegen()) {
|
||||
js::TraceLoggerThread *logger = TraceLoggerForMainThread(cx->runtime());
|
||||
uint32_t textId = TraceLogCreateTextId(logger, TraceLogger_AnnotateScripts, script);
|
||||
AutoTraceLog logScript(logger, textId);
|
||||
AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, script));
|
||||
AutoTraceLog logLink(logger, TraceLogger_IonLinking);
|
||||
|
||||
IonContext ictx(cx, &builder->alloc());
|
||||
@ -1804,8 +1803,7 @@ AttachFinishedCompilations(JSContext *cx)
|
||||
if (CodeGenerator *codegen = builder->backgroundCodegen()) {
|
||||
RootedScript script(cx, builder->script());
|
||||
IonContext ictx(cx, &builder->alloc());
|
||||
uint32_t textId = TraceLogCreateTextId(logger, TraceLogger_AnnotateScripts, script);
|
||||
AutoTraceLog logScript(logger, textId);
|
||||
AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, script));
|
||||
AutoTraceLog logLink(logger, TraceLogger_IonLinking);
|
||||
|
||||
// Root the assembler until the builder is finished below. As it
|
||||
@ -1885,8 +1883,7 @@ IonCompile(JSContext *cx, JSScript *script,
|
||||
OptimizationLevel optimizationLevel)
|
||||
{
|
||||
TraceLoggerThread *logger = TraceLoggerForMainThread(cx->runtime());
|
||||
uint32_t textId = TraceLogCreateTextId(logger, TraceLogger_AnnotateScripts, script);
|
||||
AutoTraceLog logScript(logger, textId);
|
||||
AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, script));
|
||||
AutoTraceLog logCompile(logger, TraceLogger_IonCompilation);
|
||||
|
||||
MOZ_ASSERT(optimizationLevel > Optimization_DontCompile);
|
||||
|
@ -3912,7 +3912,6 @@ Debugger::setupTraceLoggerScriptCalls(JSContext *cx, unsigned argc, Value *vp)
|
||||
return false;
|
||||
|
||||
TraceLogEnableTextId(cx, TraceLogger_Scripts);
|
||||
TraceLogDisableTextId(cx, TraceLogger_AnnotateScripts);
|
||||
|
||||
args.rval().setBoolean(true);
|
||||
|
||||
|
@ -1048,8 +1048,7 @@ HelperThread::handleIonWorkload()
|
||||
ionBuilder->setPauseFlag(&pause);
|
||||
|
||||
TraceLoggerThread *logger = TraceLoggerForCurrentThread();
|
||||
uint32_t textId = TraceLogCreateTextId(logger, TraceLogger_AnnotateScripts, ionBuilder->script());
|
||||
AutoTraceLog logScript(logger, textId);
|
||||
AutoTraceLog logScript(logger, TraceLogCreateTextId(logger, ionBuilder->script()));
|
||||
AutoTraceLog logCompile(logger, TraceLogger_IonCompilation);
|
||||
|
||||
JSRuntime *rt = ionBuilder->script()->compartment()->runtimeFromAnyThread();
|
||||
|
@ -1463,7 +1463,7 @@ Interpret(JSContext *cx, RunState &state)
|
||||
SET_SCRIPT(REGS.fp()->script());
|
||||
|
||||
TraceLoggerThread *logger = TraceLoggerForMainThread(cx->runtime());
|
||||
uint32_t scriptLogId = TraceLogCreateTextId(logger, TraceLogger_Scripts, script);
|
||||
uint32_t scriptLogId = TraceLogCreateTextId(logger, script);
|
||||
TraceLogStartEvent(logger, scriptLogId);
|
||||
TraceLogStartEvent(logger, TraceLogger_Interpreter);
|
||||
|
||||
@ -2577,7 +2577,7 @@ CASE(JSOP_FUNCALL)
|
||||
|
||||
SET_SCRIPT(REGS.fp()->script());
|
||||
|
||||
uint32_t scriptLogId = TraceLogCreateTextId(logger, TraceLogger_Scripts, script);
|
||||
uint32_t scriptLogId = TraceLogCreateTextId(logger, script);
|
||||
TraceLogStartEvent(logger, scriptLogId);
|
||||
TraceLogStartEvent(logger, TraceLogger_Interpreter);
|
||||
|
||||
|
@ -225,7 +225,7 @@ TraceLoggerThread::enable(JSContext *cx)
|
||||
}
|
||||
}
|
||||
|
||||
startEvent(createTextId(TraceLogger_Scripts, script));
|
||||
startEvent(createTextId(script));
|
||||
startEvent(engine);
|
||||
}
|
||||
|
||||
@ -338,11 +338,8 @@ TraceLoggerThread::createTextId(const char *text)
|
||||
}
|
||||
|
||||
uint32_t
|
||||
TraceLoggerThread::createTextId(TraceLoggerTextId type, const char *filename, size_t lineno,
|
||||
size_t colno, const void *ptr)
|
||||
TraceLoggerThread::createTextId(const char *filename, size_t lineno, size_t colno, const void *ptr)
|
||||
{
|
||||
MOZ_ASSERT(type == TraceLogger_Scripts || type == TraceLogger_AnnotateScripts);
|
||||
|
||||
if (!filename)
|
||||
filename = "<unknown>";
|
||||
|
||||
@ -350,8 +347,8 @@ TraceLoggerThread::createTextId(TraceLoggerTextId type, const char *filename, si
|
||||
|
||||
// Only log scripts when enabled otherwise return the global Scripts textId,
|
||||
// which will get filtered out.
|
||||
if (!traceLoggers.isTextIdEnabled(type))
|
||||
return type;
|
||||
if (!traceLoggers.isTextIdEnabled(TraceLogger_Scripts))
|
||||
return TraceLogger_Scripts;
|
||||
|
||||
PointerHashMap::AddPtr p = pointerMap.lookupForAdd(ptr);
|
||||
if (p)
|
||||
@ -388,15 +385,15 @@ TraceLoggerThread::createTextId(TraceLoggerTextId type, const char *filename, si
|
||||
}
|
||||
|
||||
uint32_t
|
||||
TraceLoggerThread::createTextId(TraceLoggerTextId type, JSScript *script)
|
||||
TraceLoggerThread::createTextId(JSScript *script)
|
||||
{
|
||||
return createTextId(type, script->filename(), script->lineno(), script->column(), script);
|
||||
return createTextId(script->filename(), script->lineno(), script->column(), script);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
TraceLoggerThread::createTextId(TraceLoggerTextId type, const JS::ReadOnlyCompileOptions &script)
|
||||
TraceLoggerThread::createTextId(const JS::ReadOnlyCompileOptions &script)
|
||||
{
|
||||
return createTextId(type, script.filename(), script.lineno, script.column, &script);
|
||||
return createTextId(script.filename(), script.lineno, script.column, &script);
|
||||
}
|
||||
|
||||
void
|
||||
@ -552,7 +549,6 @@ TraceLoggerThreadState::lazyInit()
|
||||
}
|
||||
|
||||
if (ContainsFlag(env, "Default")) {
|
||||
enabledTextIds[TraceLogger_AnnotateScripts] = true;
|
||||
enabledTextIds[TraceLogger_Bailout] = true;
|
||||
enabledTextIds[TraceLogger_Baseline] = true;
|
||||
enabledTextIds[TraceLogger_BaselineCompilation] = true;
|
||||
|
@ -151,11 +151,10 @@ class TraceLoggerThread
|
||||
// limited if possible, because of the overhead.
|
||||
// Note: it is not allowed to use them in logTimestamp.
|
||||
uint32_t createTextId(const char *text);
|
||||
uint32_t createTextId(TraceLoggerTextId type, JSScript *script);
|
||||
uint32_t createTextId(TraceLoggerTextId type, const JS::ReadOnlyCompileOptions &script);
|
||||
uint32_t createTextId(JSScript *script);
|
||||
uint32_t createTextId(const JS::ReadOnlyCompileOptions &script);
|
||||
private:
|
||||
uint32_t createTextId(TraceLoggerTextId type, const char *filename, size_t lineno,
|
||||
size_t colno, const void *p);
|
||||
uint32_t createTextId(const char *filename, size_t lineno, size_t colno, const void *p);
|
||||
|
||||
public:
|
||||
// Log an event (no start/stop, only the timestamp is recorded).
|
||||
@ -265,21 +264,19 @@ inline bool TraceLoggerDisable(TraceLoggerThread *logger) {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline uint32_t TraceLogCreateTextId(TraceLoggerThread *logger, TraceLoggerTextId type,
|
||||
JSScript *script)
|
||||
{
|
||||
inline uint32_t TraceLogCreateTextId(TraceLoggerThread *logger, JSScript *script) {
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
if (logger)
|
||||
return logger->createTextId(type, script);
|
||||
return logger->createTextId(script);
|
||||
#endif
|
||||
return TraceLogger_Error;
|
||||
}
|
||||
inline uint32_t TraceLogCreateTextId(TraceLoggerThread *logger, TraceLoggerTextId type,
|
||||
inline uint32_t TraceLogCreateTextId(TraceLoggerThread *logger,
|
||||
const JS::ReadOnlyCompileOptions &compileOptions)
|
||||
{
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
if (logger)
|
||||
return logger->createTextId(type, compileOptions);
|
||||
return logger->createTextId(compileOptions);
|
||||
#endif
|
||||
return TraceLogger_Error;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "jsstr.h"
|
||||
|
||||
#define TRACELOGGER_TREE_ITEMS(_) \
|
||||
_(AnnotateScripts) \
|
||||
_(Baseline) \
|
||||
_(BaselineCompilation) \
|
||||
_(Engine) \
|
||||
|
Loading…
Reference in New Issue
Block a user