Changeset 355 in dev for trunk/abdev/BasicCompiler_Common
- Timestamp:
- Nov 2, 2007, 2:53:56 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/Intermediate_Step1.cpp
r340 r355 529 529 temporary[i2]=ESC_CLEARNAMESPACEIMPORTED; 530 530 } 531 if(lstrcmpi(temporary+i3,"_System_Static_New")==0){ 532 i2=i3; 533 temporary[i2++]=1; 534 temporary[i2]=ESC_SYSTEM_STATIC_NEW; 535 } 531 536 break; 532 537 case 'a': -
trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
r350 r355 254 254 255 255 bool Operator_New_GetType(const char *Parameter,const Type &baseType, Type &resultType ){ 256 char TypeName[VN_SIZE], CreateParameter[VN_SIZE],objectSizeStr[VN_SIZE];256 char TypeName[VN_SIZE],objectSizeStr[VN_SIZE]; 257 257 int i,i2; 258 258 … … 268 268 269 269 for(i2=0;;i++,i2++){ 270 if(Parameter[i]=='(' ){270 if(Parameter[i]=='(' || Parameter[i]=='['){ 271 271 TypeName[i2]=0; 272 273 //コンストラクタに渡すパラメータを取得274 i2=GetStringInPare(CreateParameter,Parameter+i);275 RemoveStringPare(CreateParameter);276 i+=i2;277 if(Parameter[i]!='\0'){278 SetError(42,NULL,cp);279 return false;280 }281 272 break; 282 273 } 283 274 TypeName[i2]=Parameter[i]; 284 275 if(Parameter[i]=='\0'){ 285 CreateParameter[0]=0;286 276 break; 287 277 } … … 589 579 } 590 580 591 if(expression[0]==1&& expression[1]==ESC_NEW){581 if(expression[0]==1&& ( expression[1]==ESC_NEW || expression[1] == ESC_SYSTEM_STATIC_NEW ) ){ 592 582 //New演算子(オブジェクト生成) 593 583 *pIsLiteralCalculation = false; -
trunk/abdev/BasicCompiler_Common/Subroutine.cpp
r353 r355 513 513 pSubStaticMethod_System_TypeBase_InitializeUserTypes->CompleteCompile(); 514 514 515 //_System_TypeBase_InitializeUserTypesForBaseTypeは一番最後にコンパイル 516 extern const UserProc *pSubStaticMethod_System_TypeBase_InitializeUserTypesForBaseType; 517 pSubStaticMethod_System_TypeBase_InitializeUserTypesForBaseType->CompleteCompile(); 518 515 519 //_System_InitStaticLocalVariablesは一番最後にコンパイル 516 520 //※一般関数内の静的変数オブジェクトをすべて収集しなければならない … … 544 548 pSubStaticMethod_System_TypeBase_InitializeUserTypes->KillCompileStatus(); 545 549 CompileBufferInProcedure( *pSubStaticMethod_System_TypeBase_InitializeUserTypes ); 550 551 //_System_TypeBase_InitializeUserTypesForBaseTypeは最後のほうでコンパイル 552 pSubStaticMethod_System_TypeBase_InitializeUserTypesForBaseType->KillCompileStatus(); 553 CompileBufferInProcedure( *pSubStaticMethod_System_TypeBase_InitializeUserTypesForBaseType ); 546 554 547 555 if( IsNeedProcCompile() ){ -
trunk/abdev/BasicCompiler_Common/include/Class.h
r353 r355 422 422 return staticMembers; 423 423 } 424 425 const CMember *FindDynamicMember( const char *memberName ) const 426 { 427 BOOST_FOREACH( CMember *pMember, GetDynamicMembers() ) 428 { 429 if( pMember->GetName() == memberName ) 430 { 431 return pMember; 432 } 433 } 434 return NULL; 435 } 424 436 425 437 void EnumDynamicMethodsOrInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const; … … 516 528 517 529 530 // TypeInfo用 531 mutable int typeInfoDataTableOffset; 532 void SetTypeInfoDataTableOffset( int typeInfoDataTableOffset ) const 533 { 534 this->typeInfoDataTableOffset = typeInfoDataTableOffset; 535 } 536 int GetTypeInfoDataTableOffset() const 537 { 538 return typeInfoDataTableOffset; 539 } 540 541 518 542 //線形リスト用 519 543 CClass *pobj_NextClass; … … 554 578 virtual void GetAllClassInfo(); 555 579 virtual void Compile_System_InitializeUserTypes(); 580 virtual void Compile_System_InitializeUserTypesForBaseType(); 556 581 557 582 const CClass *Find( const NamespaceScopes &namespaceScopes, const string &name ) const; -
trunk/abdev/BasicCompiler_Common/include/DataTable.h
r279 r355 4 4 5 5 //DataTable.cpp 6 class DataTable{ 6 class DataTable 7 { 7 8 char *buffer; 8 9 int size; 9 10 10 void Realloc( int size ) 11 { 12 this->buffer = (char *)realloc( this->buffer, size + 100 ); 13 this->size = size; 14 } 11 public: 12 // リンカで解決しなければならないスケジュール 13 Schedules schedules; 15 14 16 15 // XMLシリアライズ用 … … 23 22 ar & BOOST_SERIALIZATION_NVP( _buffer ); 24 23 ar & BOOST_SERIALIZATION_NVP( size ); 24 ar & BOOST_SERIALIZATION_NVP( schedules ); 25 25 26 26 // 読み込み後の処理 … … 52 52 ar & BOOST_SERIALIZATION_NVP( _buffer ); 53 53 ar & BOOST_SERIALIZATION_NVP( size ); 54 ar & BOOST_SERIALIZATION_NVP( schedules ); 55 } 56 57 58 void Realloc( int size ) 59 { 60 this->buffer = (char *)realloc( this->buffer, size + 100 ); 61 this->size = size; 54 62 } 55 63 … … 92 100 void Add( const DataTable &dataTable ) 93 101 { 102 long baseOffset = GetSize(); 103 94 104 AddBinary( dataTable.GetPtr(), dataTable.GetSize() ); 105 106 // スケジュールを追加 107 BOOST_FOREACH( const Schedule &schedule, dataTable.schedules ) 108 { 109 this->schedules.push_back( 110 Schedule( 111 schedule.GetType(), 112 baseOffset + schedule.GetOffset(), 113 schedule.GetLongPtrValue() 114 ) 115 ); 116 } 95 117 } 96 118 97 const void *GetPtr() const; 98 int GetSize() const; 119 const void *GetPtr() const 120 { 121 return buffer; 122 } 123 int GetSize() const 124 { 125 return size; 126 } 127 128 long GetLong( int pos ) const 129 { 130 return *(long *)( buffer + pos ); 131 } 132 _int64 GetInt64( int pos ) const 133 { 134 return *(_int64 *)( buffer + pos ); 135 } 136 void Overwrite( int pos, long newLongValue ) 137 { 138 *(long *)( buffer + pos ) = newLongValue; 139 } 140 void OverwriteInt64( int pos, _int64 new64Value ) 141 { 142 *(_int64 *)( buffer + pos ) = new64Value; 143 } 144 145 bool MakeConstObjectToProcessStaticBuffer( const CClass &objClass, const Jenga::Common::Strings &initMemberValues, int &dataTableOffset ); 146 bool MakeConstObjectToProcessStaticBuffer( const char *expression, Type &resultType, int &dataTableOffset ); 147 int MakeConstStringObjectToProcessStaticBuffer( const char *str ); 148 bool MakeLiteralArrayBuffer( const char *expression, const Type &baseType, int &dataTableOffset ); 149 150 private: 151 int lastMadeConstObjectDataTableOffset; 152 public: 153 int GetLastMadeConstObjectDataTableOffset() 154 { 155 return lastMadeConstObjectDataTableOffset; 156 } 157 158 void ResetDataSectionBaseOffset( long dataSectionBaseOffset ); 99 159 }; -
trunk/abdev/BasicCompiler_Common/include/Linker.h
r282 r355 4 4 { 5 5 NativeCode nativeCode; 6 DataTable dataTable; 6 7 DWORD imageBase; 7 8 … … 15 16 { 16 17 return nativeCode; 18 } 19 20 const DataTable &GetDataTable() const 21 { 22 return dataTable; 17 23 } 18 24 … … 37 43 void ResolveVtblSchedule( long dataSectionBaseOffset ); 38 44 45 // TypeInfoスケジュール 46 void ResolveTypeInfoSchedule( long dataSectionBaseOffset ); 47 39 48 // リンク 40 49 void Link( ObjectModule &masterObjectModule ); 50 51 // データテーブルをセット 52 void SetDataTable( DataTable &dataTable ); 41 53 }; -
trunk/abdev/BasicCompiler_Common/include/NamespaceSupporter.h
r215 r355 53 53 54 54 while( tempLivingNamespaceScopes.size() ){ 55 NamespaceScopes tempNamespaceScopes = tempLivingNamespaceScopes; 56 57 string tempStr = tempNamespaceScopes.ToString() + "." + entryName; 55 string tempStr = tempLivingNamespaceScopes.ToString() + "." + entryName; 58 56 if( thisStr == tempStr ){ 59 57 return true; -
trunk/abdev/BasicCompiler_Common/include/NativeCode.h
r287 r355 24 24 DllProc, // DLL関数位置スケジュール 25 25 Vtbl, // vtblスケジュール 26 TypeInfo, // TypeInfoスケジュール 26 27 }; 27 28 … … 57 58 break; 58 59 case Vtbl: 60 case TypeInfo: 59 61 ar & boost::serialization::make_nvp("pClass", const_cast<::CClass *&>(pClass)); 60 62 break; … … 93 95 { 94 96 } 97 Schedule( Type type, const ::CClass *pClass, long offset ) 98 : type( type ) 99 , pClass( pClass ) 100 , offset( offset ) 101 { 102 } 95 103 ~Schedule() 96 104 { … … 127 135 const ::CClass &GetClass() const 128 136 { 129 if( type != Schedule::Vtbl)137 if( !( type == Schedule::Vtbl || type == Schedule::TypeInfo ) ) 130 138 { 131 139 SetError(); -
trunk/abdev/BasicCompiler_Common/include/ver.h
r354 r355 6 6 // バージョン付加文字列 7 7 #ifdef _AMD64_ 8 #define VER_INFO "(x64) (rev.36 1)"8 #define VER_INFO "(x64) (rev.367)" 9 9 #else 10 #define VER_INFO "(rev.36 1)"10 #define VER_INFO "(rev.367)" 11 11 #endif -
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r353 r355 1294 1294 compiler.GetNamespaceSupporter().GetLivingNamespaceScopes() = objClass.GetNamespaceScopes(); 1295 1295 1296 DWORD dwFlags = 0; 1297 if( objClass.GetName() == "_System_TypeBase" ) 1298 { 1299 // _System_TypeBaseクラスはグローバル、スタティック領域を初期化するためのクラスなのでここでの初期化は除外する 1300 dwFlags |= DIMFLAG_NONCALL_CONSTRACTOR; 1301 } 1302 1296 1303 int i=0; 1297 1304 BOOST_FOREACH( CMember *member, objClass.GetStaticMembers() ){ … … 1304 1311 member->GetInitializeExpression().c_str(), 1305 1312 member->GetConstructParameter().c_str(), 1306 0);1313 dwFlags); 1307 1314 1308 1315 i++; … … 1892 1899 // 未使用のクラスは無視する 1893 1900 continue; 1894 } 1901 } 1895 1902 1896 1903 char referenceOffsetsBuffer[1024] = ""; … … 1911 1918 1912 1919 sprintf( temporary 1913 , "Add(%c%c_System_TypeForClass (\"%s\",\"%s\",[%s],%d))"1920 , "Add(%c%c_System_TypeForClass[strNamespace=\"%s\",name=\"%s\",fullName=\"%s\",referenceOffsets=[%s],numOfReference=%d])" 1914 1921 , 1 1915 , ESC_NEW 1916 , "" // 名前空間 (TODO: 実装) 1917 , objClass.GetName().c_str() // クラス名 1918 , referenceOffsetsBuffer // 参照メンバオフセット配列 1919 , numOfReference // 参照メンバの個数 1922 , ESC_SYSTEM_STATIC_NEW 1923 , objClass.GetNamespaceScopes().ToString().c_str() // 名前空間 1924 , objClass.GetName().c_str() // クラス名 1925 , objClass.GetFullName().c_str() // フルネーム 1926 , referenceOffsetsBuffer // 参照メンバオフセット配列 1927 , numOfReference // 参照メンバの個数 1920 1928 ); 1921 1929 1922 1930 // コンパイル 1923 1931 ChangeOpcode( temporary ); 1924 } 1925 1926 1932 1933 objClass.SetTypeInfoDataTableOffset( 1934 compiler.GetObjectModule().dataTable.GetLastMadeConstObjectDataTableOffset() 1935 ); 1936 } 1937 } 1938 void Classes::Compile_System_InitializeUserTypesForBaseType() 1939 { 1940 extern int cp; 1941 cp = -1; 1927 1942 //////////////////////////////////////////////////////////////////// 1928 1943 // 基底クラスを登録 1929 1944 //////////////////////////////////////////////////////////////////// 1930 1945 1946 char temporary[VN_SIZE]; 1931 1947 sprintf(temporary, "%c%ctempType=Nothing%c%cTypeBaseImpl" 1932 1948 , HIBYTE( COM_DIM ) … … 1950 1966 if( objClass.HasSuperClass() ){ 1951 1967 sprintf( temporary 1952 , "tempType=Search(\"%s\",\"%s\")" 1953 , "" // 名前空間 (TODO: 実装) 1954 , objClass.GetName().c_str() // クラス名 1968 , "tempType=Search(\"%s\")" 1969 , objClass.GetFullName().c_str() 1955 1970 ); 1956 1971 … … 1959 1974 1960 1975 sprintf( temporary 1961 , "tempType.SetBaseType(Search(\"%s\",\"%s\"))" 1962 , "" // 名前空間 (TODO: 実装) 1963 , objClass.GetSuperClass().GetName().c_str() // 基底クラス名 1976 , "tempType.SetBaseType(Search(\"%s\"))" 1977 , objClass.GetSuperClass().GetFullName().c_str() 1964 1978 ); 1965 1979 -
trunk/abdev/BasicCompiler_Common/src/DataTable.cpp
r273 r355 71 71 } 72 72 73 const void *DataTable::GetPtr() const 74 { 75 return buffer; 76 } 77 int DataTable::GetSize() const 78 { 79 return size; 80 } 73 bool DataTable::MakeConstObjectToProcessStaticBuffer( const CClass &objClass, const Jenga::Common::Strings &initMemberValues, int &dataTableOffset ) 74 { 75 // クラスに必要なバッファサイズを取得 76 int size = objClass.GetSize(); 77 78 // クラスのバッファイメージを作成 79 BYTE *buffer = (BYTE *)calloc( size, 1 ); 80 81 // クラスのバッファイメージをデータ領域へ追加 82 dataTableOffset = this->AddBinary( buffer, size ); 83 84 this->lastMadeConstObjectDataTableOffset = dataTableOffset; 85 86 // vtblスケジュール 87 this->schedules.push_back( Schedule( &objClass, dataTableOffset ) ); 88 89 // TypeInfoスケジュール 90 int offsetForTypeInfo = objClass.GetMemberOffset( "typeInfo" ); 91 //this->schedules.push_back( Schedule( Schedule::TypeInfo, &objClass, dataTableOffset + offsetForTypeInfo ) ); 92 93 BOOST_FOREACH( const std::string &initMemberValue, initMemberValues ) 94 { 95 int i = 0; 96 97 // メンバ名 98 char memberName[VN_SIZE]; 99 for( i=0; ; i++ ) 100 { 101 if( initMemberValue[i] == '\0' ) 102 { 103 // エラー 104 SetError(); 105 return false; 106 } 107 if( initMemberValue[i] == '=' ) 108 { 109 memberName[i] = 0; 110 break; 111 } 112 memberName[i] = initMemberValue[i]; 113 } 114 115 // 初期値 116 const char *initValue = initMemberValue.c_str() + i + 1; 117 118 // メンバを取得 119 const CMember *member = objClass.FindDynamicMember( memberName ); 120 121 // メンバオフセットを取得 122 int memberOffset = objClass.GetMemberOffset( member->GetName().c_str() ); 123 124 if( member->GetType().IsPointer() && initValue[0] == '[' ) 125 { 126 // ポインタ型でバッファ指定のとき 127 int memberDataTableOffset; 128 if( !this->MakeLiteralArrayBuffer( initValue, member->GetType(),memberDataTableOffset ) ) 129 { 130 return false; 131 } 132 133 this->Overwrite( dataTableOffset + memberOffset, memberDataTableOffset ); 134 this->schedules.push_back( Schedule( Schedule::DataTable, dataTableOffset + memberOffset ) ); 135 } 136 else if( member->GetType().IsWhole() ) 137 { 138 // 整数 139 Type resultType; 140 _int64 i64data; 141 if( !StaticCalculation( true, initValue, member->GetType().GetBasicType(), &i64data, resultType ) ){ 142 return false; 143 } 144 145 this->Overwrite( dataTableOffset + memberOffset, static_cast<long>(i64data) ); 146 } 147 else if( member->GetType().IsStringClass() ) 148 { 149 // 文字列型 150 char temporary[VN_SIZE]; 151 lstrcpy( temporary, initValue ); 152 RemoveStringQuotes( temporary ); 153 int memberDataTableOffset = MakeConstStringObjectToProcessStaticBuffer( temporary ); 154 this->Overwrite( dataTableOffset + memberOffset, memberDataTableOffset ); 155 this->schedules.push_back( Schedule( Schedule::DataTable, dataTableOffset + memberOffset ) ); 156 } 157 } 158 159 return true; 160 } 161 bool DataTable::MakeConstObjectToProcessStaticBuffer( const char *expression, Type &resultType, int &dataTableOffset ) 162 { 163 char CreateParameter[VN_SIZE]; 164 int i,i2; 165 166 i=0; 167 168 // クラス名を取得 169 char typeName[VN_SIZE]; 170 for(i2=0;;i++,i2++){ 171 if(expression[i]=='['){ 172 typeName[i2]=0; 173 174 // メンバの初期値を取得 175 i2=GetStringInBracket(CreateParameter,expression+i); 176 RemoveStringBracket(CreateParameter); 177 i+=i2; 178 if(expression[i]!='\0'){ 179 SetError(42,NULL,cp); 180 return false; 181 } 182 break; 183 } 184 typeName[i2]=expression[i]; 185 if(expression[i]=='\0'){ 186 CreateParameter[0]=0; 187 break; 188 } 189 } 190 191 // パラメータを取得 192 Jenga::Common::Strings initMemberValues; 193 SplitParameter( CreateParameter, initMemberValues ); 194 195 if( !compiler.StringToType( typeName, resultType ) ){ 196 SetError(3,typeName,cp); 197 return false; 198 } 199 200 if( !resultType.IsObject() ){ 201 //////////////////////// 202 // 通常のデータ型の場合 203 //////////////////////// 204 205 SetError(121,NULL,cp); 206 return false; 207 } 208 209 return MakeConstObjectToProcessStaticBuffer( resultType.GetClass(), initMemberValues, dataTableOffset ); 210 } 211 212 int DataTable::MakeConstStringObjectToProcessStaticBuffer( const char *str ) 213 { 214 const CClass &strClass = *compiler.GetObjectModule().meta.GetClasses().GetStringClassPtr(); 215 const CClass &objClass = strClass.GetSuperClass(); 216 217 // クラスに必要なバッファサイズを取得 218 int size = strClass.GetSize(); 219 220 // メンバ位置を取得 221 int offsetForTypeInfo = strClass.GetMemberOffset( "typeInfo" ); 222 int offsetForLength = strClass.GetMemberOffset( "m_Length" ); 223 int offsetForChars = strClass.GetMemberOffset( "Chars" ); 224 225 // 現在のデータ領域のヘッダ位置を取得 226 int headOffset = this->GetSize(); 227 228 // クラスのバッファイメージを作成 229 BYTE *buffer = (BYTE *)calloc( size, 1 ); 230 *(long *)(buffer + offsetForLength) = lstrlen( str ); 231 *(LONG_PTR *)(buffer + offsetForChars) = headOffset + size; 232 233 // クラスのバッファイメージをデータ領域へ追加 234 int dataTableOffset = this->AddBinary( buffer, size ); 235 236 // スケジューリング 237 this->schedules.push_back( Schedule( &strClass, headOffset ) ); 238 this->schedules.push_back( Schedule( Schedule::TypeInfo, &strClass, headOffset + offsetForTypeInfo ) ); 239 this->schedules.push_back( Schedule( Schedule::DataTable, headOffset + offsetForChars ) ); 240 241 // 文字列バッファをデータ領域へ追加 242 this->AddString( str ); 243 244 return dataTableOffset; 245 } 246 247 bool DataTable::MakeLiteralArrayBuffer( const char *expression, const Type &baseType, int &dataTableOffset ) 248 { 249 if( !baseType.IsPointer() ){ 250 SetError(1,NULL,cp); 251 return false; 252 } 253 Type tempBaseType( baseType ); 254 tempBaseType.PtrLevelDown(); 255 256 char *buffer = (char *)malloc( lstrlen( expression ) + 1 ); 257 lstrcpy( buffer, expression ); 258 RemoveStringBracket( buffer ); 259 260 void *binary = malloc( 1 ); 261 int num = 0; 262 263 int i = 0; 264 bool isSuccessful = true; 265 while( buffer[i] ){ 266 char temporary[1024]; 267 268 i = GetOneParameter( buffer, i, temporary ); 269 if( buffer[i] == ',' ){ 270 i++; 271 } 272 273 Type resultType; 274 _int64 i64data; 275 if( !StaticCalculation( true, temporary, tempBaseType.GetBasicType(), &i64data, resultType ) ){ 276 isSuccessful = false; 277 break; 278 } 279 if( !resultType.IsWhole() ){ 280 // TODO: 実数に未対応 281 SetError(); 282 isSuccessful = false; 283 break; 284 } 285 286 binary = realloc( binary, ( num + 1 ) * tempBaseType.GetSize() ); 287 memcpy( (char *)binary + (num * tempBaseType.GetSize()), &i64data, tempBaseType.GetSize() ); 288 num++; 289 } 290 291 free( buffer ); 292 293 dataTableOffset = this->AddBinary( binary, num * tempBaseType.GetSize() ); 294 295 free( binary ); 296 297 return isSuccessful; 298 } 299 300 void DataTable::ResetDataSectionBaseOffset( long dataSectionBaseOffset ) 301 { 302 BOOST_FOREACH( const Schedule &schedule, schedules ) 303 { 304 if( schedule.GetType() == Schedule::DataTable ) 305 { 306 #ifdef _WIN64 307 OverwriteInt64( 308 schedule.GetOffset(), 309 GetInt64( schedule.GetOffset() ) + dataSectionBaseOffset 310 ); 311 #else 312 Overwrite( 313 schedule.GetOffset(), 314 GetLong( schedule.GetOffset() ) + dataSectionBaseOffset 315 ); 316 #endif 317 } 318 } 319 } -
trunk/abdev/BasicCompiler_Common/src/Linker.cpp
r342 r355 17 17 } 18 18 } 19 20 BOOST_FOREACH( const Schedule &schedule, dataTable.schedules ) 21 { 22 if( schedule.GetType() == Schedule::DataTable ) 23 { 24 #ifdef _WIN64 25 dataTable.OverwriteInt64( 26 schedule.GetOffset(), 27 dataTable.GetInt64( schedule.GetOffset() ) + imageBase + dataSectionBaseOffset 28 ); 29 #else 30 dataTable.Overwrite( 31 schedule.GetOffset(), 32 dataTable.GetLong( schedule.GetOffset() ) + imageBase + dataSectionBaseOffset 33 ); 34 #endif 35 } 36 } 19 37 } 20 38 … … 116 134 } 117 135 } 136 137 BOOST_FOREACH( const Schedule &schedule, dataTable.schedules ) 138 { 139 if( schedule.GetType() == Schedule::Vtbl ) 140 { 141 LONG_PTR vtblMasterListOffset = schedule.GetClass().GetVtblMasterListOffset(); 142 143 #ifdef _WIN64 144 dataTable.OverwriteInt64( 145 schedule.GetOffset(), 146 vtblMasterListOffset + imageBase + dataSectionBaseOffset 147 ); 148 #else 149 dataTable.Overwrite( 150 schedule.GetOffset(), 151 vtblMasterListOffset + imageBase + dataSectionBaseOffset 152 ); 153 #endif 154 } 155 } 156 } 157 158 void Linker::ResolveTypeInfoSchedule( long dataSectionBaseOffset ) 159 { 160 BOOST_FOREACH( const Schedule &schedule, dataTable.schedules ) 161 { 162 if( schedule.GetType() == Schedule::TypeInfo ) 163 { 164 LONG_PTR typeInfoDataTableOffset = schedule.GetClass().GetTypeInfoDataTableOffset(); 165 166 #ifdef _WIN64 167 dataTable.OverwriteInt64( 168 schedule.GetOffset(), 169 typeInfoDataTableOffset + imageBase + dataSectionBaseOffset 170 ); 171 #else 172 dataTable.Overwrite( 173 schedule.GetOffset(), 174 typeInfoDataTableOffset + imageBase + dataSectionBaseOffset 175 ); 176 #endif 177 } 178 } 118 179 } 119 180 … … 143 204 } 144 205 } 206 207 void Linker::SetDataTable( DataTable &dataTable ) 208 { 209 this->dataTable.Add( dataTable ); 210 } -
trunk/abdev/BasicCompiler_Common/src/ObjectModule.cpp
r322 r355 26 26 27 27 // データテーブルを結合 28 objectModule.dataTable.ResetDataSectionBaseOffset( dataSectionBaseOffset ); 28 29 dataTable.Add( objectModule.dataTable ); 29 30
Note:
See TracChangeset
for help on using the changeset viewer.