void CfrTil_BeginCombinator ( int32 quotesUsed ) { Compiler * compiler = _Context_->Compiler0 ; BlockInfo *bi = ( BlockInfo * ) _Stack_Pick ( compiler->CombinatorBlockInfoStack, quotesUsed - 1 ) ; // -1 : remember - stack is zero based ; stack[0] is top // optimize out jmps such that the jmp from first block is to Here the start of the combinator code bi->CombinatorStartsAt = Here ; _SetOffsetForCallOrJump ( bi->JumpOffset, bi->CombinatorStartsAt, 1 ) ; }
void _CfrTil_EndBlock1 ( BlockInfo * bi ) { Compiler * compiler = _Context_->Compiler0 ; if ( _Stack_IsEmpty ( compiler->BlockStack ) ) { _CfrTil_InstallGotoCallPoints_Keyed ( bi, GI_RETURN ) ; if ( compiler->NumberOfRegisterVariables && ( compiler->NumberOfStackVariables == 1 ) && Compiler_GetState ( compiler, ( RETURN_TOS | RETURN_EAX ) ) ) { bi->bp_First = bi->Start ; if ( Compiler_GetState ( compiler, RETURN_EAX ) ) { Compile_Move_EAX_To_TOS ( DSP ) ; } } else if ( _Compiler_IsFrameNecessary ( compiler ) && ( ! GetState ( compiler, DONT_REMOVE_STACK_VARIABLES ) ) ) { if ( Compiler_GetState ( compiler, SAVE_ESP ) ) // SAVE_ESP is set by 'return' { _ESP_Setup ( ) ; bi->bp_First = bi->FrameStart ; } else bi->bp_First = bi->AfterEspSave ; // 3 : after ESP_Save code in frame setup code _Compiler_RemoveLocalFrame ( compiler ) ; } else { bi->bp_First = bi->Start ; } } _Compile_Return ( ) ; _DataStack_Push ( ( int32 ) bi->bp_First ) ; bi->bp_Last = Here ; _SetOffsetForCallOrJump ( bi->JumpOffset, Here, 0 ) ; }
void _GotoInfo_SetAndDelete ( GotoInfo * gotoInfo, byte * address ) { _SetOffsetForCallOrJump ( gotoInfo->pb_JmpOffsetPointer, address, 0 ) ; GotoInfo_Delete ( ( dlnode* ) gotoInfo ) ; }