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

Method EmitRETI

source/common/scripting/jit/jit_flow.cpp:235–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void JitCompiler::EmitRETI()
236{
237 using namespace asmjit;
238
239 int a = A;
240 int retnum = a & ~RET_FINAL;
241
242 X86Gp reg_retnum = newTempInt32();
243 X86Gp location = newTempIntPtr();
244 Label L_endif = cc.newLabel();
245
246 cc.mov(reg_retnum, retnum);
247 cc.cmp(reg_retnum, numret);
248 cc.jge(L_endif);
249
250 cc.mov(location, x86::ptr(ret, retnum * sizeof(VMReturn)));
251 cc.mov(x86::dword_ptr(location), BCs);
252
253 if (a & RET_FINAL)
254 {
255 cc.add(reg_retnum, 1);
256 EmitPopFrame();
257 cc.ret(reg_retnum);
258 }
259
260 cc.bind(L_endif);
261 if (a & RET_FINAL)
262 {
263 EmitPopFrame();
264 cc.ret(numret);
265 }
266}
267
268void JitCompiler::EmitTHROW()
269{

Callers

nothing calls this directly

Calls 4

retMethod · 0.80
newLabelMethod · 0.45
addMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected