Changeset 56 in dev for BasicCompiler64
- Timestamp:
- Feb 15, 2007, 3:39:40 AM (18 years ago)
- Location:
- BasicCompiler64
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.