Changeset 287 in dev for trunk/abdev/BasicCompiler_Common/src
- Timestamp:
- Aug 16, 2007, 7:55:02 PM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Linker.cpp
r282 r287 126 126 } 127 127 128 nativeCode.Put ( masterObjectModule.globalNativeCode );128 nativeCode.PutEx( masterObjectModule.globalNativeCode ); 129 129 130 130 masterObjectModule.meta.GetUserProcs().Iterator_Reset(); … … 137 137 pUserProc->SetBeginOpAddress( nativeCode.GetSize() ); 138 138 139 nativeCode.Put ( pUserProc->GetNativeCode() );139 nativeCode.PutEx( pUserProc->GetNativeCode() ); 140 140 141 141 pUserProc->SetEndOpAddress( nativeCode.GetSize() ); -
trunk/abdev/BasicCompiler_Common/src/Meta.cpp
r283 r287 90 90 } 91 91 92 bool isResetOffsetAddress = true; 93 if( pVar->HasInitData() ) 94 { 95 // 初期バッファがあるときはデータテーブルオフセットを適用する 96 pVar->SetOffsetAddress( pVar->GetOffsetAddress() + dataSectionBaseOffset ); 97 98 isResetOffsetAddress = false; 99 } 100 92 101 pVar->isTargetObjectModule = false; 93 this->globalVars.Add( pVar );102 this->globalVars.Add( pVar, isResetOffsetAddress ); 94 103 } 95 104 meta.globalVars.PullOutAll(); -
trunk/abdev/BasicCompiler_Common/src/NativeCode.cpp
r282 r287 5 5 #define BREAK_EIP(checkEip) (obp+0x00401000>=checkEip) 6 6 7 void NativeCode::Put ( const NativeCode &nativeCode )7 void NativeCode::PutEx( const NativeCode &nativeCode ) 8 8 { 9 long baseOffset = size;9 long baseOffset = GetSize(); 10 10 11 11 // コードバッファを追加 12 Put( nativeCode. codeBuffer, nativeCode.size);12 Put( nativeCode.GetBuffer(), nativeCode.GetSize() ); 13 13 14 14 // スケジュールを追加 … … 43 43 pUserProc->Using(); 44 44 45 Schedule schedule( pUserProc, size);45 Schedule schedule( pUserProc, GetSize() ); 46 46 if( isCall == false ) 47 47 { … … 50 50 schedules.push_back( schedule ); 51 51 52 *((long *)(codeBuffer+size))=0; 53 size += sizeof(long); 52 Put( (long)0 ); 54 53 } 55 54 … … 58 57 pDllProc->Using(); 59 58 60 schedules.push_back( Schedule( pDllProc, size) );59 schedules.push_back( Schedule( pDllProc, GetSize() ) ); 61 60 62 *((long *)(codeBuffer+size))=0; 63 size += sizeof(long); 61 Put( (long)0 ); 64 62 } 65 63 66 64 void NativeCode::PutVtblSchedule( const CClass *pClass ) 67 65 { 68 schedules.push_back( Schedule( pClass, size) );66 schedules.push_back( Schedule( pClass, GetSize() ) ); 69 67 70 *((long *)(codeBuffer+size))=0; 71 size += sizeof(long); 68 Put( (long)0 ); 72 69 } 73 70 … … 76 73 if( sourceLines.size() ) 77 74 { 78 if( sourceLines.back().GetNativeCodePos() == size)75 if( sourceLines.back().GetNativeCodePos() == GetSize() ) 79 76 { 80 77 sourceLines.back().SetSourceCodePos( cp ); … … 97 94 SourceLine( 98 95 (long)sourceLines.size(), 99 size,96 GetSize(), 100 97 compiler.GetObjectModule().GetCurrentSourceIndex(), 101 98 cp, -
trunk/abdev/BasicCompiler_Common/src/ObjectModule.cpp
r282 r287 23 23 objectModule.globalNativeCode.ResetDataSectionBaseOffset( dataSectionBaseOffset ); 24 24 objectModule.globalNativeCode.ResetSourceIndexes( sourceIndexBase ); 25 globalNativeCode.Put ( objectModule.globalNativeCode );25 globalNativeCode.PutEx( objectModule.globalNativeCode ); 26 26 27 27 // データテーブルを結合 -
trunk/abdev/BasicCompiler_Common/src/Source.cpp
r285 r287 815 815 816 816 // basic.sbpをインクルード 817 const char *headCode = "#include <basic.sbp>\n";818 //const char *headCode = "\n";817 //const char *headCode = "#include <basic.sbp>\n"; 818 const char *headCode = "\n"; 819 819 Realloc( length + lstrlen(headCode) ); 820 820 Text::SlideString( buffer, lstrlen(headCode) ); -
trunk/abdev/BasicCompiler_Common/src/Variable.cpp
r275 r287 74 74 } 75 75 76 void Variables::Add( Variable *pVar )76 void Variables::Add( Variable *pVar, bool isResetOffsetAddress ) 77 77 { 78 78 int alignment = 0; … … 90 90 } 91 91 92 pVar->SetOffsetAddress( allInitSize ); 92 if( isResetOffsetAddress ) 93 { 94 pVar->SetOffsetAddress( allInitSize ); 95 } 93 96 allInitSize += pVar->GetMemorySize(); 94 97 } … … 102 105 } 103 106 107 if( !isResetOffsetAddress ) 108 { 109 Jenga::Throw( "[Variables::Add] 初期バッファがない変数に対してisResetOffsetAddressをfalseにできない" ); 110 } 111 104 112 pVar->SetOffsetAddress( allSize | 0x80000000 ); 105 113 allSize += pVar->GetMemorySize();
Note:
See TracChangeset
for help on using the changeset viewer.