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

Function CanJit

source/common/scripting/vm/vmframe.cpp:277–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277static bool CanJit(VMScriptFunction *func)
278{
279 // Asmjit has a 256 register limit. Stay safely away from it as the jit compiler uses a few for temporaries as well.
280 // Any function exceeding the limit will use the VM - a fair punishment to someone for writing a function so bloated ;)
281
282 if(func->blockJit) return false;
283
284 int maxregs = 200;
285 if (func->NumRegA + func->NumRegD + func->NumRegF + func->NumRegS < maxregs)
286 return true;
287
288 Printf(TEXTCOLOR_ORANGE "%s is using too many registers (%d of max %d)! Function will not use native code.\n", func->PrintableName, func->NumRegA + func->NumRegD + func->NumRegF + func->NumRegS, maxregs);
289
290 return false;
291}
292
293void VMScriptFunction::JitCompile()
294{

Callers 1

JitCompileMethod · 0.85

Calls 1

PrintfFunction · 0.85

Tested by

no test coverage detected