Changeset 584 in dev for trunk/ab5.0/abdev/compiler_x64/Compile_ProcOp.cpp
- Timestamp:
- May 10, 2008, 12:19:15 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/compiler_x64/Compile_ProcOp.cpp
r468 r584 27 27 } 28 28 29 const UserProc *pBackUserProc = &UserProc::CompilingUserProc(); 30 UserProc::CompileStartForGlobalArea(); 29 const UserProc *pBackUserProc; 30 pBackUserProc = &compiler.GetCompilingUserProc(); 31 compiler.StartGlobalAreaCompile(); 31 32 32 33 int BackCp; … … 51 52 52 53 //クラスに属する静的メンバを定義 53 compiler.GetObjectModule().meta.GetClasses().InitStaticMember(); 54 ActiveBasic::Compiler::ProcedureGenerator::Generate_InitStaticMember( 55 compiler.GetObjectModule().meta.GetClasses() 56 ); 54 57 55 58 GetGlobalDataForDll(); … … 61 64 compiler.codeGenerator.opfix( pStackFramePertialSchedule, pobj_sf->GetFrameSize(0) ); 62 65 63 UserProc::CompileStartForUserProc( pBackUserProc );66 compiler.SetCompilingUserProc( pBackUserProc ); 64 67 cp=BackCp; 65 68 … … 103 106 compiler.codeGenerator.op_sub_rsp(0x8); 104 107 105 106 const UserProc *pBackUserProc = &UserProc::CompilingUserProc();107 UserProc::CompileStartForGlobalArea();108 const UserProc *pBackUserProc; 109 pBackUserProc = &compiler.GetCompilingUserProc(); 110 compiler.StartGlobalAreaCompile(); 108 111 109 112 compiler.codeGenerator.lexicalScopes.CallDestructorsOfScopeEnd(); 110 113 111 UserProc::CompileStartForUserProc( pBackUserProc );114 compiler.SetCompilingUserProc( pBackUserProc ); 112 115 113 116 … … 127 130 && userProc.GetParentClass().GetName() == "_System_TypeBase" ) 128 131 { 129 compiler.GetObjectModule().meta.GetClasses().Compile_System_InitializeUserTypes(); 132 ActiveBasic::Compiler::ProcedureGenerator::Generate_System_InitializeUserTypes( 133 compiler.GetObjectModule().meta.GetClasses() 134 ); 130 135 } 131 136 else if( userProc.GetName() == "InitializeUserTypesForBaseType" … … 133 138 && userProc.GetParentClass().GetName() == "_System_TypeBase" ) 134 139 { 135 compiler.GetObjectModule().meta.GetClasses().Compile_System_InitializeUserTypesForBaseType(); 140 ActiveBasic::Compiler::ProcedureGenerator::Generate_System_InitializeUserTypesForBaseType( 141 compiler.GetObjectModule().meta.GetClasses() 142 ); 136 143 } 137 144 else if( userProc.GetName() == "RegisterGlobalRoots" … … 148 155 UserProc::pGlobalProc = &userProc; 149 156 150 const UserProc *pBackUserProc = & UserProc::CompilingUserProc();151 UserProc::CompileStartForGlobalArea();157 const UserProc *pBackUserProc = &compiler.GetCompilingUserProc(); 158 compiler.StartGlobalAreaCompile(); 152 159 153 160 int BackCp = cp; … … 155 162 156 163 //クラスに属する静的メンバを定義 157 compiler.GetObjectModule().meta.GetClasses().InitStaticMember(); 164 ActiveBasic::Compiler::ProcedureGenerator::Generate_InitStaticMember( 165 compiler.GetObjectModule().meta.GetClasses() 166 ); 158 167 159 168 //グローバル実行領域をコンパイル開始 … … 173 182 } 174 183 175 UserProc::CompileStartForUserProc( pBackUserProc );184 compiler.SetCompilingUserProc( pBackUserProc ); 176 185 cp=BackCp; 177 186 } … … 227 236 else bDebugSupportProc=0; 228 237 229 //コンパイル中の関数が属するクラス 230 compiler.pCompilingClass=pUserProc->GetParentClassPtr(); 231 232 //コンパイルスタートをクラス管理クラスに追加 233 compiler.GetObjectModule().meta.GetClasses().StartCompile( pUserProc ); 234 235 //コンパイル中の関数 236 UserProc::CompileStartForUserProc( pUserProc ); 237 238 // コンパイル中の関数が属する名前空間 239 compiler.GetNamespaceSupporter().SetLivingNamespaceScopes( pUserProc->GetNamespaceScopes() ); 240 241 // コンパイル中の関数でImportsされている名前空間 242 compiler.GetNamespaceSupporter().SetImportedNamespaces( pUserProc->GetImportedNamespaces() ); 243 244 // コード生成対象を選択 245 compiler.codeGenerator.Select( (const_cast<UserProc *>(pUserProc))->GetNativeCode() ); 238 compiler.StartProcedureCompile( pUserProc ); 246 239 247 240 if(pUserProc->IsSystem()){ … … 290 283 WithInfo.num=0; 291 284 292 //重複エラー情報管理のメモリを確保293 extern char **SynonymErrorWords;294 extern int SynonymErrorNum;295 SynonymErrorNum=0;296 SynonymErrorWords=(char **)HeapAlloc(hHeap,0,1);297 298 285 //Continueアドレスを初期化 299 286 compiler.codeGenerator.ClearContinueArea(); … … 315 302 Parameter ¶m = *pUserProc->RealParams()[i3]; 316 303 317 Variable *pVar = new Variable( param.GetVarName(), param, false, param.IsRef(), "", false ); 304 Variable *pVar = new Variable( 305 ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( param.GetVarName().c_str() ), 306 param, 307 false, 308 param.IsRef(), 309 "", 310 false 311 ); 318 312 319 313 if( param.IsArray() ){ … … 463 457 } 464 458 465 if( compiler.pCompilingClass){466 if( pUserProc->GetName() == compiler. pCompilingClass->GetName() ){459 if( compiler.IsCompilingClass() ){ 460 if( pUserProc->GetName() == compiler.GetCompilingClass().GetName() ){ 467 461 //////////////////////////////////// 468 462 // コンストラクタをコンパイルするとき … … 470 464 471 465 //コンストラクタのコンパイル開始を通知 472 compiler. pCompilingClass->NotifyStartConstructorCompile();466 compiler.GetCompilingClass().NotifyStartConstructorCompile(); 473 467 474 468 //基底クラスかどうかの識別 475 469 //(継承元がインターフェイスの場合も基底クラスと見なす) 476 470 BOOL bThisIsSuperClass; 477 if( !compiler. pCompilingClass->HasSuperClass() ) bThisIsSuperClass=1;478 else if( compiler. pCompilingClass->GetSuperClass().GetConstructorMethod() == NULL ){471 if( !compiler.GetCompilingClass().HasSuperClass() ) bThisIsSuperClass=1; 472 else if( compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod() == NULL ){ 479 473 //インターフェイスを継承したときはコンストラクタを持たない 480 474 bThisIsSuperClass=1; … … 495 489 temporary[i4]=basbuf[i3]; 496 490 } 497 if( compiler. pCompilingClass->GetSuperClass().GetName() == temporary ){491 if( compiler.GetCompilingClass().GetSuperClass().GetName() == temporary ){ 498 492 //基底クラスのコンストラクタを呼び出す 499 493 cp=i3; … … 512 506 Type dummyType; 513 507 CallProc( PROC_DEFAULT 514 , &compiler. pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc()515 , compiler. pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc().GetName().c_str()508 , &compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod()->GetUserProc() 509 , compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod()->GetUserProc().GetName().c_str() 516 510 , temporary 517 511 , Type() // baseTypeはなし … … 522 516 //基底クラスのコンストラクタを暗黙的に呼び出す 523 517 Opcode_CallProc("", 524 &compiler. pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc(),518 &compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod()->GetUserProc(), 525 519 0, 526 520 ""); … … 532 526 533 527 //デストラクタのコンパイル開始を通知 534 compiler. pCompilingClass->NotifyStartDestructorCompile();528 compiler.GetCompilingClass().NotifyStartDestructorCompile(); 535 529 } 536 530 } … … 558 552 ////////////////////////////////////////// 559 553 560 if( compiler. pCompilingClass){561 562 if( compiler. pCompilingClass->IsCompilingConstructor() ){554 if( compiler.IsCompilingClass() ){ 555 556 if( compiler.GetCompilingClass().IsCompilingConstructor() ){ 563 557 // コンストラクタをコンパイルしていたとき 564 558 565 559 // コンストラクタのコンパイルが完了したことを通知 566 compiler. pCompilingClass->NotifyFinishConstructorCompile();560 compiler.GetCompilingClass().NotifyFinishConstructorCompile(); 567 561 } 568 562 else if( pUserProc->IsDestructor() ){ … … 572 566 573 567 // デストラクタのコンパイルが完了したことを通知 574 compiler. pCompilingClass->NotifyFinishDestructorCompile();575 576 if( compiler. pCompilingClass->HasSuperClass() ){568 compiler.GetCompilingClass().NotifyFinishDestructorCompile(); 569 570 if( compiler.GetCompilingClass().HasSuperClass() ){ 577 571 /* サブクラスのデストラクタをコンパイルしているときは、 578 572 基底クラスのデストラクタを呼び出す */ 579 573 580 const CMethod *method = compiler. pCompilingClass->GetSuperClass().GetDestructorMethod();574 const CMethod *method = compiler.GetCompilingClass().GetSuperClass().GetDestructorMethod(); 581 575 if( method ){ 582 576 Opcode_CallProc("", … … 705 699 706 700 707 //重複エラー情報管理のメモリを解放 708 for(i3=0;i3<SynonymErrorNum;i3++) HeapDefaultFree(SynonymErrorWords[i3]); 709 HeapDefaultFree(SynonymErrorWords); 701 compiler.FinishProcedureCompile(); 702 703 704 //ローカル変数のネーム情報は後に解放する 710 705 }
Note: See TracChangeset
for help on using the changeset viewer.