Changeset 56 in dev
- Timestamp:
- Feb 15, 2007, 3:39:40 AM (18 years ago)
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/BasicCompiler.vcproj
r50 r56 147 147 Optimization="2" 148 148 InlineFunctionExpansion="1" 149 AdditionalIncludeDirectories="..\cpplibs\boost" 149 150 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN" 150 151 StringPooling="true" … … 244 245 Optimization="2" 245 246 InlineFunctionExpansion="1" 247 AdditionalIncludeDirectories="..\cpplibs\boost" 246 248 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;ENG" 247 249 StringPooling="true" … … 828 830 Name="Parts" 829 831 > 832 <File 833 RelativePath="..\BasicCompiler_Common\DataTable.cpp" 834 > 835 </File> 830 836 <File 831 837 RelativePath="..\BasicCompiler_Common\LoopRefCheck.cpp" -
BasicCompiler32/Compile_Var.cpp
r55 r56 853 853 char *temp; 854 854 temp=(char *)i64data; 855 i2= AddDataTable(temp,lstrlen(temp));855 i2=dataTable.AddString(temp,lstrlen(temp)); 856 856 HeapDefaultFree(temp); 857 857 … … 1043 1043 char *temp; 1044 1044 temp=(char *)i64data; 1045 i2= AddDataTable(temp,lstrlen(temp));1045 i2=dataTable.AddString(temp,lstrlen(temp)); 1046 1046 HeapDefaultFree(temp); 1047 1047 -
BasicCompiler32/MakePeHdr.cpp
r51 r56 77 77 78 78 79 int AddDataTable(char *buffer,int length){80 extern HANDLE hHeap;81 extern char *DataTable;82 extern int DataTableSize;83 int RetNum;84 85 DataTable=(char *)HeapReAlloc(hHeap,0,DataTable,DataTableSize+length+1);86 memcpy(DataTable+DataTableSize,buffer,length);87 DataTable[DataTableSize+length]=0;88 89 RetNum=DataTableSize; //ImageBase+MemPos_DataSectionが後に足される90 91 DataTableSize+=length+1;92 93 return RetNum;94 }95 96 79 void DebugVariable(void){ 97 80 char temporary[255]; … … 136 119 ////////////////// 137 120 // データテーブル 138 extern char *DataTable; 139 extern int DataTableSize; 121 dataTable.Init(); 140 122 if(bDebugCompile){ 141 DataTable=(char *)HeapAlloc(hHeap,0,2); 142 DataTable[0]=2; 143 DataTable[1]=0; 144 DataTableSize=2; 145 } 146 else{ 147 DataTable=(char *)HeapAlloc(hHeap,0,1); 148 DataTableSize=0; 123 dataTable.Add( (long)0x00000002 ); 149 124 } 150 125 … … 828 803 829 804 //データセクションのファイル上のサイズ 830 if( DataTableSize%FILE_ALIGNMENT) FileSize_DataSection=DataTableSize+(FILE_ALIGNMENT-DataTableSize%FILE_ALIGNMENT);831 else FileSize_DataSection= DataTableSize;805 if(dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=dataTable.GetSize()+(FILE_ALIGNMENT-dataTable.GetSize()%FILE_ALIGNMENT); 806 else FileSize_DataSection=dataTable.GetSize(); 832 807 if(FileSize_DataSection) bUse_DataSection=1; 833 808 else bUse_DataSection=0; … … 1556 1531 if(bUse_DataSection){ 1557 1532 //データ テーブル 1558 WriteFile(hFile, DataTable,DataTableSize,(DWORD *)&i2,NULL);1533 WriteFile(hFile,dataTable.GetPtr(),dataTable.GetSize(),(DWORD *)&i2,NULL); 1559 1534 i+=i2; 1560 1535 } … … 1648 1623 HeapDefaultFree(pHintTable); 1649 1624 1650 //データテーブルに関する情報を解放1651 HeapDefaultFree(DataTable);1652 1653 1625 //グローバル変数の初期バッファを解放 1654 1626 HeapDefaultFree(initGlobalBuf); -
BasicCompiler32/NumOpe.cpp
r55 r56 99 99 } 100 100 101 int i2;102 i 2=AddDataTable(lpszText,lstrlen(lpszText));101 // TODO: Ex表記による文字列長に対応する 102 int i2 = dataTable.AddString( lpszText ); 103 103 104 104 //push lpszPtr … … 244 244 bLiteralCalculation=0; 245 245 246 i2= AddDataTable(term,i3);246 i2=dataTable.AddString(term,i3); 247 247 248 248 //push DataSize -
BasicCompiler32/Opcode.h
r50 r56 78 78 }; 79 79 80 81 //MakePeHdr.cpp82 int AddDataTable(char *buffer,int length);83 80 84 81 //RSrcSection.cpp -
BasicCompiler64/BasicCompiler.vcproj
r50 r56 152 152 Optimization="2" 153 153 InlineFunctionExpansion="1" 154 AdditionalIncludeDirectories="..\cpplibs\boost;..\cpplibs\Base" 154 155 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;_AMD64_;_WIN64" 155 156 StringPooling="true" … … 252 253 Optimization="2" 253 254 InlineFunctionExpansion="1" 255 AdditionalIncludeDirectories="..\cpplibs\boost;..\cpplibs\Base" 254 256 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;ENG" 255 257 StringPooling="true" … … 346 348 Name="VCCLCompilerTool" 347 349 Optimization="2" 350 AdditionalIncludeDirectories="..\cpplibs\boost;..\cpplibs\Base" 348 351 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;_AMD64_;_WIN64" 349 352 MinimalRebuild="false" … … 1403 1406 > 1404 1407 <File 1408 RelativePath="..\BasicCompiler_Common\DataTable.cpp" 1409 > 1410 </File> 1411 <File 1405 1412 RelativePath="..\BasicCompiler_Common\LoopRefCheck.cpp" 1406 1413 > -
BasicCompiler64/Compile_Statement.cpp
r52 r56 123 123 if(type==DEF_DOUBLE){ 124 124 double dbl=0; 125 offset= AddDataTable((char *)&dbl,sizeof(double));125 offset=dataTable.Add( dbl ); 126 126 127 127 //comisd xmm0,qword ptr[data table offset] … … 137 137 else if(type==DEF_SINGLE){ 138 138 float flt=0; 139 offset= AddDataTable((char *)&flt,sizeof(float));139 offset=dataTable.Add( flt ); 140 140 141 141 //comiss xmm0,dword ptr[data table offset] -
BasicCompiler64/Compile_Var.cpp
r55 r56 888 888 char *temp; 889 889 temp=(char *)i64data; 890 i2= AddDataTable(temp,lstrlen(temp));890 i2=dataTable.AddString( temp ); 891 891 HeapDefaultFree(temp); 892 892 … … 1037 1037 char *temp; 1038 1038 temp=(char *)i64data; 1039 i2= AddDataTable(temp,lstrlen(temp));1039 i2=dataTable.AddString( temp ); 1040 1040 HeapDefaultFree(temp); 1041 1041 -
BasicCompiler64/MakePeHdr.cpp
r51 r56 65 65 bUse_DebugSection; 66 66 67 int AddDataTable(char *buffer,int length){68 extern HANDLE hHeap;69 extern char *DataTable;70 extern int DataTableSize;71 int RetNum;72 73 DataTable=(char *)HeapReAlloc(hHeap,0,DataTable,DataTableSize+length+1);74 memcpy(DataTable+DataTableSize,buffer,length);75 DataTable[DataTableSize+length]=0;76 77 RetNum=DataTableSize; //ImageBase+MemPos_DataSectionが後に足される78 79 DataTableSize+=length+1;80 81 return RetNum;82 }83 84 67 85 68 void DebugVariable(void){ … … 124 107 ////////////////// 125 108 // データテーブル 126 extern char *DataTable; 127 extern int DataTableSize; 109 dataTable.Init(); 128 110 if(bDebugCompile){ 129 DataTable=(char *)HeapAlloc(hHeap,0,2); 130 DataTable[0]=2; 131 DataTable[1]=0; 132 DataTableSize=2; 133 } 134 else{ 135 DataTable=(char *)HeapAlloc(hHeap,0,1); 136 DataTableSize=0; 111 dataTable.Add( (long)0x00000002 ); 137 112 } 138 113 … … 841 816 842 817 //データセクションのファイル上のサイズ 843 if( DataTableSize%FILE_ALIGNMENT) FileSize_DataSection=DataTableSize+(FILE_ALIGNMENT-DataTableSize%FILE_ALIGNMENT);844 else FileSize_DataSection= DataTableSize;818 if(dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=dataTable.GetSize()+(FILE_ALIGNMENT-dataTable.GetSize()%FILE_ALIGNMENT); 819 else FileSize_DataSection=dataTable.GetSize(); 845 820 if(FileSize_DataSection) bUse_DataSection=1; 846 821 else bUse_DataSection=0; … … 1577 1552 if(bUse_DataSection){ 1578 1553 //データ テーブル 1579 WriteFile(hFile, DataTable,DataTableSize,(DWORD *)&i2,NULL);1554 WriteFile(hFile,dataTable.GetPtr(),dataTable.GetSize(),(DWORD *)&i2,NULL); 1580 1555 i+=i2; 1581 1556 } … … 1669 1644 HeapDefaultFree(pHintTable); 1670 1645 1671 //データテーブルに関する情報を解放1672 HeapDefaultFree(DataTable);1673 1674 1646 //グローバル変数の初期バッファを解放 1675 1647 HeapDefaultFree(initGlobalBuf); -
BasicCompiler64/NumOpe.cpp
r51 r56 37 37 op_call(pobj_StringClass->GetConstructorMethod()->psi); 38 38 39 int i2;40 i 2=AddDataTable(lpszText,lstrlen(lpszText));39 // TODO: Ex表記による文字列長に対応する 40 int i2 = dataTable.AddString( lpszText ); 41 41 42 42 //mov rax,i2 … … 269 269 bLiteralCalculation=0; 270 270 271 i2 =AddDataTable(term,i3);271 i2 = dataTable.AddString( term, i3 ); 272 272 273 273 //mov reg,i2 … … 622 622 } 623 623 else{ 624 i3 =AddDataTable((char *)&i64data,sizeof(_int64));624 i3 = dataTable.Add( i64data ); 625 625 626 626 //movlpd xmm_reg,qword ptr[data table offset] … … 650 650 } 651 651 else{ 652 i3= AddDataTable((char *)&i32data,sizeof(long));652 i3=dataTable.Add( i32data ); 653 653 654 654 //movss xmm_reg,dword ptr[data table offset] … … 789 789 790 790 if(i2==DEF_DOUBLE){ 791 i3 =AddDataTable((char *)&i64data,sizeof(_int64));791 i3 = dataTable.Add( i64data ); 792 792 793 793 //movlpd xmm_reg,qword ptr[data table offset] … … 809 809 memcpy(&i32data,&flt,sizeof(long)); 810 810 811 i3 =AddDataTable((char *)&i32data,sizeof(long));811 i3 = dataTable.Add( i32data ); 812 812 813 813 //movss xmm_reg,dword ptr[data table offset] -
BasicCompiler64/NumOpe_Arithmetic.cpp
r19 r56 452 452 double dbl; 453 453 dbl=-1; 454 i32data =AddDataTable((char *)&dbl,sizeof(double));454 i32data = dataTable.Add( dbl ); 455 455 456 456 //mulsd xmm_reg,qword ptr[data table offset] ※data = -1 … … 474 474 float flt; 475 475 flt=-1; 476 i32data =AddDataTable((char *)&flt,sizeof(float));476 i32data = dataTable.Add( flt ); 477 477 478 478 //mulss xmm_reg,dword ptr[data table offset] ※data = -1 -
BasicCompiler64/NumOpe_TypeOperation.cpp
r55 r56 85 85 int temp; 86 86 _int64 i64data=0x43f0000000000000; 87 temp= AddDataTable((char *)&i64data,sizeof(_int64));87 temp=dataTable.Add( i64data ); 88 88 OpBuffer[obp++]=(char)0xF2; 89 89 OpBuffer[obp++]=(char)0x0F; … … 144 144 int temp; 145 145 long i32data=0x5f800000; 146 temp= AddDataTable((char *)&i32data,sizeof(long));146 temp=dataTable.Add( i32data ); 147 147 OpBuffer[obp++]=(char)0xF3; 148 148 OpBuffer[obp++]=(char)0x0F; -
BasicCompiler64/Opcode.h
r50 r56 229 229 230 230 231 232 //MakePeHdr.cpp233 int AddDataTable(char *buffer,int length);234 231 235 232 //RSrcSection.cpp -
BasicCompiler_Common/Class.cpp
r53 r56 13 13 14 14 CMember *pCompilingMethod; 15 16 int AddDataTable(char *buffer,int length);17 15 18 16 … … 412 410 413 411 414 LONG_PTR CClass::AddVtblDataTable(SUBINFO **ppsi,int length){415 return AddDataTable((char *)ppsi,length);416 }417 412 int CClass::GetFuncNumInVtbl( const SUBINFO *psi ) const 418 413 { … … 454 449 } 455 450 456 vtbl_offset= AddDataTable((char*)ppsi,vtbl_num*sizeof(LONG_PTR));451 vtbl_offset=dataTable.AddBinary((void *)ppsi,vtbl_num*sizeof(LONG_PTR)); 457 452 458 453 for( int i=0; i < vtbl_num; i++ ){ … … 467 462 if(vtbl_offset==-1) return; 468 463 469 extern char *DataTable;470 464 LONG_PTR *pVtbl; 471 pVtbl=(LONG_PTR *)( DataTable+vtbl_offset);465 pVtbl=(LONG_PTR *)((char *)dataTable.GetPtr()+vtbl_offset); 472 466 473 467 int i; -
BasicCompiler_Common/Class.h
r53 r56 140 140 private: 141 141 long vtbl_offset; 142 LONG_PTR AddVtblDataTable(SUBINFO **ppsi,int length);143 142 public: 144 143 int GetFuncNumInVtbl( const SUBINFO *psi ) const; -
BasicCompiler_Common/Compile.cpp
r34 r56 30 30 GOTOLABELSCHEDULE *pGotoLabelSchedule; 31 31 int GotoLabelScheduleNum; 32 33 //データ テーブル34 char *DataTable;35 int DataTableSize;36 32 37 33 //グローバル変数初期バッファ -
BasicCompiler_Common/common.h
r55 r56 592 592 extern CLoopRefCheck *pobj_LoopRefCheck; 593 593 594 //DataTable.cpp 595 class DataTable{ 596 void *pdata; 597 int size; 598 599 public: 600 DataTable(); 601 ~DataTable(); 602 void Init(); 603 604 int AddBinary( const void *pdata, int size ); 605 int Add( _int64 i64data ); 606 int Add( int i32data ); 607 int Add( double dbl ); 608 int Add( float flt ); 609 int AddString( const char *str, int length ); 610 int AddString( const char *str ); 611 612 const void *GetPtr() const; 613 int GetSize() const; 614 }; 615 extern DataTable dataTable; 616 594 617 //error.cpp 595 618 void SetError(int ErrorNum,const char *KeyWord,int pos); -
ProjectEditor/ProjectEditor.cpp
r55 r56 1996 1996 1997 1997 //Unicodeオプション 1998 if(ProjectInfo.dwOption ==PJ_OP_UNICODE) lstrcat(temporary," /unicode");1998 if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode"); 1999 1999 2000 2000 //ブレークポイントをセーブ … … 2051 2051 2052 2052 //Unicodeオプション 2053 if(ProjectInfo.dwOption ==PJ_OP_UNICODE) lstrcat(temporary," /unicode");2053 if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode"); 2054 2054 } 2055 2055 else{ … … 2137 2137 2138 2138 //Unicodeオプション 2139 if(ProjectInfo.dwOption ==PJ_OP_UNICODE) lstrcat(temporary," /unicode");2139 if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode"); 2140 2140 } 2141 2141 else{
Note:
See TracChangeset
for help on using the changeset viewer.