Ignore:
Timestamp:
Aug 12, 2007, 1:25:20 AM (17 years ago)
Author:
dai_9181
Message:
 
File:
1 edited

Legend:

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

    r273 r276  
    66
    77#include <BoostSerializationSupport.h>
    8 
    9 void ObpPlus( int step = 1 );
    108
    119class UserProc;
     
    270268    {
    271269    }
    272     NativeCode( const NativeCode &nativeCode, bool isOpBuffer )
     270    NativeCode( const NativeCode &nativeCode )
    273271        : allocateSize( 8192 )
    274272        , codeBuffer( (char *)malloc( allocateSize ) )
    275273        , size( 0 )
    276274    {
    277         Put( nativeCode, isOpBuffer );
    278     }
    279     NativeCode( const char *codeBuffer, int size, bool isOpBuffer )
     275        Put( nativeCode );
     276    }
     277    NativeCode( const char *codeBuffer, int size )
    280278        : allocateSize( 8192 )
    281279        , codeBuffer( (char *)malloc( allocateSize ) )
    282280        , size( 0 )
    283281    {
    284         Put( codeBuffer, size, isOpBuffer );
     282        Put( codeBuffer, size );
    285283    }
    286284    ~NativeCode()
     
    296294    {
    297295        Clear();
    298         Put( nativeCode, false );
     296        Put( nativeCode );
    299297    }
    300298
     
    316314        return *(long *)(this->codeBuffer+codePos);
    317315    }
    318     long _GetLong_ObpOld( int _obpOld ) const
    319     {
    320         extern char *OpBuffer;
    321         return *(long *)(OpBuffer+_obpOld);
    322     }
    323316
    324317    void Overwrite( int codePos, char c )
     
    326319        codeBuffer[codePos] = c;
    327320    }
    328     void OverwriteOld( int _obpOld, char c )
    329     {
    330         // 未完成
    331         extern char *OpBuffer;
    332         OpBuffer[_obpOld] = c;
    333     }
    334321    void Overwrite( int codePos, long newLongValue )
    335322    {
    336323        *(long *)(this->codeBuffer+codePos) = newLongValue;
    337324    }
    338     void OverwriteOld( int _obpOld, long newLongValue )
    339     {
    340         // 未完成
    341         extern char *OpBuffer;
    342         *(long *)(OpBuffer+_obpOld) = newLongValue;
    343     }
    344 
    345     void Put( const char *codeBuffer, int size, bool isOpBuffer = true )
     325
     326    void Put( const char *codeBuffer, int size )
    346327    {
    347328        Realloc( this->size + size );
     
    349330        memcpy( this->codeBuffer + this->size, codeBuffer, size );
    350331        this->size += size;
    351 
    352         // 未完成
    353         if( isOpBuffer )
    354         {
    355             extern char *OpBuffer;
    356             extern int obp;
    357             memcpy( OpBuffer + obp, codeBuffer, size );
    358             ObpPlus( size );
    359         }
    360     }
    361     void Put( const NativeCode &nativeCode, bool isOpBuffer );
     332    }
     333    void Put( const NativeCode &nativeCode );
    362334    void Put( _int64 i64data )
    363335    {
     
    373345        *((long *)(codeBuffer+size))=l;
    374346        size += sizeof(long);
    375 
    376 
    377 
    378         // 未完成
    379         switch( scheduleType )
    380         {
    381         case Schedule::None:
    382             // 何もしない
    383             break;
    384         case Schedule::GlobalVar:
    385             extern CSchedule *pobj_GlobalVarSchedule;
    386             pobj_GlobalVarSchedule->add();
    387             break;
    388         case Schedule::DataTable:
    389             extern CSchedule *pobj_DataTableSchedule;
    390             pobj_DataTableSchedule->add();
    391             break;
    392         case Schedule::Relocation:
    393             // 未完成
    394             break;
    395         default:
    396             Jenga::Throw( "scheduleTypeが無効な値を保持している" );
    397             break;
    398         }
    399         extern char *OpBuffer;
    400         extern int obp;
    401         *((long *)(OpBuffer+obp))=l;
    402         ObpPlus( sizeof(long) );
    403347    }
    404348    void PutUserProcSchedule( const UserProc *pUserProc, bool isCall );
     
    412356        Realloc( size + 1 );
    413357        codeBuffer[size++] = c;
    414 
    415 
    416 
    417         // 未完成
    418         extern char *OpBuffer;
    419         extern int obp;
    420         OpBuffer[obp]=c;
    421         ObpPlus();
    422358    }
    423359
Note: See TracChangeset for help on using the changeset viewer.