Changeset 28 in dev for BasicCompiler64
- Timestamp:
- Jan 8, 2007, 6:34:44 AM (18 years ago)
- Location:
- BasicCompiler64
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/CParameter.cpp
r20 r28 546 546 } 547 547 548 //戻り値用の変数名を取得 549 char *lpszVarNameToReturn; 550 if(FuncName[0]==1&&FuncName[1]==ESC_OPERATOR) lpszVarNameToReturn="_System_ReturnValue"; 551 else lpszVarNameToReturn=FuncName; 552 548 553 //パラメータをレジスタとスタックに格納 549 554 int CalcType; … … 563 568 } 564 569 if((i2==0||i2==1)&&ppi[i2].name){ 565 if(lstrcmp(ppi[i2].name, FuncName)==0){570 if(lstrcmp(ppi[i2].name,lpszVarNameToReturn)==0){ 566 571 //オブジェクトメンバの第一または第二パラメータの戻り値用オブジェクト 567 572 continue; -
BasicCompiler64/Compile_CallProc.cpp
r27 r28 49 49 char ObjectName[VN_SIZE]; 50 50 int RefType; 51 GetObjectName(name,ObjectName,&RefType);51 SplitObjectName(name,ObjectName,&RefType); 52 52 53 53 … … 113 113 char ObjectName[VN_SIZE]; 114 114 int RefType; 115 GetObjectName(VarName,ObjectName,&RefType);115 SplitObjectName(VarName,ObjectName,&RefType); 116 116 117 117 //オーバーロード用の関数リストを作成 -
BasicCompiler64/Compile_Func.cpp
r11 r28 140 140 char ObjectName[VN_SIZE]; 141 141 int RefType; 142 GetObjectName(name,ObjectName,&RefType);142 SplitObjectName(name,ObjectName,&RefType); 143 143 144 144 if(ObjectName[0]){ -
BasicCompiler64/Compile_Object.cpp
r15 r28 131 131 pobj_c=(CClass *)*plpIndex; 132 132 133 if(pobj_c->Is HoldAbstractFunction()){133 if(pobj_c->IsAbstract()){ 134 134 //抽象クラスだったとき 135 135 SetError(125,pobj_c->name,cp); -
BasicCompiler64/Compile_ProcOp.cpp
r27 r28 600 600 //仮想関数テーブルを初期化 601 601 if(pobj_CompilingClass->vtbl_num&& 602 pobj_CompilingClass->Is HoldAbstractFunction()==0){603 //関数テーブルに値をセット604 offset=(int)pobj_CompilingClass->GetVtblGlobalOffset();605 606 //mov rax,offset607 op_mov_RV(sizeof(_int64),REG_RAX,offset);608 obp-=sizeof(long);609 pobj_DataTableSchedule->add();610 obp+=sizeof(long);611 612 //Thisポインタをrcxにコピー613 SetThisPtrToReg(REG_RCX);614 615 //mov qword ptr[rcx],rax616 op_mov_MR(sizeof(_int64),REG_RAX,REG_RCX,0,MOD_BASE);602 pobj_CompilingClass->IsAbstract()==false){ 603 //関数テーブルに値をセット 604 offset=(int)pobj_CompilingClass->GetVtblGlobalOffset(); 605 606 //mov rax,offset 607 op_mov_RV(sizeof(_int64),REG_RAX,offset); 608 obp-=sizeof(long); 609 pobj_DataTableSchedule->add(); 610 obp+=sizeof(long); 611 612 //Thisポインタをrcxにコピー 613 SetThisPtrToReg(REG_RCX); 614 615 //mov qword ptr[rcx],rax 616 op_mov_MR(sizeof(_int64),REG_RAX,REG_RCX,0,MOD_BASE); 617 617 } 618 618 } -
BasicCompiler64/Compile_Set_Var.cpp
r27 r28 77 77 78 78 79 //TODO: 継承・派生関係にある場合は許容する 80 if(CalcType==DEF_OBJECT&&lpVarIndex==lpCalcIndex){ 81 //双方のオブジェクト型が完全に一致したとき 82 //※コピーを行う 83 84 //mov rsi,RightTermReg 85 op_mov_RR(REG_RSI,RightTermReg); 86 87 //mov rdi,VarReg 88 op_mov_RR(REG_RDI,VarReg); 89 90 int object_size; 91 object_size=GetSizeOfClass((CClass *)lpVarIndex); 92 93 //mov rcx,object_size 94 op_mov_RV(sizeof(_int64),REG_RCX,object_size); 95 96 if(bUseHeap){ 97 //mov rax,rsi 98 op_mov_RR(REG_RAX,REG_RSI); 99 } 100 101 //rep movs byte ptr[rdi],byte ptr[rsi] 102 op_rep_movs(sizeof(BYTE)); 103 104 if(bUseHeap){ 105 //mov rcx,rax 106 op_mov_RR(REG_RCX,REG_RAX); 107 108 //call free 109 extern SUBINFO *pSub_free; 110 op_call(pSub_free); 111 } 112 113 return; 114 } 115 else{ 116 SetError(1,NULL,cp); 117 } 79 if( CalcType == DEF_OBJECT ){ 80 CClass *pVarClass = (CClass *)lpVarIndex; 81 CClass *pCalcClass = (CClass *)lpCalcIndex; 82 83 if( pVarClass->IsEquals( pCalcClass ) //等しい 84 || pVarClass->IsSubClass( pCalcClass ) ){ //派生・継承関係 85 86 //双方のオブジェクト型が一致、または派生・継承関係にあるとき 87 //※コピーを行う 88 89 //mov rsi,RightTermReg 90 op_mov_RR(REG_RSI,RightTermReg); 91 92 //mov rdi,VarReg 93 op_mov_RR(REG_RDI,VarReg); 94 95 int object_size = GetSizeOfClass((CClass *)lpVarIndex); 96 97 //mov rcx,object_size 98 op_mov_RV(sizeof(_int64),REG_RCX,object_size); 99 100 if(bUseHeap){ 101 //mov rax,rsi 102 op_mov_RR(REG_RAX,REG_RSI); 103 } 104 105 //rep movs byte ptr[rdi],byte ptr[rsi] 106 op_rep_movs(sizeof(BYTE)); 107 108 if(bUseHeap){ 109 //mov rcx,rax 110 op_mov_RR(REG_RCX,REG_RAX); 111 112 //call free 113 extern SUBINFO *pSub_free; 114 op_call(pSub_free); 115 } 116 117 return; 118 } 119 } 120 121 SetError(1,NULL,cp); 118 122 } 119 123 -
BasicCompiler64/Compile_Var.cpp
r27 r28 1229 1229 1230 1230 if(TypeInfo.type==DEF_OBJECT){ 1231 if(TypeInfo.u.pobj_Class->Is HoldAbstractFunction()){1231 if(TypeInfo.u.pobj_Class->IsAbstract()){ 1232 1232 //抽象クラスだったとき 1233 1233 SetError(125,TypeInfo.u.pobj_Class->name,cp);
Note:
See TracChangeset
for help on using the changeset viewer.