MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / invoke

Function invoke

include/daScript/simulate/simulate.h:673–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671#endif
672
673 DAS_EVAL_ABI __forceinline vec4f invoke(const Block &block, vec4f * args, void * cmres, LineInfo * line ) {
674 char * EP, *SP;
675 vec4f * TBA = nullptr;
676 char * STB = stack.bottom();
677#if DAS_ENABLE_STACK_WALK
678 if (!stack.push_invoke(sizeof(Prologue), block.stackOffset, EP, SP)) {
679 throw_error_at(line, "stack overflow during invoke");
680 }
681 Prologue * pp = (Prologue *)stack.ap();
682 pp->block = (Block *)(intptr_t(&block) | 1);
683 pp->arguments = args;
684 pp->cmres = cmres;
685 pp->line = line;
686#else
687 stack.invoke(block.stackOffset, EP, SP);
688#endif
689 BlockArguments * __restrict ba = nullptr;
690 BlockArguments saveArguments;
691 if ( block.argumentsOffset || cmres ) {
692 ba = (BlockArguments *) ( STB + block.argumentsOffset );
693 saveArguments = *ba;
694 ba->arguments = args;
695 ba->copyOrMoveResult = (char *) cmres;
696 TBA = abiThisBlockArg;
697 abiThisBlockArg = args;
698 }
699 vec4f * __restrict saveFunctionArguments = abiArg;
700 abiArg = block.functionArguments;
701 vec4f block_result = block.body->eval(*this);
702 abiArg = saveFunctionArguments;
703 if ( ba ) {
704 *ba = saveArguments;
705 abiThisBlockArg = TBA;
706 }
707 stack.pop(EP, SP);
708 return block_result;
709 }
710#ifdef _MSC_VER
711#pragma warning(pop)
712#endif

Callers 15

testPipedDefaultsFunction · 0.50
new_job_invokeFunction · 0.50
new_thread_invokeFunction · 0.50
new_debugger_threadFunction · 0.50
ast_gc_guardFunction · 0.50
ast_gc_collect_scopeFunction · 0.50
tutorialFunction · 0.50
apply_transformFunction · 0.50
with_valuesFunction · 0.50

Calls 6

bottomMethod · 0.80
push_invokeMethod · 0.80
apMethod · 0.80
invokeMethod · 0.45
evalMethod · 0.45
popMethod · 0.45

Tested by 2

testPipedDefaultsFunction · 0.40