Changeset 584 in dev


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

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

Location:
trunk/ab5.0/abdev/compiler_x64
Files:
11 edited

Legend:

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

    r468 r584  
    128128        }
    129129
    130         pNativeCode->PutEx( disp, scheduleType );
     130        this->PutWithSchedule( disp, scheduleType );
    131131    }
    132132
     
    182182        pPertialSchedule = pertialSchedules.back();
    183183    }
    184     pNativeCode->PutEx( i32data, scheduleType );
     184    this->PutWithSchedule( i32data, scheduleType );
    185185
    186186    return pPertialSchedule;
     
    264264            pPertialSchedule = pertialSchedules.back();
    265265        }
    266         pNativeCode->PutEx( offset, scheduleType );
     266        this->PutWithSchedule( offset, scheduleType );
    267267    }
    268268    else{
     
    337337            pPertialSchedule = pertialSchedules.back();
    338338        }
    339         pNativeCode->PutEx( offset, scheduleType );
     339        this->PutWithSchedule( offset, scheduleType );
    340340    }
    341341    else{
     
    662662        pPertialSchedule = pertialSchedules.back();
    663663    }
    664     pNativeCode->PutEx( offset, scheduleType );
     664    this->PutWithSchedule( offset, scheduleType );
    665665
    666666    return pPertialSchedule;
  • trunk/ab5.0/abdev/compiler_x64/Compile_Calc.cpp

    r528 r584  
    9393            }
    9494            else{
    95                 if( compiler.GetObjectModule().meta.GetGlobalConsts().IsExist(variable)
    96                     || compiler.GetObjectModule().meta.GetGlobalConstMacros().IsExist(variable) )
     95                if( compiler.GetObjectModule().meta.GetGlobalConsts().IsExistDuplicationKeyName(variable)
     96                    || compiler.GetObjectModule().meta.GetGlobalConstMacros().IsExistDuplicationKeyName(variable) )
    9797                {
    9898                    //定数リストに該当したとき
  • trunk/ab5.0/abdev/compiler_x64/Compile_CallProc.cpp

    r514 r584  
    121121            {
    122122                //クラスメンバ関数内から基底クラスの呼び出し
    123                 pobj_c=&compiler.pCompilingClass->GetSuperClass();
     123                pobj_c=&compiler.GetCompilingClass().GetSuperClass();
    124124
    125125                isFixedClass = true;
     
    140140                if( !pobj_c )
    141141                {
    142                     pobj_c=compiler.GetObjectModule().meta.GetClasses().Find(ObjectName);
     142                    pobj_c = compiler.GetObjectModule().meta.FindClassSupportedTypeDef( ObjectName );
    143143                    if( pobj_c ){
    144144                        isStatic = true;
     
    155155
    156156                //New演算子によるコンストラクタ呼び出し
    157                 pobj_c=pUserProc->GetParentClassPtr();
     157                pobj_c = pUserProc->GetParentClassPtr();
    158158            }
    159159            else{
    160160                //クラスメンバ関数内から同一クラスのメンバ関数の呼び出し
    161                 pobj_c=compiler.pCompilingClass;
     161                pobj_c = &compiler.GetCompilingClass();
    162162            }
    163163        }
     
    188188        if(ObjectName[0]){
    189189            //外部からの呼び出し
    190             if(pobj_c==compiler.pCompilingClass){
     190            if( compiler.IsCompilingClass() && pobj_c == &compiler.GetCompilingClass() )
     191            {
    191192                //同一クラスオブジェクトの場合はプライベートアクセスを容認する
    192                 if( pMethod->IsNoneAccess() ){
     193                if( pMethod->IsNoneAccess() )
     194                {
    193195                    compiler.errorMessenger.Output(109,pUserProc->GetName(),cp);
    194196                    return false;
    195197                }
    196198            }
    197             else{
     199            else
     200            {
    198201                if( pMethod->IsPrivate()
    199                     || pMethod->IsNoneAccess() ){
     202                    || pMethod->IsNoneAccess() )
     203                {
    200204                    compiler.errorMessenger.Output(109,pUserProc->GetName(),cp);
    201205                    return false;
    202206                }
    203                 if( !pMethod->GetUserProc().GetParentClass().IsEqualsOrSubClass( pobj_c ) && pMethod->IsProtected() ){
     207                if( !pMethod->GetUserProc().GetParentClass().IsEqualsOrSubClass( pobj_c ) && pMethod->IsProtected() )
     208                {
    204209                    compiler.errorMessenger.Output(110,pUserProc->GetName(),cp);
    205210                    return false;
  • trunk/ab5.0/abdev/compiler_x64/Compile_Func.cpp

    r528 r584  
    120120            SetThisPtrToReg(REG_RCX);
    121121
    122             pobj_c=compiler.pCompilingClass;
     122            pobj_c = &compiler.GetCompilingClass();
    123123        }
    124124
     
    295295    {
    296296        // 左辺でデリゲートを要求されているとき
    297         const Delegate *pTempDelegate = &baseType.GetClass().GetDelegate();
     297        const Delegate *pTempDelegate = &compiler.GetObjectModule().meta.ToDelegate( baseType.GetClass() );
    298298        pBaseParams = &pTempDelegate->Params();
    299299        pBaseReturnType = &pTempDelegate->ReturnType();
     
    474474        }
    475475
    476         Opcode_CallDelegate( compiler.pCompilingClass->GetDelegate(), methodPtrParamStr, objPtrValueStr, paramsStr + i );
    477     }
    478 
    479     resultType = UserProc::CompilingUserProc().ReturnType();
     476        Opcode_CallDelegate( compiler.GetObjectModule().meta.ToDelegate( compiler.GetCompilingClass() ), methodPtrParamStr, objPtrValueStr, paramsStr + i );
     477    }
     478
     479    resultType = compiler.GetCompilingUserProc().ReturnType();
    480480}
    481481
  • 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}
  • trunk/ab5.0/abdev/compiler_x64/Compile_Statement.cpp

    r468 r584  
    640640
    641641void OpcodeExitSub(void){
    642     if( UserProc::IsGlobalAreaCompiling() ){
     642    if( compiler.IsGlobalAreaCompiling() ){
    643643        compiler.errorMessenger.Output(12,"Exit Sub/Function",cp);
    644644        return;
     
    917917}
    918918void OpcodeReturn(char *Parameter){
    919     if( UserProc::IsGlobalAreaCompiling() ){
     919    if( compiler.IsGlobalAreaCompiling() ){
    920920        compiler.errorMessenger.Output(62,NULL,cp);
    921921    }
     
    923923        //戻り値をセット
    924924        if(Parameter[0]){
    925             const UserProc &proc = UserProc::CompilingUserProc();
     925            const UserProc &proc = compiler.GetCompilingUserProc();
    926926
    927927            const char *temp = "_System_ReturnValue";
  • trunk/ab5.0/abdev/compiler_x64/Compile_Var.cpp

    r514 r584  
    209209    ////////////////////////////
    210210
    211     const CMember *pMember = objClass.FindDynamicMember( VarName );
     211    const Member *pMember = objClass.FindDynamicMember( VarName );
    212212    if( !pMember )
    213213    {
     
    220220
    221221    //アクセシビリティをチェック
    222     if(&objClass==compiler.pCompilingClass){
     222    if( compiler.IsCompilingClass() && &objClass == &compiler.GetCompilingClass() ){
    223223        //同一クラスオブジェクトの場合はプライベートアクセスを容認する
    224224        if(pMember->IsNoneAccess()){
     
    412412
    413413
    414     if( UserProc::IsLocalAreaCompiling() ){
     414    if( compiler.IsLocalAreaCompiling() ){
    415415        //////////////////
    416416        // ローカル変数
    417417        //////////////////
    418418
    419         const Variable *pVar = UserProc::CompilingUserProc().GetLocalVars().BackSearch( LexicalAnalyzer::FullNameToSymbol( VarName ) );
     419        const Variable *pVar = compiler.GetCompilingUserProc().GetLocalVars().BackSearch(
     420            LexicalAnalyzer::FullNameToSymbol( VarName ),
     421            compiler.codeGenerator.lexicalScopes.GetNowLevel()
     422        );
    420423        if( pVar ){
    421424            //ポインタ変数の場合
     
    470473    }
    471474
    472 
    473     if(compiler.pCompilingClass){
     475    if( compiler.IsCompilingClass() ){
    474476        //////////////////////
    475477        // クラスメンバの参照
     
    482484            pRelativeVar->dwKind=VAR_DIRECTMEM;
    483485
    484             resultType.SetType( DEF_OBJECT, compiler.pCompilingClass );
     486            resultType.SetType( DEF_OBJECT, &compiler.GetCompilingClass() );
    485487            return true;
    486488        }
     
    494496            //クラス内の動的メンバを参照するとき(通常)
    495497
    496             if( !compiler.pCompilingClass->HasDynamicMember( VarName ) )
     498            if( !compiler.GetCompilingClass().HasDynamicMember( VarName ) )
    497499            {
    498500                goto NonClassMember;
     
    502504        //Const修飾子のメソッド内でメンバ書き込みアクセスが発生したとき
    503505        //(コンストラクタ、デストラクタ内を除く)
    504         const CMethod *pMethod = compiler.GetObjectModule().meta.GetClasses().GetNowCompilingMethodInfo();
     506        const CMethod *pMethod = &compiler.GetCompilingUserProc().GetMethod();
    505507        if( isWriteAccess &&
    506508            pMethod->IsConst() &&
    507             compiler.pCompilingClass->IsCompilingConstructor() == false &&
    508             compiler.pCompilingClass->IsCompilingDestructor() == false
     509            compiler.GetCompilingClass().IsCompilingConstructor() == false &&
     510            compiler.GetCompilingClass().IsCompilingDestructor() == false
    509511            ){
    510512                compiler.errorMessenger.Output(131, NULL, cp );
     
    518520            isErrorEnabled,
    519521            isWriteAccess,
    520             Type( DEF_OBJECT, *compiler.pCompilingClass ),
     522            Type( DEF_OBJECT, compiler.GetCompilingClass() ),
    521523            variable,
    522524            pRelativeVar,
     
    536538
    537539        char temporary[VN_SIZE];
    538         if( UserProc::IsLocalAreaCompiling() ){
     540        if( compiler.IsLocalAreaCompiling() ){
    539541            GetNowStaticVarFullName(VarName,temporary);
    540542
     
    578580        }
    579581
    580         if(compiler.pCompilingClass){
     582        if( compiler.IsCompilingClass() ){
    581583            //自身のクラスから静的メンバを参照する場合
    582584            char temp2[VN_SIZE];
    583             sprintf(temp2,"%s.%s",compiler.pCompilingClass->GetName().c_str(),VarName);
     585            sprintf(temp2,"%s.%s",compiler.GetCompilingClass().GetName().c_str(),VarName);
    584586            pVar = compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( temp2 ) );
    585587            if( pVar ){
     
    592594        /////////////////////
    593595
    594         pVar = compiler.GetObjectModule().meta.GetGlobalVars().BackSearch( LexicalAnalyzer::FullNameToSymbol( VarName ) );
     596        pVar = compiler.GetObjectModule().meta.GetGlobalVars().BackSearch(
     597            LexicalAnalyzer::FullNameToSymbol( VarName ),
     598            compiler.codeGenerator.lexicalScopes.GetNowLevel()
     599        );
    595600        if( pVar ){
    596601            goto GlobalOk;
     
    806811
    807812            int i = 0;
    808             BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
     813            BOOST_FOREACH( Member *pMember, objClass.GetDynamicMembers() ){
    809814                if(InitBuf[i]=='\0'){
    810815                    compiler.errorMessenger.Output(41,0,cp);
     
    968973
    969974            int i = 0;
    970             BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
     975            BOOST_FOREACH( Member *pMember, objClass.GetDynamicMembers() ){
    971976                if(InitBuf[i]=='\0'){
    972977                    compiler.errorMessenger.Output(41,0,cp);
     
    11001105void dim( char *VarName, const Subscripts &subscripts, const Type &type,const char *InitBuf,const char *ConstractParameter,DWORD dwFlags)
    11011106{
    1102     if( UserProc::IsGlobalAreaCompiling() ){
     1107    if( compiler.IsGlobalAreaCompiling() ){
    11031108        /////////////////////////
    11041109        // グローバル変数
     
    11121117        /////////////////
    11131118
    1114         if( UserProc::CompilingUserProc().GetLocalVars().DuplicateCheck( LexicalAnalyzer::FullNameToSymbol( VarName ) ) ){
     1119        if( compiler.GetCompilingUserProc().GetLocalVars().DuplicateCheck( LexicalAnalyzer::FullNameToSymbol( VarName ), compiler.codeGenerator.lexicalScopes.GetNowLevel() ) ){
    11151120            //2重定義のエラー
    11161121            compiler.errorMessenger.Output(15,VarName,cp);
     
    11201125        bool isConst = ( dwFlags & DIMFLAG_CONST ) ? true:false;
    11211126
    1122         Variable *pVar = new Variable( VarName, type, isConst, false, ConstractParameter, false );
     1127        Variable *pVar = new Variable(
     1128            ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( VarName ),
     1129            type,
     1130            isConst,
     1131            false,
     1132            ConstractParameter,
     1133            false
     1134        );
    11231135
    11241136        if( subscripts.size() > 0 ){
     
    11361148
    11371149        // 変数を追加
    1138         UserProc::CompilingUserProc().GetLocalVars().push_back( pVar );
     1150        compiler.GetCompilingUserProc().GetLocalVars().push_back( pVar );
    11391151
    11401152        //アラインメントを考慮
     
    11531165                // 呼び出し側のオフセットズレを考慮する
    11541166
    1155                 if( 0 == ( UserProc::CompilingUserProc().RealParams().GetMemorySize() + PTR_SIZE/*ret分*/ ) % alignment ){
     1167                if( 0 == ( compiler.GetCompilingUserProc().RealParams().GetMemorySize() + PTR_SIZE /* ret分 */ ) % alignment ){
    11561168                    AllLocalVarSize += PTR_SIZE;
    11571169                }
  • trunk/ab5.0/abdev/compiler_x64/MakePeHdr.cpp

    r528 r584  
    119119
    120120
     121    //"メタ情報を解析中..."
     122    compiler.messenger.Output( STRING_ANALYZING_META_INFO );
     123
     124
    121125    //////////////////////
    122126    // コード生成前の準備
    123127    //////////////////////
    124128
    125     //重複エラー情報管理のメモリを確保(グローバル領域コンパイル用)
    126     extern char **SynonymErrorWords;
    127     extern int SynonymErrorNum;
    128     SynonymErrorNum=0;
    129     SynonymErrorWords=(char **)HeapAlloc(hHeap,0,1);
     129    // 重複エラー情報をクリア
     130    compiler.errorMessenger.ClearSynonymKeyWords();
    130131
    131132    //列挙体に関する情報を収集
    132     compiler.enumInfoCollection.InitEnum();
    133 
    134     //列挙体からクラスコードを生成
    135     char *temp;
    136     temp = compiler.enumInfoCollection.GenerateSourceCode();
    137     AddSourceCode(temp);
    138     HeapDefaultFree(temp);
     133    {
     134        ActiveBasic::Compiler::LexicalAnalyzer::CollectEnums(
     135            compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
     136            compiler.enumInfoCollection
     137        );
     138
     139        // デリゲートからクラスコードを生成
     140        std::string tempSource = ActiveBasic::Compiler::LexicalAnalyzer::GenerateEnumsSourceCode(
     141            compiler.enumInfoCollection
     142        );
     143        AddSourceCode( tempSource.c_str() );
     144    }
    139145
    140146    // 名前空間情報を取得
     
    147153    {
    148154        ActiveBasic::Compiler::LexicalAnalyzer::CollectDelegates(
    149             compiler.GetObjectModule().GetCurrentSource(),
     155            compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    150156            compiler.GetObjectModule().meta.GetDelegates()
    151157        );
     
    167173    );
    168174
    169     //TypeDef情報を初期化
    170     compiler.GetObjectModule().meta.GetTypeDefs().CollectTypeDefs();
     175    //TypeDef情報を収集
     176    ActiveBasic::Compiler::LexicalAnalyzer::CollectTypeDefs(
     177        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
     178        compiler.GetObjectModule().meta.GetTypeDefs()
     179    );
    171180
    172181    /*
     
    180189
    181190    //定数情報を取得
    182     GetConstInfo();
     191    ActiveBasic::Compiler::LexicalAnalyzer::CollectConsts(
     192        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
     193        compiler.GetObjectModule().meta.GetGlobalConsts(),
     194        compiler.GetObjectModule().meta.GetGlobalConstMacros()
     195    );
    183196
    184197    //サブルーチン(ユーザー定義、DLL関数)の識別子、アドレスを取得
    185     compiler.pCompilingClass = NULL;
     198    compiler.SetCompilingClass( NULL );
    186199    ActiveBasic::Compiler::LexicalAnalyzer::CollectProcedures(
    187         compiler.GetObjectModule().GetCurrentSource(),
     200        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    188201        compiler.GetObjectModule().meta.GetUserProcs(),
    189202        compiler.GetObjectModule().meta.GetDllProcs()
     
    320333
    321334
     335    //"コンパイル中..."
     336    compiler.messenger.Output(STRING_COMPILE_COMPILING);
     337
     338
    322339    //////////////////////
    323340    // グローバル実行領域
     
    325342
    326343    cp=-1;
    327     UserProc::CompileStartForGlobalArea();
     344    compiler.StartGlobalAreaCompile();
    328345
    329346    if( !compiler.IsDll() ){
     
    434451    }
    435452
    436     //重複エラー情報管理のメモリを解放(グローバル領域用)
    437     for(i=0;i<SynonymErrorNum;i++) HeapDefaultFree(SynonymErrorWords[i]);
    438     HeapDefaultFree(SynonymErrorWords);
    439 
    440453
    441454    StepCompileProgress();
     
    499512    /////////////////////////////////////////////////////////////////
    500513
    501     compiler.GetObjectModule().meta.GetClasses().GenerateVTables();
     514    ActiveBasic::Compiler::VtblGenerator::GenerateVTablesForAllClasses(
     515        compiler.GetObjectModule().meta.GetClasses()
     516    );
    502517
    503518
     
    10771092    ////////////////////////////////////////
    10781093    //仮想関数データテーブルスケジュール
    1079     compiler.GetObjectModule().meta.GetClasses().ActionVtblSchedule( ImageBase, MemPos_CodeSection, MemPos_DataSection );
     1094    ActiveBasic::Compiler::VtblGenerator::ActionVtblScheduleForAllClasses(
     1095        compiler.GetObjectModule().meta.GetClasses(),
     1096        ImageBase,
     1097        MemPos_CodeSection,
     1098        MemPos_DataSection
     1099    );
    10801100
    10811101
  • trunk/ab5.0/abdev/compiler_x64/NumOpe.cpp

    r528 r584  
    426426
    427427    if( pIsClassName ){
    428         if( compiler.GetObjectModule().meta.GetClasses().Find( termFull ) ){
     428        if( compiler.GetObjectModule().meta.FindClassSupportedTypeDef( termFull ) ){
    429429            *pIsClassName = true;
    430430            return true;
     
    442442
    443443    if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){
    444         if( compiler.pCompilingClass == NULL )
     444        if( !compiler.IsCompilingClass() )
    445445        {
    446446            compiler.errorMessenger.Output(142,NULL,cp);
     
    449449
    450450        //Thisオブジェクト
    451         resultType.SetType( DEF_OBJECT, compiler.pCompilingClass );
     451        resultType.SetType( DEF_OBJECT, &compiler.GetCompilingClass() );
    452452
    453453        SetThisPtrToReg( UseReg );
     
    527527        }
    528528
    529         ConstMacro *pConstMacro = compiler.GetObjectModule().meta.GetGlobalConstMacros().Find( procName );
     529        ConstMacro *pConstMacro = compiler.GetObjectModule().meta.GetGlobalConstMacros().Find(
     530            ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( procName )
     531        );
    530532        if( pConstMacro )
    531533        {
    532             if( pConstMacro->GetCalcBuffer( parameter, temporary ) )
     534            if( ActiveBasic::Compiler::LexicalAnalyzer::ConstMacroToExpression( *pConstMacro, parameter, temporary ) )
    533535            {
    534536                /////////////////////////
     
    11431145                    //////////////
    11441146
    1145                     i3 = compiler.GetObjectModule().meta.GetGlobalConsts().GetBasicType(term);
     1147                    i3 = compiler.GetObjectModule().meta.GetGlobalConsts().GetBasicType(
     1148                        ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term )
     1149                    );
    11461150                    if(i3){
    1147                         if( compiler.GetObjectModule().meta.GetGlobalConsts().IsStringPtr( term ) ){
     1151                        if( compiler.GetObjectModule().meta.GetGlobalConsts().IsStringPtr( ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term ) ) ){
    11481152                            //リテラル文字列
    11491153
     
    11661170                            }
    11671171
    1168                             double dbl = compiler.GetObjectModule().meta.GetGlobalConsts().GetDoubleData(term);
     1172                            double dbl = compiler.GetObjectModule().meta.GetGlobalConsts().GetDoubleData(
     1173                                ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term )
     1174                            );
    11691175                            memcpy(&i64data,&dbl,sizeof(double));
    11701176
     
    11801186                        if(IsRealNumberType(i3)){
    11811187                            //実数
    1182                             double dbl = compiler.GetObjectModule().meta.GetGlobalConsts().GetDoubleData(term);
     1188                            double dbl = compiler.GetObjectModule().meta.GetGlobalConsts().GetDoubleData(
     1189                                ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term )
     1190                            );
    11831191                            memcpy(&i64data,&dbl,sizeof(double));
    11841192                            goto Literal;
     
    11861194                        else if(IsWholeNumberType(i3)){
    11871195                            //整数
    1188                             i64data = compiler.GetObjectModule().meta.GetGlobalConsts().GetWholeData(term);
     1196                            i64data = compiler.GetObjectModule().meta.GetGlobalConsts().GetWholeData(
     1197                                ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term )
     1198                            );
    11891199                            goto Literal;
    11901200                        }
  • trunk/ab5.0/abdev/compiler_x64/compiler_x64.vcproj

    r529 r584  
    337337                    >
    338338                </File>
     339                <File
     340                    RelativePath="..\BasicCompiler_Common\include\ProcedureGenerator.h"
     341                    >
     342                </File>
     343                <File
     344                    RelativePath="..\BasicCompiler_Common\include\VtblGenerator.h"
     345                    >
     346                </File>
    339347                <Filter
    340348                    Name="Language Classes"
     
    12241232                </File>
    12251233                <File
     1234                    RelativePath="..\BasicCompiler_Common\src\LexicalAnalyzer_Const.cpp"
     1235                    >
     1236                </File>
     1237                <File
    12261238                    RelativePath="..\BasicCompiler_Common\src\LexicalAnalyzer_Delegate.cpp"
    12271239                    >
    12281240                </File>
    12291241                <File
     1242                    RelativePath="..\BasicCompiler_Common\src\LexicalAnalyzer_Enum.cpp"
     1243                    >
     1244                </File>
     1245                <File
     1246                    RelativePath="..\BasicCompiler_Common\src\LexicalAnalyzer_Procedure.cpp"
     1247                    >
     1248                </File>
     1249                <File
     1250                    RelativePath="..\BasicCompiler_Common\src\LexicalAnalyzer_TypeDef.cpp"
     1251                    >
     1252                </File>
     1253                <File
    12301254                    RelativePath="..\BasicCompiler_Common\src\Linker.cpp"
    12311255                    >
     
    12331257                <File
    12341258                    RelativePath="..\BasicCompiler_Common\src\Messenger.cpp"
     1259                    >
     1260                </File>
     1261                <File
     1262                    RelativePath="..\BasicCompiler_Common\src\ProcedureGenerator.cpp"
     1263                    >
     1264                </File>
     1265                <File
     1266                    RelativePath="..\BasicCompiler_Common\src\VtblGenerator.cpp"
    12351267                    >
    12361268                </File>
  • trunk/ab5.0/abdev/compiler_x64/stdafx.h

    r529 r584  
    5656#include <Const.h>
    5757#include <Delegate.h>
    58 #include <Enum.h>
    59 #include <DataTable.h>
    6058#include <Exception.h>
    6159#include <Meta.h>
    6260
     61#include <Enum.h>
    6362#include <logger.h>
    6463#include <Configuration.h>
    6564#include <CodeGenerator.h>
    6665#include <Messenger.h>
     66#include <DataTable.h>
    6767#include <ObjectModule.h>
    6868#include <Linker.h>
     
    7171#include <Program.h>
    7272#include <LexicalAnalyzer.h>
     73#include <VtblGenerator.h>
     74#include <ProcedureGenerator.h>
Note: See TracChangeset for help on using the changeset viewer.