Changeset 238 in dev for trunk/abdev/BasicCompiler_Common


Ignore:
Timestamp:
Jul 26, 2007, 5:22:11 AM (17 years ago)
Author:
dai_9181
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h

    r237 r238  
    1717
    1818public:
     19
     20    // コード生成時の部分的なスケジューリング
    1921    class PertialSchedule
    2022    {
    21         int codePos;
    22         int typeSize;
    23 
    24         int _obpOld;
     23        int id;         // 通し番号
     24
     25        int codePos;    // バッファ位置
     26        int typeSize;   // 対象サイズ(一般的には8bit/32bit)
     27
     28        int _obpOld;    // 未完成
    2529    public:
    2630        PertialSchedule( int codePos, int typeSize )
     
    2832            , typeSize( typeSize )
    2933        {
     34            static int _id = 0;
     35            id = _id++;
     36
    3037            extern int obp;
    31             _obpOld = obp-typeSize;
     38            _obpOld = obp;
    3239        }
    3340        ~PertialSchedule()
    3441        {
     42        }
     43
     44        bool IsEquals( const PertialSchedule &pertialSchedule )
     45        {
     46            return ( this->id == pertialSchedule.id );
    3547        }
    3648
     
    7890    void CheckUnresolveSchedule();
    7991
    80     void opfix_JmpPertialSchedule( const PertialSchedule *pPertialSchedule )
    81     {
    82         PertialSchedules::iterator it = pertialSchedules.begin();
    83         while( it != pertialSchedules.end() )
    84         {
    85             if( &(*it) == pPertialSchedule )
    86             {
    87                 pNativeCode->Overwrite( pPertialSchedule->GetCodePos(), (char)(pNativeCode->GetSize() - pPertialSchedule->GetCodePos()) );
    88 
    89                 // 未完成
    90                 extern int obp;
    91                 pNativeCode->OverwriteOld( pPertialSchedule->GetObpOld(), obp-pPertialSchedule->GetObpOld() );
    92 
    93                 pertialSchedules.erase( it );
    94             }
    95             else
    96             {
    97                 it++;
    98             }
    99         }
    100     }
     92    void opfix_JmpPertialSchedule( const PertialSchedule *pPertialSchedule );
    10193
    10294
     
    108100    PertialSchedule *__jmp_op_format( char opcode, long offset, int op_size, bool isPertialSchedule = false );
    109101public:
    110     void op_jle( long offset, int op_size = sizeof(char) );
    111     void op_jbe( long offset, int op_size = sizeof(char) );
    112     void op_jge( long offset, int op_size = sizeof(char) );
    113     void op_jae( long offset, int op_size = sizeof(char) );
    114     void op_jl( long offset, int op_size = sizeof(char) );
    115     void op_jb( long offset, int op_size = sizeof(char) );
    116     void op_jg( long offset, int op_size = sizeof(char) );
     102    PertialSchedule *op_jle( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     103    PertialSchedule *op_jbe( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     104    PertialSchedule *op_jge( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     105    PertialSchedule *op_jae( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     106    PertialSchedule *op_jl( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     107    PertialSchedule *op_jb( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     108    PertialSchedule *op_jg( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    117109    PertialSchedule *op_ja( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    118110    PertialSchedule *op_jne( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    119     void op_je( long offset, int op_size = sizeof(char) );
    120     void op_jmp( long offset, int op_size = sizeof(char) );
     111    PertialSchedule *op_je( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     112    PertialSchedule *op_jmp( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    121113
    122114
Note: See TracChangeset for help on using the changeset viewer.