MCPcopy Create free account
hub / github.com/ZDoom/Raze / JitDumpLog

Function JitDumpLog

source/common/scripting/jit/jit.cpp:43–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void JitDumpLog(FILE *file, VMScriptFunction *sfunc)
44{
45 using namespace asmjit;
46 StringLogger logger;
47
48 if(sfunc->VarFlags & VARF_Abstract)
49 {
50 // Printf(TEXTCOLOR_ORANGE "Skipping abstract function during JIT dump: %s\n", sfunc->PrintableName.GetChars());
51 return;
52 }
53
54 try
55 {
56 ThrowingErrorHandler errorHandler;
57 CodeHolder code;
58 code.init(GetHostCodeInfo());
59 code.setErrorHandler(&errorHandler);
60 code.setLogger(&logger);
61
62 JitCompiler compiler(&code, sfunc);
63 compiler.Codegen();
64
65 fwrite(logger.getString(), logger.getLength(), 1, file);
66 }
67 catch (const std::exception &e)
68 {
69 fwrite(logger.getString(), logger.getLength(), 1, file);
70
71 FString err;
72 err.Format("Unexpected JIT error: %s\n", e.what());
73 fwrite(err.GetChars(), err.Len(), 1, file);
74 fclose(file);
75
76 I_FatalError("Unexpected JIT error: %s\n", e.what());
77 }
78}
79
80static void OutputJitLog(const asmjit::StringLogger &logger)
81{

Callers 1

DumpJitMethod · 0.85

Calls 12

GetHostCodeInfoFunction · 0.85
I_FatalErrorFunction · 0.85
setErrorHandlerMethod · 0.80
setLoggerMethod · 0.80
CodegenMethod · 0.80
LenMethod · 0.80
initMethod · 0.45
getStringMethod · 0.45
getLengthMethod · 0.45
FormatMethod · 0.45
whatMethod · 0.45
GetCharsMethod · 0.45

Tested by

no test coverage detected