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

Method Setup

source/common/scripting/jit/jit.cpp:236–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void JitCompiler::Setup()
237{
238 using namespace asmjit;
239
240 ResetTemp();
241
242 static const char *marks = "=======================================================";
243 cc.comment("", 0);
244 cc.comment(marks, 56);
245
246 FString funcname;
247 funcname.Format("Function: %s", sfunc->PrintableName);
248 cc.comment(funcname.GetChars(), funcname.Len());
249
250 cc.comment(marks, 56);
251 cc.comment("", 0);
252
253 auto unusedFunc = cc.newIntPtr("func"); // VMFunction*
254 args = cc.newIntPtr("args"); // VMValue *params
255 numargs = cc.newInt32("numargs"); // int numargs
256 ret = cc.newIntPtr("ret"); // VMReturn *ret
257 numret = cc.newInt32("numret"); // int numret
258
259 func = cc.addFunc(FuncSignature5<int, VMFunction *, void *, int, void *, int>());
260 cc.setArg(0, unusedFunc);
261 cc.setArg(1, args);
262 cc.setArg(2, numargs);
263 cc.setArg(3, ret);
264 cc.setArg(4, numret);
265
266 callReturnsCursor = cc.getCursor();
267
268 konstd = sfunc->KonstD;
269 konstf = sfunc->KonstF;
270 konsts = sfunc->KonstS;
271 konsta = sfunc->KonstA;
272
273 labels.Resize(sfunc->CodeSize);
274
275 CreateRegisters();
276 IncrementVMCalls();
277 SetupFrame();
278}
279
280void JitCompiler::SetupFrame()
281{

Callers

nothing calls this directly

Calls 8

LenMethod · 0.80
addFuncMethod · 0.80
getCursorMethod · 0.80
commentMethod · 0.45
FormatMethod · 0.45
GetCharsMethod · 0.45
setArgMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected