Changeset 250 in dev for trunk/abdev/BasicCompiler_Common


Ignore:
Timestamp:
Jul 29, 2007, 9:30:14 PM (17 years ago)
Author:
dai_9181
Message:

Selectステートメントのスケジュール機構をリファクタリング

Location:
trunk/abdev/BasicCompiler_Common
Files:
5 edited

Legend:

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

    r248 r250  
    2323LABEL *pLabelNames;
    2424int MaxLabelNum;
    25 
    26 //Caseスケジュール
    27 DWORD *pCaseSchedule;
    28 int CaseScheduleNum;
    29 int NowCaseSchedule;
    3025
    3126//グローバル変数初期バッファ
  • trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h

    r248 r250  
    265265    const PertialSchedule *__jmp_op_format( char opcode, long offset, int op_size, bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
    266266public:
    267     const PertialSchedule *op_jle( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    268     const PertialSchedule *op_jbe( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    269     const PertialSchedule *op_jge( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    270     const PertialSchedule *op_jae( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    271     const PertialSchedule *op_jl( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    272     const PertialSchedule *op_jb( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    273     const PertialSchedule *op_jg( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    274     const PertialSchedule *op_ja( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    275     const PertialSchedule *op_jne( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    276     const PertialSchedule *op_je( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     267    const PertialSchedule *op_jle( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     268    const PertialSchedule *op_jbe( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     269    const PertialSchedule *op_jge( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     270    const PertialSchedule *op_jae( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     271    const PertialSchedule *op_jl( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     272    const PertialSchedule *op_jb( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     273    const PertialSchedule *op_jg( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     274    const PertialSchedule *op_ja( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     275    const PertialSchedule *op_jne( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     276    const PertialSchedule *op_je( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
    277277    const PertialSchedule *op_jmp( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
    278278    void op_jmp_continue();
     
    435435    void op_call_R( int reg );
    436436    void op_call(const UserProc *pUserProc);
     437    void op_call(const DllProc *pDllProc);
    437438    void op_ret();
    438439    void op_ret( short stackFrameSize );
  • trunk/abdev/BasicCompiler_Common/include/NativeCode.h

    r245 r250  
    3333        LONG_PTR lpValue;
    3434        const ::UserProc *pUserProc;
     35        const ::DllProc *pDllProc;
    3536    };
    3637
     
    5859        , offset( offset )
    5960        , pUserProc( pUserProc )
     61    {
     62    }
     63    Schedule( const ::DllProc *pDllProc, long offest )
     64        : type( Schedule::UserProc )
     65        , offset( offset )
     66        , pDllProc( pDllProc )
    6067    {
    6168    }
     
    242249    }
    243250    void PutUserProcSchedule( const UserProc *pUserProc, bool isCall );
     251    void PutDllProcSchedule( const DllProc *pDllProc );
    244252    void Put( short s )
    245253    {
  • trunk/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp

    r248 r250  
    158158    return pPertialSchedule;
    159159}
    160 const PertialSchedule *CodeGenerator::op_jle( long offset, int op_size, bool isPertialSchedule )
    161 {
    162     return __jmp_op_format( (char)0x0E, offset, op_size, isPertialSchedule );
    163 }
    164 const PertialSchedule *CodeGenerator::op_jbe( long offset, int op_size, bool isPertialSchedule )
    165 {
    166     return __jmp_op_format( (char)0x06, offset, op_size, isPertialSchedule );
    167 }
    168 const PertialSchedule *CodeGenerator::op_jge( long offset, int op_size, bool isPertialSchedule )
    169 {
    170     return __jmp_op_format( (char)0x0D, offset, op_size, isPertialSchedule );
    171 }
    172 const PertialSchedule *CodeGenerator::op_jae( long offset, int op_size, bool isPertialSchedule )
    173 {
    174     return __jmp_op_format( (char)0x03, offset, op_size, isPertialSchedule );
    175 }
    176 const PertialSchedule *CodeGenerator::op_jl( long offset, int op_size, bool isPertialSchedule )
    177 {
    178     return __jmp_op_format( (char)0x0C, offset, op_size, isPertialSchedule );
    179 }
    180 const PertialSchedule *CodeGenerator::op_jb( long offset, int op_size, bool isPertialSchedule )
    181 {
    182     return __jmp_op_format( (char)0x02, offset, op_size, isPertialSchedule );
    183 }
    184 const PertialSchedule *CodeGenerator::op_jg( long offset, int op_size, bool isPertialSchedule )
    185 {
    186     return __jmp_op_format( (char)0x0F, offset, op_size, isPertialSchedule );
    187 }
    188 const PertialSchedule *CodeGenerator::op_ja( long offset, int op_size, bool isPertialSchedule )
    189 {
    190     return __jmp_op_format( (char)0x07, offset, op_size, isPertialSchedule );
    191 }
    192 const PertialSchedule *CodeGenerator::op_jne( long offset, int op_size, bool isPertialSchedule )
    193 {
    194     return __jmp_op_format( (char)0x05, offset, op_size, isPertialSchedule );
    195 }
    196 const PertialSchedule *CodeGenerator::op_je( long offset, int op_size, bool isPertialSchedule )
    197 {
    198     return __jmp_op_format( (char)0x04, offset, op_size, isPertialSchedule );
     160const PertialSchedule *CodeGenerator::op_jle( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     161{
     162    return __jmp_op_format( (char)0x0E, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
     163}
     164const PertialSchedule *CodeGenerator::op_jbe( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     165{
     166    return __jmp_op_format( (char)0x06, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
     167}
     168const PertialSchedule *CodeGenerator::op_jge( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     169{
     170    return __jmp_op_format( (char)0x0D, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
     171}
     172const PertialSchedule *CodeGenerator::op_jae( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     173{
     174    return __jmp_op_format( (char)0x03, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
     175}
     176const PertialSchedule *CodeGenerator::op_jl( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     177{
     178    return __jmp_op_format( (char)0x0C, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
     179}
     180const PertialSchedule *CodeGenerator::op_jb( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     181{
     182    return __jmp_op_format( (char)0x02, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
     183}
     184const PertialSchedule *CodeGenerator::op_jg( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     185{
     186    return __jmp_op_format( (char)0x0F, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
     187}
     188const PertialSchedule *CodeGenerator::op_ja( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     189{
     190    return __jmp_op_format( (char)0x07, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
     191}
     192const PertialSchedule *CodeGenerator::op_jne( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     193{
     194    return __jmp_op_format( (char)0x05, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
     195}
     196const PertialSchedule *CodeGenerator::op_je( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
     197{
     198    return __jmp_op_format( (char)0x04, offset, op_size, isPertialSchedule, isSelfOpcodeOffset );
    199199}
    200200const PertialSchedule *CodeGenerator::op_jmp( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset )
  • trunk/abdev/BasicCompiler_Common/src/NativeCode.cpp

    r245 r250  
    4848    ObpPlus( sizeof(long) );
    4949}
     50
     51void NativeCode::PutDllProcSchedule( const DllProc *pDllProc )
     52{
     53    pDllProc->Using();
     54
     55    schedules.push_back( Schedule( pDllProc, size ) );
     56
     57    *((long *)(codeBuffer+size))=0;
     58    size += sizeof(long);
     59
     60
     61
     62    // 未完成
     63    pobj_ImportAddrSchedule->add(pDllProc);
     64    extern char *OpBuffer;
     65    extern int obp;
     66    *((long *)(OpBuffer+obp))=0;
     67    ObpPlus( sizeof(long) );
     68}
Note: See TracChangeset for help on using the changeset viewer.