MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / beginGeneration

Method beginGeneration

src/hx/cppia/CppiaCompiler.cpp:295–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293
294
295 void beginGeneration(int inArgs) HXCPP_OVERRIDE
296 {
297 compiler = sljit_create_compiler(NULL);
298
299 int options = 0;
300 // S0 is stack
301 int saveds = inArgs;
302 if (usesCtx && saveds<1)
303 saveds = 1;
304 if (usesFrame && saveds<2)
305 saveds = 2;
306 if (usesThis && saveds<3)
307 {
308 usesFrame = true;
309 saveds = 3;
310 }
311 saveds = 3;
312 int fsaveds = 0;
313 #ifdef HXCPP_M64
314 // Add shadow space for native calls
315 int scratches = std::max(maxTempCount + (makesNativeCalls?4:0) ,inArgs);
316 #else
317 int scratches = std::max(maxTempCount,inArgs);
318 #endif
319
320 sljit_emit_enter(compiler, options, inArgs, scratches, saveds, maxFTempCount, fsaveds, maxLocalSize);
321 usesCtx = true;
322
323 if (usesFrame)
324 {
325 move( sJitFrame, sJitCtxFrame );
326 if (makesNativeCalls)
327 add( sJitCtxPointer, sJitFrame, maxFrameSize );
328 }
329
330 if (usesThis)
331 move( sJitThis, JitFramePos(0) );
332
333 frameSize = baseFrameSize;
334 uncaught.setSize(0);
335 catching = 0;
336 }
337
338 CppiaFunc finishGeneration() HXCPP_OVERRIDE
339 {

Callers 1

compileMethod · 0.80

Calls 5

sljit_create_compilerFunction · 0.85
maxFunction · 0.85
JitFramePosClass · 0.85
setSizeMethod · 0.80
sljit_emit_enterFunction · 0.50

Tested by

no test coverage detected