Ignore:
Timestamp:
May 10, 2008, 12:19:15 PM (16 years ago)
Author:
dai_9181
Message:

[530][583]を64bit版にマージ。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/compiler_x64/Compile_ProcOp.cpp

    r468 r584  
    2727        }
    2828
    29         const UserProc *pBackUserProc = &UserProc::CompilingUserProc();
    30         UserProc::CompileStartForGlobalArea();
     29        const UserProc *pBackUserProc;
     30        pBackUserProc = &compiler.GetCompilingUserProc();
     31        compiler.StartGlobalAreaCompile();
    3132
    3233        int BackCp;
     
    5152
    5253        //クラスに属する静的メンバを定義
    53         compiler.GetObjectModule().meta.GetClasses().InitStaticMember();
     54        ActiveBasic::Compiler::ProcedureGenerator::Generate_InitStaticMember(
     55            compiler.GetObjectModule().meta.GetClasses()
     56        );
    5457
    5558        GetGlobalDataForDll();
     
    6164        compiler.codeGenerator.opfix( pStackFramePertialSchedule, pobj_sf->GetFrameSize(0) );
    6265
    63         UserProc::CompileStartForUserProc( pBackUserProc );
     66        compiler.SetCompilingUserProc( pBackUserProc );
    6467        cp=BackCp;
    6568
     
    103106        compiler.codeGenerator.op_sub_rsp(0x8);
    104107
    105 
    106         const UserProc *pBackUserProc = &UserProc::CompilingUserProc();
    107         UserProc::CompileStartForGlobalArea();
     108        const UserProc *pBackUserProc;
     109        pBackUserProc = &compiler.GetCompilingUserProc();
     110        compiler.StartGlobalAreaCompile();
    108111
    109112        compiler.codeGenerator.lexicalScopes.CallDestructorsOfScopeEnd();
    110113
    111         UserProc::CompileStartForUserProc( pBackUserProc );
     114        compiler.SetCompilingUserProc( pBackUserProc );
    112115
    113116
     
    127130        && userProc.GetParentClass().GetName() == "_System_TypeBase" )
    128131    {
    129         compiler.GetObjectModule().meta.GetClasses().Compile_System_InitializeUserTypes();
     132        ActiveBasic::Compiler::ProcedureGenerator::Generate_System_InitializeUserTypes(
     133            compiler.GetObjectModule().meta.GetClasses()
     134        );
    130135    }
    131136    else if( userProc.GetName() == "InitializeUserTypesForBaseType"
     
    133138        && userProc.GetParentClass().GetName() == "_System_TypeBase" )
    134139    {
    135         compiler.GetObjectModule().meta.GetClasses().Compile_System_InitializeUserTypesForBaseType();
     140        ActiveBasic::Compiler::ProcedureGenerator::Generate_System_InitializeUserTypesForBaseType(
     141            compiler.GetObjectModule().meta.GetClasses()
     142        );
    136143    }
    137144    else if( userProc.GetName() == "RegisterGlobalRoots"
     
    148155        UserProc::pGlobalProc = &userProc;
    149156
    150         const UserProc *pBackUserProc = &UserProc::CompilingUserProc();
    151         UserProc::CompileStartForGlobalArea();
     157        const UserProc *pBackUserProc = &compiler.GetCompilingUserProc();
     158        compiler.StartGlobalAreaCompile();
    152159
    153160        int BackCp = cp;
     
    155162
    156163        //クラスに属する静的メンバを定義
    157         compiler.GetObjectModule().meta.GetClasses().InitStaticMember();
     164        ActiveBasic::Compiler::ProcedureGenerator::Generate_InitStaticMember(
     165            compiler.GetObjectModule().meta.GetClasses()
     166        );
    158167
    159168        //グローバル実行領域をコンパイル開始
     
    173182        }
    174183
    175         UserProc::CompileStartForUserProc( pBackUserProc );
     184        compiler.SetCompilingUserProc( pBackUserProc );
    176185        cp=BackCp;
    177186    }
     
    227236    else bDebugSupportProc=0;
    228237
    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 );
    246239
    247240    if(pUserProc->IsSystem()){
     
    290283    WithInfo.num=0;
    291284
    292     //重複エラー情報管理のメモリを確保
    293     extern char **SynonymErrorWords;
    294     extern int SynonymErrorNum;
    295     SynonymErrorNum=0;
    296     SynonymErrorWords=(char **)HeapAlloc(hHeap,0,1);
    297 
    298285    //Continueアドレスを初期化
    299286    compiler.codeGenerator.ClearContinueArea();
     
    315302        Parameter &param = *pUserProc->RealParams()[i3];
    316303
    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        );
    318312
    319313        if( param.IsArray() ){
     
    463457    }
    464458
    465     if(compiler.pCompilingClass){
    466         if( pUserProc->GetName() == compiler.pCompilingClass->GetName() ){
     459    if( compiler.IsCompilingClass() ){
     460        if( pUserProc->GetName() == compiler.GetCompilingClass().GetName() ){
    467461            ////////////////////////////////////
    468462            // コンストラクタをコンパイルするとき
     
    470464
    471465            //コンストラクタのコンパイル開始を通知
    472             compiler.pCompilingClass->NotifyStartConstructorCompile();
     466            compiler.GetCompilingClass().NotifyStartConstructorCompile();
    473467
    474468            //基底クラスかどうかの識別
    475469            //(継承元がインターフェイスの場合も基底クラスと見なす)
    476470            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 ){
    479473                //インターフェイスを継承したときはコンストラクタを持たない
    480474                bThisIsSuperClass=1;
     
    495489                    temporary[i4]=basbuf[i3];
    496490                }
    497                 if( compiler.pCompilingClass->GetSuperClass().GetName() == temporary ){
     491                if( compiler.GetCompilingClass().GetSuperClass().GetName() == temporary ){
    498492                    //基底クラスのコンストラクタを呼び出す
    499493                    cp=i3;
     
    512506                    Type dummyType;
    513507                    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()
    516510                        , temporary
    517511                        , Type()        // baseTypeはなし
     
    522516                    //基底クラスのコンストラクタを暗黙的に呼び出す
    523517                    Opcode_CallProc("",
    524                         &compiler.pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc(),
     518                        &compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod()->GetUserProc(),
    525519                        0,
    526520                        "");
     
    532526
    533527            //デストラクタのコンパイル開始を通知
    534             compiler.pCompilingClass->NotifyStartDestructorCompile();
     528            compiler.GetCompilingClass().NotifyStartDestructorCompile();
    535529        }
    536530    }
     
    558552    //////////////////////////////////////////
    559553
    560     if( compiler.pCompilingClass ){
    561 
    562         if( compiler.pCompilingClass->IsCompilingConstructor() ){
     554    if( compiler.IsCompilingClass() ){
     555
     556        if( compiler.GetCompilingClass().IsCompilingConstructor() ){
    563557            // コンストラクタをコンパイルしていたとき
    564558
    565559            // コンストラクタのコンパイルが完了したことを通知
    566             compiler.pCompilingClass->NotifyFinishConstructorCompile();
     560            compiler.GetCompilingClass().NotifyFinishConstructorCompile();
    567561        }
    568562        else if( pUserProc->IsDestructor() ){
     
    572566
    573567            // デストラクタのコンパイルが完了したことを通知
    574             compiler.pCompilingClass->NotifyFinishDestructorCompile();
    575 
    576             if( compiler.pCompilingClass->HasSuperClass() ){
     568            compiler.GetCompilingClass().NotifyFinishDestructorCompile();
     569
     570            if( compiler.GetCompilingClass().HasSuperClass() ){
    577571                /* サブクラスのデストラクタをコンパイルしているときは、
    578572                    基底クラスのデストラクタを呼び出す */
    579573
    580                 const CMethod *method = compiler.pCompilingClass->GetSuperClass().GetDestructorMethod();
     574                const CMethod *method = compiler.GetCompilingClass().GetSuperClass().GetDestructorMethod();
    581575                if( method ){
    582576                    Opcode_CallProc("",
     
    705699
    706700
    707     //重複エラー情報管理のメモリを解放
    708     for(i3=0;i3<SynonymErrorNum;i3++) HeapDefaultFree(SynonymErrorWords[i3]);
    709     HeapDefaultFree(SynonymErrorWords);
     701    compiler.FinishProcedureCompile();
     702
     703
     704    //ローカル変数のネーム情報は後に解放する
    710705}
Note: See TracChangeset for help on using the changeset viewer.