Ignore:
Timestamp:
Jul 27, 2007, 12:06:11 AM (17 years ago)
Author:
dai_9181
Message:
 
Location:
trunk/abdev/BasicCompiler_Common/include
Files:
2 edited

Legend:

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

    r240 r241  
    5252
    5353private:
     54
     55    // 部分スケジュールの管理
    5456    typedef std::vector<PertialSchedule *> PertialSchedules;
    5557    PertialSchedules pertialSchedules;
    5658
     59    // Continue用のコード位置情報の管理
     60    std::vector<long> continueCodePositions;
     61    std::vector<long> _continueCodePositions_ObpOld;
     62
    5763public:
    5864
     
    7884    }
    7985
     86    long GetContinueCodePos() const
     87    {
     88        if( continueCodePositions.size() == 0 )
     89        {
     90            return -1;
     91        }
     92        return continueCodePositions[continueCodePositions.size()-1];
     93    }
     94    void ClearContinueArea()
     95    {
     96        continueCodePositions.clear();
     97        _continueCodePositions_ObpOld.clear();
     98    }
     99    void ContinueAreaBegin()
     100    {
     101        continueCodePositions.push_back( pNativeCode->GetSize() );
     102
     103        extern int obp;
     104        _continueCodePositions_ObpOld.push_back( obp );
     105    }
     106    void ContinueAreaEnd()
     107    {
     108        continueCodePositions.pop_back();
     109        _continueCodePositions_ObpOld.pop_back();
     110    }
     111    long GetContinueCodePosOld() const
     112    {
     113        if( _continueCodePositions_ObpOld.size() == 0 )
     114        {
     115            return -1;
     116        }
     117        return _continueCodePositions_ObpOld[_continueCodePositions_ObpOld.size()-1];
     118    }
     119
    80120    void CheckUnresolveSchedule();
    81121
     
    88128
    89129private:
    90     PertialSchedule *__jmp_op_format( char opcode, long offset, int op_size, bool isPertialSchedule = false );
     130    PertialSchedule *__jmp_op_format( char opcode, long offset, int op_size, bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
    91131public:
    92132    PertialSchedule *op_jle( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     
    100140    PertialSchedule *op_jne( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    101141    PertialSchedule *op_je( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
    102     PertialSchedule *op_jmp( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );
     142    PertialSchedule *op_jmp( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
     143    void op_jmp_continue();
    103144
    104145
  • trunk/abdev/BasicCompiler_Common/include/NativeCode.h

    r237 r241  
    141141        // 未完成
    142142        extern char *OpBuffer;
    143         extern int obp;
    144143        OpBuffer[_obpOld] = c;
     144    }
     145    void Overwrite( int codePos, long newLongValue )
     146    {
     147        *(long *)(this->codeBuffer+codePos) = newLongValue;
     148    }
     149    void OverwriteOld( int _obpOld, long newLongValue )
     150    {
     151        // 未完成
     152        extern char *OpBuffer;
     153        *(long *)(OpBuffer+_obpOld) = newLongValue;
    145154    }
    146155
Note: See TracChangeset for help on using the changeset viewer.