Changeset 28 in dev for BasicCompiler32
- Timestamp:
- Jan 8, 2007, 6:34:44 AM (18 years ago)
- Location:
- BasicCompiler32
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/BasicCompiler.vcproj
r26 r28 154 154 ObjectFile=".\Release/" 155 155 ProgramDataBaseFileName=".\Release/" 156 BrowseInformation=" 2"156 BrowseInformation="0" 157 157 BrowseInformationFile=".\Release/" 158 158 WarningLevel="3" -
BasicCompiler32/CParameter.cpp
r20 r28 215 215 SUBINFO *psi; 216 216 psi=0; 217 if(lstrcmp(name,"Abs")==0){ 218 MessageBeep(0); 219 } 217 220 for(i=0;i<num;i++){ 218 221 psi=ppsi[i]; … … 550 553 } 551 554 555 //戻り値用の変数名を取得 556 char *lpszVarNameToReturn; 557 if(FuncName[0]==1&&FuncName[1]==ESC_OPERATOR) lpszVarNameToReturn="_System_ReturnValue"; 558 else lpszVarNameToReturn=FuncName; 559 552 560 //パラメータをレジスタとスタックに格納 553 561 int CalcType; … … 567 575 } 568 576 if((i2==0||i2==1)&&ppi[i2].name){ 569 if(lstrcmp(ppi[i2].name, FuncName)==0){577 if(lstrcmp(ppi[i2].name,lpszVarNameToReturn)==0){ 570 578 //オブジェクトメンバの第一または第二パラメータの戻り値用オブジェクト 571 579 continue; -
BasicCompiler32/Compile_Calc.cpp
r11 r28 484 484 } 485 485 486 487 488 486 //////////////////////////////////////// 489 487 // 変数のタイプ型を識別して、演算を行う -
BasicCompiler32/Compile_CallProc.cpp
r27 r28 48 48 char ObjectName[VN_SIZE]; 49 49 int RefType; 50 GetObjectName(name,ObjectName,&RefType);50 SplitObjectName(name,ObjectName,&RefType); 51 51 52 52 … … 112 112 char ObjectName[VN_SIZE]; 113 113 int RefType; 114 GetObjectName(VarName,ObjectName,&RefType);114 SplitObjectName(VarName,ObjectName,&RefType); 115 115 116 116 //オーバーロード用の関数リストを作成 -
BasicCompiler32/Compile_Func.cpp
r11 r28 288 288 char ObjectName[VN_SIZE]; 289 289 int RefType; 290 GetObjectName(name,ObjectName,&RefType);290 SplitObjectName(name,ObjectName,&RefType); 291 291 292 292 if(ObjectName[0]){ -
BasicCompiler32/Compile_Object.cpp
r3 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); -
BasicCompiler32/Compile_ProcOp.cpp
r27 r28 554 554 //仮想関数テーブルを初期化 555 555 if(pobj_CompilingClass->vtbl_num&& 556 pobj_CompilingClass->Is HoldAbstractFunction()==0){557 //関数テーブルに値をセット558 offset=pobj_CompilingClass->GetVtblGlobalOffset();559 560 //mov eax,offset561 OpBuffer[obp++]=(char)0xB8;562 *((long *)(OpBuffer+obp))=offset;563 pobj_DataTableSchedule->add();564 obp+=sizeof(long);565 566 //Thisポインタをecxにコピー567 SetThisPtrToReg(REG_ECX);568 569 //mov dword ptr[ecx],eax570 OpBuffer[obp++]=(char)0x89;571 OpBuffer[obp++]=(char)0x01;556 pobj_CompilingClass->IsAbstract()==false){ 557 //関数テーブルに値をセット 558 offset=pobj_CompilingClass->GetVtblGlobalOffset(); 559 560 //mov eax,offset 561 OpBuffer[obp++]=(char)0xB8; 562 *((long *)(OpBuffer+obp))=offset; 563 pobj_DataTableSchedule->add(); 564 obp+=sizeof(long); 565 566 //Thisポインタをecxにコピー 567 SetThisPtrToReg(REG_ECX); 568 569 //mov dword ptr[ecx],eax 570 OpBuffer[obp++]=(char)0x89; 571 OpBuffer[obp++]=(char)0x01; 572 572 } 573 573 } -
BasicCompiler32/Compile_Set_Var.cpp
r3 r28 34 34 } 35 35 36 if(CalcType==DEF_OBJECT&&lpVarIndex==lpCalcIndex){ 37 //双方のオブジェクト型が完全に一致したとき 38 //※コピーを行う 39 40 int object_size; 41 object_size=GetSizeOfClass((CClass *)lpVarIndex); 42 43 //mov ecx,object_size 44 op_mov_RV(REG_ECX,object_size); 45 46 //pop esi 47 op_pop(REG_ESI); 48 49 //pop edi 50 op_pop(REG_EDI); 51 52 if(bUseHeap){ 53 //mov eax,esi 54 op_mov_RR(REG_EAX,REG_ESI); 55 } 56 57 //rep movs byte ptr[edi],byte ptr[esi] 58 op_rep_movs(sizeof(BYTE)); 59 60 if(bUseHeap){ 61 //push eax 62 op_push(REG_EAX); 63 64 //call free 65 extern SUBINFO *pSub_free; 66 op_call(pSub_free); 67 } 68 69 return; 70 } 71 else{ 72 SetError(1,NULL,cp); 73 } 36 37 if( CalcType == DEF_OBJECT ){ 38 CClass *pVarClass = (CClass *)lpVarIndex; 39 CClass *pCalcClass = (CClass *)lpCalcIndex; 40 41 42 if( pVarClass->IsEquals( pCalcClass ) //等しい 43 || pVarClass->IsSubClass( pCalcClass ) ){ //派生・継承関係 44 45 //双方のオブジェクト型が一致、または派生・継承関係にあるとき 46 //※コピーを行う 47 48 int object_size; 49 object_size=GetSizeOfClass((CClass *)lpVarIndex); 50 51 //mov ecx,object_size 52 op_mov_RV(REG_ECX,object_size); 53 54 //pop esi 55 op_pop(REG_ESI); 56 57 //pop edi 58 op_pop(REG_EDI); 59 60 if(bUseHeap){ 61 //mov eax,esi 62 op_mov_RR(REG_EAX,REG_ESI); 63 } 64 65 //rep movs byte ptr[edi],byte ptr[esi] 66 op_rep_movs(sizeof(BYTE)); 67 68 if(bUseHeap){ 69 //push eax 70 op_push(REG_EAX); 71 72 //call free 73 extern SUBINFO *pSub_free; 74 op_call(pSub_free); 75 } 76 77 return; 78 } 79 } 80 81 SetError(1,NULL,cp); 74 82 } 75 83 -
BasicCompiler32/Compile_Var.cpp
r27 r28 1254 1254 1255 1255 if(TypeInfo.type==DEF_OBJECT){ 1256 if(TypeInfo.u.pobj_Class->Is HoldAbstractFunction()){1256 if(TypeInfo.u.pobj_Class->IsAbstract()){ 1257 1257 //抽象クラスだったとき 1258 1258 SetError(125,TypeInfo.u.pobj_Class->name,cp);
Note:
See TracChangeset
for help on using the changeset viewer.