Changeset 51 in dev for BasicCompiler32/Compile_ProcOp.cpp
- Timestamp:
- Feb 10, 2007, 8:30:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_ProcOp.cpp
r50 r51 219 219 extern SUBINFO **ppSubHash; 220 220 extern BOOL bDebugCompile; 221 int i3,i4, i5,VarSize,LocalVarSchedule,EspOffsetSchedule,BufferSize,BaseOffset;221 int i3,i4,VarSize,LocalVarSchedule,EspOffsetSchedule,BufferSize,BaseOffset; 222 222 char temporary[VN_SIZE]; 223 223 … … 379 379 if(psi->ReturnType==DEF_OBJECT && psi->isReturnRef == false){ 380 380 //戻り値用オブジェクトのコンストラクタを呼び出す 381 if( psi->u.Return_pobj_c->ConstructorMemberSubIndex!=-1){381 if( psi->u.Return_pobj_c->GetConstructorMethod() ){ 382 382 sprintf(temporary,"%s.%s()",temp,psi->u.Return_pobj_c->name); 383 383 OpcodeOthers(temporary); … … 462 462 BOOL bThisIsSuperClass; 463 463 if(pobj_CompilingClass->pobj_InheritsClass==0) bThisIsSuperClass=1; 464 else if( pobj_CompilingClass->pobj_InheritsClass->ConstructorMemberSubIndex==-1){464 else if( pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod() == NULL ){ 465 465 //インターフェイスを継承したときはコンストラクタを持たない 466 466 bThisIsSuperClass=1; … … 497 497 RemoveStringPare(temporary); 498 498 499 i3=pobj_CompilingClass->pobj_InheritsClass->ConstructorMemberSubIndex;500 499 Opcode_CallProc(temporary, 501 pobj_CompilingClass->p pobj_Method[i3]->psi,500 pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->psi, 502 501 0, 503 502 "", … … 506 505 else{ 507 506 //基底クラスのコンストラクタを暗黙的に呼び出す 508 i3=pobj_CompilingClass->pobj_InheritsClass->ConstructorMemberSubIndex;509 507 Opcode_CallProc("", 510 pobj_CompilingClass->p pobj_Method[i3]->psi,508 pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->psi, 511 509 0, 512 510 "", … … 524 522 for(i3=0;i3<pobj_CompilingClass->iMemberNum;i3++){ 525 523 CMember *pMember = pobj_CompilingClass->ppobj_Member[i3]; 524 MemberTypeSize= 525 GetTypeSize(pMember->TypeInfo.type, 526 pMember->TypeInfo.u.lpIndex); 527 528 MemberObjectNum= 529 JumpSubScripts(pMember->SubScripts); 526 530 527 531 offset=GetSizeOfClassMember(pobj_CompilingClass,pMember->name,NULL); 528 532 529 if(pMember->TypeInfo.type==DEF_OBJECT){ 530 if(pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex!=-1){ 531 i5=pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex; 532 if(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi->RealParmNum==1){ //Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる 533 534 MemberTypeSize= 535 GetTypeSize(pMember->TypeInfo.type, 536 pMember->TypeInfo.u.lpIndex); 537 538 MemberObjectNum= 539 JumpSubScripts(pMember->SubScripts); 540 533 if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){ 534 CMethod *method = pMember->TypeInfo.u.pobj_Class->GetConstructorMethod(); 535 if( method ){ 536 if( method->psi->RealParmNum == 1 ){ //Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる 541 537 for(i4=0;i4<MemberObjectNum;i4++){ 542 538 //Thisポインタをecxにコピー … … 553 549 554 550 //call constructor 555 op_call( pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi);551 op_call( method->psi ); 556 552 } 557 553 } … … 618 614 基底クラスのデストラクタを呼び出す */ 619 615 620 i3=pobj_CompilingClass->pobj_InheritsClass->DestructorMemberSubIndex;621 if( i3!=-1){616 CMethod *method = pobj_CompilingClass->pobj_InheritsClass->GetDestructorMethod(); 617 if( method ){ 622 618 Opcode_CallProc("", 623 pobj_CompilingClass->ppobj_Method[i3]->psi,619 method->psi, 624 620 0, 625 621 "", … … 647 643 648 644 if(pMember->TypeInfo.type==DEF_OBJECT){ 649 if(pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex!=-1){ 645 CMethod *method = pMember->TypeInfo.u.pobj_Class->GetDestructorMethod(); 646 if( method ){ 650 647 for(i4=MemberObjectNum-1;i4>=0;i4--){ 651 648 //Thisポインタをecxにコピー … … 662 659 663 660 //call destructor 664 i5=pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex; 665 op_call(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi); 661 op_call( method->psi ); 666 662 } 667 663 }
Note:
See TracChangeset
for help on using the changeset viewer.