Changeset 67 in dev
- Timestamp:
- Mar 11, 2007, 3:25:42 AM (18 years ago)
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/BasicCompiler.vcproj
r56 r67 1927 1927 <File 1928 1928 RelativePath="..\BasicCompiler_Common\BasicCompiler.h" 1929 > 1930 </File> 1931 <File 1932 RelativePath="..\BasicCompiler_Common\BasicFixed.h" 1929 1933 > 1930 1934 </File> -
BasicCompiler32/CParameter.cpp
r66 r67 135 135 136 136 //push object_size 137 op_push_ value(object_size);137 op_push_V(object_size); 138 138 139 139 //call calloc -
BasicCompiler32/Compile_Calc.cpp
r66 r67 31 31 32 32 //push 0 33 op_push_ value(0);33 op_push_V(0); 34 34 35 35 //push eax … … 116 116 117 117 //push 0 118 op_push_ value(0);118 op_push_V(0); 119 119 120 120 //push eax … … 260 260 261 261 //push 0 262 op_push_ value(0);262 op_push_V(0); 263 263 264 264 //push eax -
BasicCompiler32/Compile_CallProc.cpp
r64 r67 256 256 257 257 //push object_size 258 op_push_ value(object_size);258 op_push_V(object_size); 259 259 260 260 //call calloc -
BasicCompiler32/Compile_Set_Var.cpp
r66 r67 610 610 611 611 //push 0 612 op_push_ value(0);612 op_push_V(0); 613 613 614 614 //push eax -
BasicCompiler32/Compile_Statement.cpp
r64 r67 146 146 147 147 //push 0 148 op_push_ value(0);148 op_push_V(0); 149 149 150 150 //fild dword ptr[esp] … … 180 180 181 181 //push 0 182 op_push_ value(0);182 op_push_V(0); 183 183 184 184 //fild dword ptr[esp] … … 400 400 401 401 //push 0 402 op_push_ value(0);402 op_push_V(0); 403 403 404 404 //fild dword ptr[esp] … … 434 434 435 435 //push 0 436 op_push_ value(0);436 op_push_V(0); 437 437 438 438 //fild dword ptr[esp] … … 731 731 732 732 //push 0 733 op_push_ value(0);733 op_push_V(0); 734 734 735 735 //fild dword ptr[esp] … … 772 772 773 773 //push 0 774 op_push_ value(0);774 op_push_V(0); 775 775 776 776 //fild dword ptr[esp] -
BasicCompiler32/Compile_Var.cpp
r65 r67 107 107 108 108 //push 0 109 op_push_ value(0);109 op_push_V(0); 110 110 111 111 for(i=i3-1;i>=0;i--){ … … 1192 1192 else{ 1193 1193 //push 0 1194 op_push_ value(0);1194 op_push_V(0); 1195 1195 1196 1196 //push VarSize 1197 op_push_ value(VarSize);1197 op_push_V(VarSize); 1198 1198 1199 1199 //mov eax,ebp -
BasicCompiler32/MakePeHdr.cpp
r64 r67 155 155 ProcPtrInfoNum=0; 156 156 157 //クラス名を取得(詳細情報はGet ObjectClassInfoで取得)157 //クラス名を取得(詳細情報はGetAllClassInfoで取得) 158 158 // GetSubInfo関数の中で参照されるオブジェクト名を事前に取得する。 159 159 // ※オブジェクトの内容までは取得しない … … 169 169 170 170 //クラス情報を取得(※注 - GetSubInfoの後に呼び出す) 171 pobj_DBClass->Get ObjectClassInfo();171 pobj_DBClass->GetAllClassInfo(); 172 172 173 173 //コードと行番号の関係 -
BasicCompiler32/NumOpe.cpp
r64 r67 359 359 360 360 361 // Nothing 362 if( lstrcmp( term, "Nothing" ) == 0 ){ 363 type[sp] = DEF_OBJECT; 364 if( BaseType == DEF_OBJECT ){ 365 index_stack[sp] = lpBaseIndex; 366 } 367 else{ 368 index_stack[sp] = (LONG_PTR)pobj_DBClass->GetObjectClass(); 369 } 370 371 bLiteralCalculation = 0; 372 373 //push 0 374 op_push_V( 0 ); 375 376 sp++; 377 break; 378 } 379 380 361 381 362 382 RELATIVE_VAR RelativeVar; … … 521 541 522 542 //push HILONG(dbl) 523 op_push_ value((long)*(long *)(((char *)(&i64data))+4));543 op_push_V((long)*(long *)(((char *)(&i64data))+4)); 524 544 525 545 //push LOLONG(dbl) 526 op_push_ value(*(long *)(&i64data));546 op_push_V(*(long *)(&i64data)); 527 547 } 528 548 else if(type[sp]==DEF_SINGLE){ … … 535 555 536 556 //push term 537 op_push_ value(i3);557 op_push_V(i3); 538 558 } 539 559 else{ … … 541 561 542 562 //push term 543 op_push_ value((long)i64data);563 op_push_V((long)i64data); 544 564 545 565 if((long)i64data==0) index_stack[sp]=LITERAL_NULL; … … 693 713 694 714 //push HILONG(i64data) 695 op_push_ value((long)*(long *)(((char *)(&i64data))+4));715 op_push_V((long)*(long *)(((char *)(&i64data))+4)); 696 716 697 717 //push LOLONG(i64data) 698 op_push_ value(*(long *)(&i64data));718 op_push_V(*(long *)(&i64data)); 699 719 } 700 720 else if(i2==DEF_SINGLE){ … … 708 728 709 729 //push flt 710 op_push_ value(i3);730 op_push_V(i3); 711 731 } 712 732 else{ … … 719 739 720 740 //push term 721 op_push_ value(i3);741 op_push_V(i3); 722 742 } 723 743 -
BasicCompiler32/NumOpe_Arithmetic.cpp
r66 r67 605 605 606 606 //push 0 607 op_push_ value(0);607 op_push_V(0); 608 608 609 609 //push eax … … 645 645 646 646 //push 0 647 op_push_ value(0);647 op_push_V(0); 648 648 649 649 //push eax … … 834 834 835 835 //push -1 836 op_push_ value(-1);836 op_push_V(-1); 837 837 838 838 //fild dword ptr[esp] … … 856 856 857 857 //push -1 858 op_push_ value(-1);858 op_push_V(-1); 859 859 860 860 //fild dword ptr[esp] -
BasicCompiler32/NumOpe_TypeOperation.cpp
r66 r67 32 32 33 33 //push 0 34 op_push_ value(0);34 op_push_V(0); 35 35 36 36 //push eax -
BasicCompiler32/Opcode.h
r66 r67 319 319 320 320 void op_push(int reg); 321 void op_push_ value(long data);321 void op_push_V(long data); 322 322 void op_pop(int reg); 323 323 void op_add_esp(int num); -
BasicCompiler32/OperatorProc.cpp
r64 r67 125 125 126 126 //push object_size 127 op_push_ value(object_size);127 op_push_V(object_size); 128 128 129 129 //call calloc -
BasicCompiler32/op32_main.cpp
r66 r67 519 519 __op_format(0,(char)0x50,reg); 520 520 } 521 void op_push_ value(long data){521 void op_push_V(long data){ 522 522 //スタックにリテラル値をプッシュ 523 523 if(-128<=data&&data<=127){ -
BasicCompiler64/MakePeHdr.cpp
r64 r67 141 141 ProcPtrInfoNum=0; 142 142 143 //クラス名を取得(詳細情報はGet ObjectClassInfoで取得)143 //クラス名を取得(詳細情報はGetAllClassInfoで取得) 144 144 // GetSubInfo関数の中で参照されるオブジェクト名を事前に取得する。 145 145 // ※オブジェクトの内容までは取得しない … … 155 155 156 156 //クラス情報を取得(※注 - GetSubInfoの後に呼び出す) 157 pobj_DBClass->Get ObjectClassInfo();157 pobj_DBClass->GetAllClassInfo(); 158 158 159 159 //コードと行番号の関係 -
BasicCompiler64/NumOpe.cpp
r64 r67 402 402 403 403 404 // Nothing 405 if( lstrcmp( term, "Nothing" ) == 0 ){ 406 type[sp] = DEF_OBJECT; 407 if( BaseType == DEF_OBJECT ){ 408 index_stack[sp] = lpBaseIndex; 409 } 410 else{ 411 index_stack[sp] = (LONG_PTR)pobj_DBClass->GetObjectClass(); 412 } 413 414 bLiteralCalculation = 0; 415 416 //xor reg,reg 417 op_zero_reg( UseReg ); 418 419 if(UseReg==REG_R14){ 420 //mov qword ptr[rsp+offset],r14 ※スタックフレームを利用 421 pobj_sf->push(REG_R14); 422 } 423 424 pobj_reg->LockReg(); 425 sp++; 426 break; 427 } 428 429 404 430 RELATIVE_VAR RelativeVar; 405 431 if(GetVarOffset( -
BasicCompiler_Common/Class.cpp
r64 r67 118 118 pobj_c=pobj_DBClass->Iterator_GetNext(); 119 119 120 int i=0; 120 121 foreach( CMember *member, pobj_c->staticMembers ){ 121 122 char temporary[VN_SIZE]; … … 137 138 OpBuffer=(char *)HeapReAlloc(hHeap,0,OpBuffer,obp_AllocSize); //matea 138 139 } 140 i++; 139 141 } 140 142 } … … 671 673 } 672 674 673 CDBClass::CDBClass(){ 674 memset(this,0,sizeof(CDBClass)); 675 CDBClass::CDBClass(): 676 pStringClass( NULL ), 677 pObjectClass( NULL ), 678 pCompilingClass( NULL ), 679 pCompilingMethod( NULL ), 680 ppobj_IteClass( NULL ), 681 iIteMaxNum( 0 ), 682 iIteNextNum( 0 ) 683 { 684 memset( pobj_ClassHash, 0, MAX_CLASS_HASH * sizeof(CClass *) ); 675 685 } 676 686 CDBClass::~CDBClass(){ … … 731 741 //Stringクラス 732 742 pobj_StringClass=pobj_c; 743 } 744 if( lstrcmp( name, "Object" ) == 0 ){ 745 pObjectClass = pobj_c; 733 746 } 734 747 … … 1421 1434 } 1422 1435 1423 void CDBClass::Get ObjectClassInfo(void){1436 void CDBClass::GetAllClassInfo(void){ 1424 1437 //ループ継承チェック用のクラス 1425 1438 pobj_LoopRefCheck=new CLoopRefCheck(); … … 1430 1443 delete pobj_LoopRefCheck; 1431 1444 pobj_LoopRefCheck=0; 1445 } 1446 1447 CClass *CDBClass::GetStringClass() const 1448 { 1449 if( !pStringClass ){ 1450 SetError(); 1451 return NULL; 1452 } 1453 return pStringClass; 1454 } 1455 CClass *CDBClass::GetObjectClass() const 1456 { 1457 if( !pObjectClass ){ 1458 SetError(); 1459 return NULL; 1460 } 1461 return pObjectClass; 1432 1462 } 1433 1463 -
BasicCompiler_Common/Class.h
r64 r67 229 229 void InitNames(void); 230 230 void GetClass_recur(const char *lpszInheritsClass); 231 void GetObjectClassInfo(void); 231 void GetAllClassInfo(void); 232 233 234 ///////////////////////////// 235 // 特殊クラス 236 ///////////////////////////// 237 CClass *pStringClass; 238 CClass *pObjectClass; 239 CClass *GetStringClass() const; 240 CClass *GetObjectClass() const; 232 241 233 242 -
BasicCompiler_Common/Intermediate_Step1.cpp
r64 r67 872 872 case 'n': 873 873 case 'N': 874 if(lstrcmpi(temporary+i3,"Not")==0){ 874 if(lstrcmpi(temporary+i3,"New")==0){ 875 i2=i3; 876 temporary[i2++]=1; 877 temporary[i2]=ESC_NEW; 878 } 879 else if(lstrcmpi(temporary+i3,"Not")==0){ 875 880 i2=i3; 876 881 temporary[i2++]=1; 877 882 temporary[i2]=ESC_NOT; 878 }879 else if(lstrcmpi(temporary+i3,"New")==0){880 i2=i3;881 temporary[i2++]=1;882 temporary[i2]=ESC_NEW;883 883 } 884 884 break; -
BasicCompiler_Common/NumOpe_GetType.cpp
r64 r67 492 492 493 493 494 // Nothing 495 if( lstrcmp( term, "Nothing" ) == 0 ){ 496 type[sp] = DEF_OBJECT; 497 if( pBaseType && pBaseType->type == DEF_OBJECT ){ 498 index_stack[sp] = pBaseType->u.lpIndex; 499 } 500 else{ 501 index_stack[sp] = (LONG_PTR)pobj_DBClass->GetObjectClass(); 502 } 503 bLiteralCalculation = 0; 504 sp++; 505 break; 506 } 507 508 494 509 i2=GetVarType(term,&index_stack[sp],0); 495 510 if(i2!=-1){ -
BasicCompiler_Common/Variable.cpp
r64 r67 1029 1029 if(pTypeInfo->type==-1){ 1030 1030 SetError(3,temporary,cp); 1031 return 0;1031 pTypeInfo->type=DEF_LONG; 1032 1032 } 1033 1033 -
BasicCompiler_Common/preprocessor.cpp
r55 r67 142 142 CDefine *pobj_define; 143 143 144 int Search_endif(char *buffer,int i ){144 int Search_endif(char *buffer,int i, int *pLine = 0){ 145 145 for(;;i++){ 146 146 if(buffer[i]=='\0') break; 147 147 148 if( buffer[i] == '\n' ){ 149 if( pLine ){ 150 (*pLine)++; 151 } 152 } 153 148 154 if(buffer[i-1]=='\n'){ 149 155 if(_memicmp(buffer+i,"#ifdef",6)==0||_memicmp(buffer+i,"#ifndef",7)==0){ 150 i=Search_endif(buffer,i+6 );156 i=Search_endif(buffer,i+6, pLine); 151 157 if(buffer[i]=='\0') break; 152 158 continue; … … 229 235 if(i2==0||buffer[i2-1]=='\n'){ 230 236 if(_memicmp(buffer+i2,"#ifdef",6)==0||_memicmp(buffer+i2,"#ifndef",7)==0){ 231 i2=Search_endif(buffer,i2+6 );237 i2=Search_endif(buffer,i2+6, &i3 ); 232 238 if(buffer[i2]=='\0') break; 233 239 continue; … … 256 262 if(i2==0||buffer[i2-1]=='\n'){ 257 263 if(_memicmp(buffer+i2,"#ifdef",6)==0||_memicmp(buffer+i2,"#ifndef",7)==0){ 258 i2=Search_endif(buffer,i2+6 );264 i2=Search_endif(buffer,i2+6, &i3 ); 259 265 if(buffer[i2]=='\0') break; 260 266 continue;
Note:
See TracChangeset
for help on using the changeset viewer.