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

Function JitCompile

source/common/scripting/jit/jit.cpp:15–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13static void OutputJitLog(const asmjit::StringLogger &logger);
14
15JitFuncPtr JitCompile(VMScriptFunction *sfunc)
16{
17#if 0
18 if (strcmp(sfunc->PrintableName, "StatusScreen.drawNum") != 0)
19 return nullptr;
20#endif
21
22 using namespace asmjit;
23 StringLogger logger;
24 try
25 {
26 ThrowingErrorHandler errorHandler;
27 CodeHolder code;
28 code.init(GetHostCodeInfo());
29 code.setErrorHandler(&errorHandler);
30 code.setLogger(&logger);
31
32 JitCompiler compiler(&code, sfunc);
33 return reinterpret_cast<JitFuncPtr>(AddJitFunction(&code, &compiler));
34 }
35 catch (const CRecoverableError &e)
36 {
37 OutputJitLog(logger);
38 Printf("%s: Unexpected JIT error: %s\n",sfunc->PrintableName, e.what());
39 return nullptr;
40 }
41}
42
43void JitDumpLog(FILE *file, VMScriptFunction *sfunc)
44{

Callers 1

JitCompileMethod · 0.85

Calls 8

GetHostCodeInfoFunction · 0.85
AddJitFunctionFunction · 0.85
OutputJitLogFunction · 0.85
PrintfFunction · 0.85
setErrorHandlerMethod · 0.80
setLoggerMethod · 0.80
initMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected