Changeset 290 in dev for trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp
- Timestamp:
- Aug 21, 2007, 11:00:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp
r285 r290 267 267 268 268 //コンパイル中の関数が属するクラス 269 compiler.pCompilingClass =pUserProc->GetParentClassPtr();269 compiler.pCompilingClass = pUserProc->GetParentClassPtr(); 270 270 271 271 //コンパイルスタートをクラス管理クラスに追加 … … 495 495 &compiler.pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc(), 496 496 0, 497 "" ,498 0);497 "" 498 ); 499 499 } 500 500 } … … 587 587 &method->GetUserProc(), 588 588 0, 589 "" ,590 0);589 "" 590 ); 591 591 } 592 592 } … … 629 629 GetVarOffsetReadWrite(temp,&RelativeVar,Type()); 630 630 631 i3=pUserProc->ReturnType().GetBasicType();632 633 if(i3==DEF_OBJECT || i3==DEF_STRUCT){631 const Type &returnType = pUserProc->ReturnType(); 632 if( returnType.IsObject() || returnType.IsStruct() ) 633 { 634 634 SetVarPtrToEax(&RelativeVar); 635 if( i3==DEF_OBJECT ){ 635 if( returnType.IsObject() ) 636 { 636 637 //mov eax,dword ptr[eax] 637 638 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE ); 638 639 } 639 640 } 640 else if( i3==DEF_DOUBLE 641 || i3 == DEF_SINGLE ) 641 else if( returnType.IsReal() ) 642 642 { 643 643 //fld qword ptr[ebp+offset] 644 644 compiler.codeGenerator.localVarPertialSchedules.push_back( 645 compiler.codeGenerator.op_fld_base_offset( i3, REG_EBP, RelativeVar.offset, Schedule::None, true )645 compiler.codeGenerator.op_fld_base_offset( returnType.GetBasicType(), REG_EBP, RelativeVar.offset, Schedule::None, true ) 646 646 ); 647 647 } 648 else if(i3==DEF_INT64||i3==DEF_QWORD){ 649 //mov eax,dword ptr[ebp+offset] 650 compiler.codeGenerator.localVarPertialSchedules.push_back( 651 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EBP, RelativeVar.offset, MOD_BASE_DISP32, Schedule::None, true ) 652 ); 653 654 //mov edx,dword ptr[ebp+offset+sizeof(long)] 655 compiler.codeGenerator.localVarPertialSchedules.push_back( 656 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EBP, RelativeVar.offset+sizeof(long), MOD_BASE_DISP32, Schedule::None, true ) 657 ); 658 } 659 else if(i3==DEF_LONG||i3==DEF_DWORD|| 660 IsPtrType(i3)) 648 else if( returnType.Is64() ) 661 649 { 662 650 //mov eax,dword ptr[ebp+offset] … … 664 652 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EBP, RelativeVar.offset, MOD_BASE_DISP32, Schedule::None, true ) 665 653 ); 666 } 667 else if(i3==DEF_INTEGER||i3==DEF_WORD || (Smoothie::IsUnicode()&&i3==DEF_CHAR)){ 654 655 //mov edx,dword ptr[ebp+offset+sizeof(long)] 656 compiler.codeGenerator.localVarPertialSchedules.push_back( 657 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EBP, RelativeVar.offset+sizeof(long), MOD_BASE_DISP32, Schedule::None, true ) 658 ); 659 } 660 else if( returnType.GetSize() == sizeof(long) ) 661 { 662 //mov eax,dword ptr[ebp+offset] 663 compiler.codeGenerator.localVarPertialSchedules.push_back( 664 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EBP, RelativeVar.offset, MOD_BASE_DISP32, Schedule::None, true ) 665 ); 666 } 667 else if( returnType.GetSize() == sizeof(short) ) 668 { 668 669 //xor eax,eax(eaxを0に初期化する) 669 670 compiler.codeGenerator.op_zero_reg(REG_EAX); … … 674 675 ); 675 676 } 676 else if(i3==DEF_SBYTE||i3==DEF_BYTE||i3==DEF_BOOLEAN || (Smoothie::IsUnicode()==false&&i3==DEF_CHAR)){ 677 else if( returnType.GetSize() == sizeof(char) ) 678 { 677 679 //xor eax,eax(eaxを0に初期化する) 678 680 compiler.codeGenerator.op_zero_reg(REG_EAX); … … 682 684 compiler.codeGenerator.op_mov_RM( sizeof(char), REG_EAX, REG_EBP, RelativeVar.offset, MOD_BASE_DISP32, Schedule::None, true ) 683 685 ); 686 } 687 else 688 { 689 SetError(); 684 690 } 685 691 }
Note:
See TracChangeset
for help on using the changeset viewer.