mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 995570 - Tracelogging: Initially implementation of logging VM calls, r=luke
This commit is contained in:
parent
a9ee687d32
commit
6fffa6d59b
@ -14,6 +14,7 @@
|
||||
#include "jit/MIR.h"
|
||||
#include "jit/MIRGenerator.h"
|
||||
#include "jit/ParallelFunctions.h"
|
||||
#include "vm/TraceLogging.h"
|
||||
|
||||
#include "jit/IonFrames-inl.h"
|
||||
|
||||
@ -628,6 +629,11 @@ CodeGeneratorShared::callVM(const VMFunction &fun, LInstruction *ins, const Regi
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
if (!emitTracelogStartEvent(TraceLogger::VM))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
// Stack is:
|
||||
// ... frame ...
|
||||
// [args]
|
||||
@ -667,6 +673,12 @@ CodeGeneratorShared::callVM(const VMFunction &fun, LInstruction *ins, const Regi
|
||||
masm.implicitPop(fun.explicitStackSlots() * sizeof(void *) + framePop);
|
||||
// Stack is:
|
||||
// ... frame ...
|
||||
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
if (!emitTracelogStopEvent(TraceLogger::VM))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1028,6 +1040,9 @@ CodeGeneratorShared::emitTracelogScript(bool isStart)
|
||||
bool
|
||||
CodeGeneratorShared::emitTracelogTree(bool isStart, uint32_t textId)
|
||||
{
|
||||
if (!TraceLogTextIdEnabled(textId))
|
||||
return true;
|
||||
|
||||
RegisterSet regs = RegisterSet::Volatile();
|
||||
Register logger = regs.takeGeneral();
|
||||
|
||||
@ -1037,28 +1052,15 @@ CodeGeneratorShared::emitTracelogTree(bool isStart, uint32_t textId)
|
||||
if (!patchableTraceLoggers_.append(patchLocation))
|
||||
return false;
|
||||
|
||||
if (isStart)
|
||||
if (isStart) {
|
||||
masm.tracelogStart(logger, textId);
|
||||
else
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
masm.tracelogStop(logger, textId);
|
||||
|
||||
masm.Pop(logger);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
CodeGeneratorShared::emitTracelogStopEvent()
|
||||
{
|
||||
RegisterSet regs = RegisterSet::Volatile();
|
||||
Register logger = regs.takeGeneral();
|
||||
|
||||
masm.Push(logger);
|
||||
|
||||
CodeOffsetLabel patchLocation = masm.movWithPatch(ImmPtr(nullptr), logger);
|
||||
if (!patchableTraceLoggers_.append(patchLocation))
|
||||
return false;
|
||||
|
||||
masm.tracelogStop(logger);
|
||||
#else
|
||||
masm.tracelogStop(logger);
|
||||
#endif
|
||||
}
|
||||
|
||||
masm.Pop(logger);
|
||||
return true;
|
||||
|
@ -467,13 +467,8 @@ class CodeGeneratorShared : public LInstructionVisitor
|
||||
return emitTracelogTree(/* isStart =*/ true, textId);
|
||||
}
|
||||
bool emitTracelogStopEvent(uint32_t textId) {
|
||||
#ifdef DEBUG
|
||||
return emitTracelogTree(/* isStart =*/ false, textId);
|
||||
#else
|
||||
return emitTracelogScript(/* isStart =*/ false);
|
||||
#endif
|
||||
}
|
||||
bool emitTracelogStopEvent();
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -90,6 +90,7 @@ const char* const text[] = {
|
||||
"YarrCompile",
|
||||
"YarrInterpret",
|
||||
"YarrJIT",
|
||||
"VM",
|
||||
"SplitCriticalEdges",
|
||||
"RenumberBlocks",
|
||||
"DominatorTree",
|
||||
@ -867,3 +868,9 @@ TraceLogging::create()
|
||||
|
||||
return logger;
|
||||
}
|
||||
|
||||
bool
|
||||
js::TraceLogTextIdEnabled(uint32_t textId)
|
||||
{
|
||||
return traceLoggers.isTextIdEnabled(textId);
|
||||
}
|
||||
|
@ -227,6 +227,7 @@ class TraceLogger
|
||||
YarrCompile,
|
||||
YarrInterpret,
|
||||
YarrJIT,
|
||||
VM,
|
||||
|
||||
// Specific passes during ion compilation:
|
||||
SplitCriticalEdges,
|
||||
@ -470,6 +471,13 @@ inline uint32_t TraceLogCreateTextId(TraceLogger *logger, const char *text) {
|
||||
#endif
|
||||
return TraceLogger::TL_Error;
|
||||
}
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
bool TraceLogTextIdEnabled(uint32_t textId);
|
||||
#else
|
||||
inline bool TraceLogTextIdEnabled(uint32_t textId) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
inline void TraceLogTimestamp(TraceLogger *logger, uint32_t textId) {
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
if (logger)
|
||||
|
Loading…
Reference in New Issue
Block a user