Run the actual function
| 503 | |
| 504 | // Run the actual function |
| 505 | void 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 |
no test coverage detected