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

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

Location:
trunk/ab5.0/abdev/BasicCompiler_Common
Files:
5 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
Note: See TracChangeset for help on using the changeset viewer.