Changeset 551 in dev for trunk


Ignore:
Timestamp:
May 5, 2008, 12:39:50 AM (17 years ago)
Author:
dai_9181
Message:

・PutWithScheduleメソッドを追加。
・NativeCodeクラスが持つCompilerクラスへの依存度を除去した。

Location:
trunk/ab5.0/abdev
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp

    r537 r551  
    744744            }
    745745
    746             compiler.codeGenerator.NextSourceLine();
     746            compiler.codeGenerator.NextSourceLine( compiler.GetObjectModule().GetCurrentSourceIndex() );
    747747
    748748            if(Command[0]==1){
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/CodeGenerator.h

    r524 r551  
    241241    }
    242242
    243     void NextSourceLine()
    244     {
    245         pNativeCode->NextSourceLine();
     243    void NextSourceLine( int currentSourceIndex )
     244    {
     245        pNativeCode->NextSourceLine( currentSourceIndex );
    246246    }
    247247
     
    266266        continueCodePositions.pop_back();
    267267    }
    268    
     268
     269    void PutWithSchedule( long l, Schedule::Type scheduleType );
     270
    269271    void ResolveExitSubSchedule();
    270272
     
    469471    void PutOld( long l, Schedule::Type scheduleType )
    470472    {
    471         pNativeCode->PutEx( l, scheduleType );
     473        this->PutWithSchedule( l, scheduleType );
    472474    }
    473475    const PertialSchedule *PutOld( long l, bool isPertialSchedule )
     
    479481            pPertialSchedule = pertialSchedules.back();
    480482        }
    481         pNativeCode->PutEx( l, Schedule::None );
     483        pNativeCode->Put( l );
    482484        return pPertialSchedule;
    483485    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/NativeCode.h

    r550 r551  
    254254        return sourceLines;
    255255    }
    256     void NextSourceLine();
     256    void NextSourceLine( int currentSourceIndex );
    257257
    258258    void ResetDataSectionBaseOffset( long dataSectionBaseOffset );
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp

    r485 r551  
    1010
    1111
     12void CodeGenerator::PutWithSchedule( long l, Schedule::Type scheduleType )
     13{
     14    if( scheduleType == Schedule::CatchAddress )
     15    {
     16        const UserProc *pCurrentUserProc = compiler.IsGlobalAreaCompiling()
     17            ? UserProc::pGlobalProc
     18            : &compiler.GetCompilingUserProc();
     19
     20        this->pNativeCode->PutCatchAddressSchedule( pCurrentUserProc, l );
     21    }
     22    else
     23    {
     24        this->pNativeCode->PutEx( l, scheduleType );
     25    }
     26}
     27
    1228void CodeGenerator::ResolveExitSubSchedule()
    1329{
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/NativeCode.cpp

    r550 r551  
    5757void NativeCode::PutEx( long l, Schedule::Type scheduleType )
    5858{
    59     if( scheduleType == Schedule::CatchAddress )
     59    if( scheduleType != Schedule::None )
    6060    {
    61         const UserProc *pUserProc = &compiler.GetCompilingUserProc();
    62         if( compiler.IsGlobalAreaCompiling() )
    63         {
    64             pUserProc = UserProc::pGlobalProc;
    65         }
    66         PutCatchAddressSchedule( pUserProc, l );
     61        schedules.push_back( Schedule( scheduleType, GetSize() ) );
    6762    }
    68     else
    69     {
    70         if( scheduleType != Schedule::None )
    71         {
    72             schedules.push_back( Schedule( scheduleType, GetSize() ) );
    73         }
    7463
    75         Put( l );
    76     }
     64    Put( l );
    7765}
    7866
     
    120108}
    121109
    122 void NativeCode::NextSourceLine()
     110void NativeCode::NextSourceLine( int currentSourceIndex )
    123111{
    124112    if( sourceLines.size() )
     
    146134            (long)sourceLines.size(),
    147135            GetSize(),
    148             compiler.GetObjectModule().GetCurrentSourceIndex(),
     136            currentSourceIndex,
    149137            cp,
    150138            sourceLineType
  • trunk/ab5.0/abdev/compiler_x86/x86CodeGenerator.cpp

    r465 r551  
    8282        }
    8383
    84         pNativeCode->PutEx( disp, scheduleType );
     84        this->PutWithSchedule( disp, scheduleType );
    8585    }
    8686
     
    139139            pPertialSchedule = pertialSchedules.back();
    140140        }
    141         pNativeCode->PutEx( offset, offsetScheduleType );
     141        this->PutWithSchedule( offset, offsetScheduleType );
    142142
    143143        pNativeCode->Put( (char)value );
     
    154154            pPertialSchedule = pertialSchedules.back();
    155155        }
    156         pNativeCode->PutEx( offset, offsetScheduleType );
     156        this->PutWithSchedule( offset, offsetScheduleType );
    157157
    158158        pNativeCode->Put( (short)value );
     
    168168            pPertialSchedule = pertialSchedules.back();
    169169        }
    170         pNativeCode->PutEx( offset, offsetScheduleType );
    171 
    172         pNativeCode->PutEx( value, valueScheduleType );
     170        this->PutWithSchedule( offset, offsetScheduleType );
     171
     172        this->PutWithSchedule( value, valueScheduleType );
    173173    }
    174174
     
    188188        pPertialSchedule = pertialSchedules.back();
    189189    }
    190     pNativeCode->PutEx( offset, scheduleType );
     190    this->PutWithSchedule( offset, scheduleType );
    191191
    192192    return pPertialSchedule;
     
    253253            pPertialSchedule = pertialSchedules.back();
    254254        }
    255         pNativeCode->PutEx( offset, scheduleType );
     255        this->PutWithSchedule( offset, scheduleType );
    256256    }
    257257    else{
     
    320320            pPertialSchedule = pertialSchedules.back();
    321321        }
    322         pNativeCode->PutEx( offset, scheduleType );
     322        this->PutWithSchedule( offset, scheduleType );
    323323    }
    324324    else{
     
    476476        pPertialSchedule = pertialSchedules.back();
    477477    }
    478     pNativeCode->PutEx( offset, scheduleType );
     478    this->PutWithSchedule( offset, scheduleType );
    479479
    480480    return pPertialSchedule;
     
    785785        //push 32ビット値
    786786        pNativeCode->Put( (char)0x68 );
    787         pNativeCode->PutEx( data, scheduleType );
     787        this->PutWithSchedule( data, scheduleType );
    788788    }
    789789}
     
    10101010        pPertialSchedule = pertialSchedules.back();
    10111011    }
    1012     pNativeCode->PutEx( offset, scheduleType );
     1012    this->PutWithSchedule( offset, scheduleType );
    10131013
    10141014    return pPertialSchedule;
     
    10471047            pPertialSchedule = pertialSchedules.back();
    10481048        }
    1049         pNativeCode->PutEx( offset, scheduleType );
     1049        this->PutWithSchedule( offset, scheduleType );
    10501050    }
    10511051    else{
     
    11071107        pPertialSchedule = pertialSchedules.back();
    11081108    }
    1109     pNativeCode->PutEx( offset, scheduleType );
     1109    this->PutWithSchedule( offset, scheduleType );
    11101110
    11111111    return pPertialSchedule;
     
    11441144            pPertialSchedule = pertialSchedules.back();
    11451145        }
    1146         pNativeCode->PutEx( offset, scheduleType );
     1146        this->PutWithSchedule( offset, scheduleType );
    11471147    }
    11481148    else{
Note: See TracChangeset for help on using the changeset viewer.