| 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 |