- Timestamp:
- Jun 15, 2008, 11:59:46 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.h
r622 r641 28 28 //デバッグ 29 29 BOOL bDebugSupportProc; 30 BOOL bSystemProc;31 30 DWORD dwStepRun; 32 31 double width_ratio_VarList=0.3; -
trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp
r637 r641 747 747 } 748 748 749 compiler.codeGenerator.NextSourceLine( SourceCodePosition( compiler.GetCurrentRelationalObjectModuleIndexForSource(), cp ) ); 749 if( basbuf[cp] != '\0' ) 750 { 751 compiler.codeGenerator.NextSourceLine( 752 SourceCodePosition( compiler.GetCurrentRelationalObjectModuleIndexForSource(), cp ), 753 compiler.GetCompilingUserProc().IsSystem() 754 ); 755 } 750 756 751 757 if(Command[0]==1){ -
trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp
r637 r641 262 262 SendDlgItemMessage(hMainDlg,IDC_DEBUGLIST,EM_REPLACESEL,0,(LPARAM)buffer); 263 263 } 264 UserProc *GetSubFromObp(ULONG_PTR pos){ 264 UserProc *GetSubFromObp(ULONG_PTR pos) 265 { 265 266 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 266 267 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) -
trunk/ab5.0/abdev/BasicCompiler_Common/include/CodeGenerator.h
r637 r641 241 241 } 242 242 243 void NextSourceLine( const SourceCodePosition &sourceCodePosition )244 { 245 pNativeCode->NextSourceLine( sourceCodePosition );243 void NextSourceLine( const SourceCodePosition &sourceCodePosition, bool isInSystemProc ) 244 { 245 pNativeCode->NextSourceLine( sourceCodePosition, isInSystemProc ); 246 246 } 247 247 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp
r637 r641 402 402 bool Compiler::IsGlobalAreaCompiling() 403 403 { 404 return ( pCompilingUserProc == NULL ); 404 if( pCompilingUserProc == NULL ) 405 { 406 return true; 407 } 408 return ( pCompilingUserProc->GetName() == this->globalAreaProcName ); 405 409 } 406 410 bool Compiler::IsLocalAreaCompiling() 407 411 { 408 return ( pCompilingUserProc != NULL);412 return !IsGlobalAreaCompiling(); 409 413 } 410 414 const UserProc &Compiler::GetCompilingUserProc() 411 415 { 412 if( !this->IsGlobalAreaCompiling() ) 413 { 414 return *pCompilingUserProc; 416 if( pCompilingUserProc == NULL ) 417 { 418 _ASSERTE( false ); 419 throw; 420 } 421 return *pCompilingUserProc; 422 } 423 424 bool Compiler::IsCompilingClass() 425 { 426 return ( pCompilingClass != NULL ); 427 } 428 const CClass &Compiler::GetCompilingClass() 429 { 430 if( this->IsCompilingClass() ) 431 { 432 return *pCompilingClass; 415 433 } 416 434 417 435 throw; 418 436 } 419 420 bool Compiler::IsCompilingClass()421 {422 return ( pCompilingClass != NULL );423 }424 const CClass &Compiler::GetCompilingClass()425 {426 if( this->IsCompilingClass() )427 {428 return *pCompilingClass;429 }430 431 throw;432 } -
trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Procedure.cpp
r637 r641 915 915 importedNamespaces.clear(); 916 916 917 compiler.globalAreaProcName = "_ System_GlobalArea_" + compiler.GetModuleName();917 compiler.globalAreaProcName = "_GlobalArea_" + compiler.GetModuleName(); 918 918 sprintf(temporary,"%c%c%s()",1,ESC_SUB,compiler.globalAreaProcName.c_str()); 919 919 UserProc *pUserProc = ParseUserProc( namespaceScopes, importedNamespaces, temporary, 0, false, NULL, false ); -
trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h
r640 r641 244 244 return sourceLines; 245 245 } 246 void NextSourceLine( const SourceCodePosition &sourceCodePosition );246 void NextSourceLine( const SourceCodePosition &sourceCodePosition, bool isInSystemProc ); 247 247 248 248 void ResetDataSectionBaseOffset( long dataSectionBaseOffset ); -
trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h
r640 r641 136 136 // 各種フラグ 137 137 bool isExport; 138 mutable bool is System;138 mutable bool isAutoGenerationSystem; 139 139 mutable bool isAutoGeneration; 140 140 mutable bool isCompiled; … … 180 180 ar & BOOST_SERIALIZATION_NVP( realSecondParmNum ); 181 181 ar & BOOST_SERIALIZATION_NVP( isExport ); 182 ar & BOOST_SERIALIZATION_NVP( is System );182 ar & BOOST_SERIALIZATION_NVP( isAutoGenerationSystem ); 183 183 ar & BOOST_SERIALIZATION_NVP( isAutoGeneration ); 184 184 ar & BOOST_SERIALIZATION_NVP( isCompiled ); … … 275 275 return isExport; 276 276 } 277 void ThisIs SystemProc() const278 { 279 is System = true;280 } 281 bool Is System() const282 { 283 return is System;277 void ThisIsAutoGenerationSystemProc() const 278 { 279 isAutoGenerationSystem = true; 280 } 281 bool IsAutoGenerationSystem() const 282 { 283 return isAutoGenerationSystem; 284 284 } 285 285 void ThisIsAutoGenerationProc() const … … 291 291 return isAutoGeneration; 292 292 } 293 bool IsSystem() const; 293 294 void CompleteCompile() const 294 295 { -
trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp
r640 r641 161 161 } 162 162 163 void NativeCode::NextSourceLine( const SourceCodePosition &sourceCodePosition )163 void NativeCode::NextSourceLine( const SourceCodePosition &sourceCodePosition, bool isInSystemProc ) 164 164 { 165 165 if( sourceLines.size() ) … … 173 173 174 174 extern BOOL bDebugSupportProc; 175 extern BOOL bSystemProc;176 175 DWORD sourceLineType = 0; 177 176 if( bDebugSupportProc ) … … 179 178 sourceLineType |= CODETYPE_DEBUGPROC; 180 179 } 181 if( bSystemProc )180 if( isInSystemProc ) 182 181 { 183 182 sourceLineType |= CODETYPE_SYSTEMPROC; -
trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp
r640 r641 44 44 , realSecondParmNum( 1 ) 45 45 , isExport( isExport ) 46 , is System( false )46 , isAutoGenerationSystem( false ) 47 47 , isAutoGeneration( false ) 48 48 , isCompiled( false ) … … 65 65 , realSecondParmNum( userProc.realSecondParmNum ) 66 66 , isExport( userProc.isExport ) 67 , is System( userProc.isSystem )67 , isAutoGenerationSystem( userProc.isAutoGenerationSystem ) 68 68 , isAutoGeneration( userProc.isAutoGeneration ) 69 69 , isCompiled( false ) … … 138 138 return false; 139 139 } 140 bool UserProc::IsSystem() const 141 { 142 // "_System_" を名前の先頭に含む関数 143 if( memcmp( this->GetName().c_str(), "_System_", 8 ) == 0 ) 144 { 145 return true; 146 } 147 148 // "_System_" を名前の先頭に含むクラスのメソッド 149 if( this->HasParentClass() ) 150 { 151 if( memcmp( this->GetParentClass().GetName().c_str(), "_System_", 8 ) == 0 ) 152 { 153 return true; 154 } 155 } 156 157 return false; 158 } 140 159 const NamespaceScopes &UserProc::GetNamespaceScopes() const 141 160 { -
trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp
r637 r641 900 900 } 901 901 902 if( includedFilesRelation.GetLineCounts() < i2 )902 if( includedFilesRelation.GetLineCounts() <= i2 ) 903 903 { 904 904 //Jenga::Throw( "BasicSource::GetLineInfoメソッドで不正な行の情報を取得しようとした" ); -
trunk/ab5.0/abdev/compiler_x86/Compile_ProcOp.cpp
r637 r641 24 24 } 25 25 26 const UserProc *pBackUserProc;27 pBackUserProc = &compiler.GetCompilingUserProc();28 compiler.StartGlobalAreaCompile();29 30 26 int BackCp; 31 27 BackCp=cp; … … 52 48 GetGlobalDataForDll(); 53 49 54 compiler.SetCompilingUserProc( pBackUserProc );55 50 cp=BackCp; 56 51 … … 81 76 compiler.codeGenerator.op_ret(); 82 77 } 83 else if( userProc.GetName() == "_System_Call_Destructor_of_GlobalObject" ){ 84 85 const UserProc *pBackUserProc; 86 pBackUserProc = &compiler.GetCompilingUserProc(); 87 compiler.StartGlobalAreaCompile(); 88 78 else if( userProc.GetName() == "_System_Call_Destructor_of_GlobalObject" ) 79 { 89 80 compiler.codeGenerator.lexicalScopes.CallDestructorsOfScopeEnd(); 90 81 91 82 compiler.SetCompilingUserProc( pBackUserProc ); 92 93 83 94 84 //ret … … 213 203 else if( userProc.GetName() == "RegisterGlobalRoots" 214 204 && userProc.HasParentClass() 215 && userProc.GetParentClass().GetName() == "_System_CGarbageCollection" ){ 216 217 Compile_AddGlobalRootsForGc(); 218 } 219 else if( userProc.GetName() == compiler.globalAreaProcName ){ 205 && userProc.GetParentClass().GetName() == "_System_CGarbageCollection" ) 206 { 207 Compile_AddGlobalRootsForGc(); 208 } 209 else if( userProc.GetName() == compiler.globalAreaProcName ) 210 { 220 211 //////////////////////////////////////// 221 212 // グローバル領域をコンパイル … … 223 214 224 215 UserProc::pGlobalProc = &userProc; 225 226 const UserProc *pBackUserProc = &compiler.GetCompilingUserProc();227 compiler.StartGlobalAreaCompile();228 216 229 217 int BackCp = cp; … … 251 239 } 252 240 253 compiler.SetCompilingUserProc( pBackUserProc );254 241 cp=BackCp; 255 242 } … … 293 280 pUserProc->CompleteCompile(); 294 281 295 extern BOOL bSystemProc;296 if(memcmp(pUserProc->GetName().c_str(),"_System_",8)==0) bSystemProc=1;297 else bSystemProc=0;298 299 282 extern BOOL bDebugSupportProc; 300 283 if(memcmp(pUserProc->GetName().c_str(),"_DebugSys_",10)==0) … … 316 299 compiler.StartProcedureCompile( pUserProc ); 317 300 318 if(pUserProc->Is System()){301 if(pUserProc->IsAutoGenerationSystem()){ 319 302 //////////////////// 320 303 // 特殊関数 -
trunk/ab5.0/abdev/compiler_x86/Compile_Var.cpp
r632 r641 1329 1329 } 1330 1330 } 1331 void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar){ 1331 void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar) 1332 { 1332 1333 if( reg != REG_EAX ){ 1333 1334 compiler.errorMessenger.OutputFatalError(); … … 1337 1338 } 1338 1339 1339 bool Compile_AddGlobalRootsForGc(){ 1340 bool Compile_AddGlobalRootsForGc() 1341 { 1340 1342 const UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" ); 1341 if( !pUserProc_AddGlobalRootPtr ){ 1343 if( !pUserProc_AddGlobalRootPtr ) 1344 { 1342 1345 compiler.errorMessenger.Output(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 ); 1343 1346 return false; -
trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp
r640 r641 260 260 if(pSub_System_GetEip=GetSubHash("_System_GetEip",1)){ 261 261 pSub_System_GetEip->Using(); 262 pSub_System_GetEip->ThisIs SystemProc();262 pSub_System_GetEip->ThisIsAutoGenerationSystemProc(); 263 263 } 264 264 265 265 if(pSub_System_InitDllGlobalVariables=GetSubHash("_System_InitDllGlobalVariables",1)){ 266 266 pSub_System_InitDllGlobalVariables->Using(); 267 pSub_System_InitDllGlobalVariables->ThisIs SystemProc();267 pSub_System_InitDllGlobalVariables->ThisIsAutoGenerationSystemProc(); 268 268 } 269 269 270 270 if(pSub_System_InitStaticLocalVariables=GetSubHash("_System_InitStaticLocalVariables",1)){ 271 271 pSub_System_InitStaticLocalVariables->Using(); 272 pSub_System_InitStaticLocalVariables->ThisIs SystemProc();272 pSub_System_InitStaticLocalVariables->ThisIsAutoGenerationSystemProc(); 273 273 } 274 274 275 275 if(pSub_System_Call_Destructor_of_GlobalObject=GetSubHash("_System_Call_Destructor_of_GlobalObject",1)){ 276 276 pSub_System_Call_Destructor_of_GlobalObject->Using(); 277 pSub_System_Call_Destructor_of_GlobalObject->ThisIs SystemProc();277 pSub_System_Call_Destructor_of_GlobalObject->ThisIsAutoGenerationSystemProc(); 278 278 } 279 279 … … 329 329 pSub_allrem=GetSubHash("_allrem"); 330 330 pSub_allrem->Using(); 331 pSub_allrem->ThisIs SystemProc();331 pSub_allrem->ThisIsAutoGenerationSystemProc(); 332 332 333 333 pSub_aullrem=GetSubHash("_aullrem"); 334 334 pSub_aullrem->Using(); 335 pSub_aullrem->ThisIs SystemProc();335 pSub_aullrem->ThisIsAutoGenerationSystemProc(); 336 336 337 337 pSub_allmul=GetSubHash("_allmul"); 338 338 pSub_allmul->Using(); 339 pSub_allmul->ThisIs SystemProc();339 pSub_allmul->ThisIsAutoGenerationSystemProc(); 340 340 341 341 pSub_alldiv=GetSubHash("_alldiv"); 342 342 pSub_alldiv->Using(); 343 pSub_alldiv->ThisIs SystemProc();343 pSub_alldiv->ThisIsAutoGenerationSystemProc(); 344 344 345 345 pSub_aulldiv=GetSubHash("_aulldiv"); 346 346 pSub_aulldiv->Using(); 347 pSub_aulldiv->ThisIs SystemProc();347 pSub_aulldiv->ThisIsAutoGenerationSystemProc(); 348 348 349 349 pSub_allshl=GetSubHash("_allshl"); 350 350 pSub_allshl->Using(); 351 pSub_allshl->ThisIs SystemProc();351 pSub_allshl->ThisIsAutoGenerationSystemProc(); 352 352 353 353 pSub_allshr=GetSubHash("_allshr"); 354 354 pSub_allshr->Using(); 355 pSub_allshr->ThisIs SystemProc();355 pSub_allshr->ThisIsAutoGenerationSystemProc(); 356 356 357 357 pSub_aullshr=GetSubHash("_aullshr"); 358 358 pSub_aullshr->Using(); 359 pSub_aullshr->ThisIs SystemProc();359 pSub_aullshr->ThisIsAutoGenerationSystemProc(); 360 360 361 361 pSub_esp_error=GetSubHash("_esp_error");
Note:
See TracChangeset
for help on using the changeset viewer.