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

Method runFunction

src/hx/cppia/CppiaFunction.cpp:505–536  ·  view source on GitHub ↗

Run the actual function

Source from the content-addressed store, hash-verified

503
504// Run the actual function
505void ScriptCallable::runFunction(CppiaCtx *ctx)
506{
507
508 #ifdef CPPIA_JIT
509 if (compiled)
510 {
511 AutoFrame frame(ctx);
512 //printf("Running compiled code...\n");
513 compiled(ctx);
514 //printf("Done.\n");
515 }
516 else
517 #endif
518 {
519 if (stackSize)
520 {
521 memset(ctx->pointer, 0 , stackSize );
522 ctx->pointer += stackSize;
523 }
524
525 if (hasDefaults)
526 {
527 for(int i=0;i<args.size();i++)
528 if (hasDefault[i])
529 args[i].setDefault(ctx, initVals[i]);
530 }
531
532 CPPIA_STACK_FRAME(this);
533 CPPIA_STACK_LINE(this);
534 body->runVoid(ctx);
535 }
536}
537
538
539

Callers 1

callScriptableMethod · 0.80

Calls 3

setDefaultMethod · 0.80
sizeMethod · 0.45
runVoidMethod · 0.45

Tested by

no test coverage detected