Changeset 587 in dev for trunk


Ignore:
Timestamp:
May 10, 2008, 3:09:26 PM (16 years ago)
Author:
dai_9181
Message:

[585][586]をリバース。NativeCodeクラスとMetaクラスは依存関係があるので分離しない方針とする。

Location:
trunk/ab5.0/abdev
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/BreakPoint.cpp

    r585 r587  
    4747    const IncludedFilesRelation *pIncludedFilesRelation = NULL;
    4848    const BasicSource *pNowSource = NULL;
    49     BOOST_FOREACH( const BasicSource &source, compiler.GetObjectModule().nativeSection.GetSources() )
     49    BOOST_FOREACH( const BasicSource &source, compiler.GetObjectModule().GetSources() )
    5050    {
    5151        pIncludedFilesRelation = &source.GetIncludedFilesRelation();
  • trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp

    r585 r587  
    744744            }
    745745
    746             compiler.codeGenerator.NextSourceLine( compiler.GetObjectModule().nativeSection.GetCurrentSourceIndex() );
     746            compiler.codeGenerator.NextSourceLine( compiler.GetObjectModule().GetCurrentSourceIndex() );
    747747
    748748            if(Command[0]==1){
  • trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp

    r585 r587  
    5858    const IncludedFilesRelation *pIncludedFilesRelation = NULL;
    5959    const BasicSource *pNowSource = NULL;
    60     BOOST_FOREACH( const BasicSource &source, compiler.GetObjectModule().nativeSection.GetSources() )
     60    BOOST_FOREACH( const BasicSource &source, compiler.GetObjectModule().GetSources() )
    6161    {
    6262        pIncludedFilesRelation = &source.GetIncludedFilesRelation();
  • trunk/ab5.0/abdev/BasicCompiler_Common/DebugMiddleFile.cpp

    r585 r587  
    7878    {
    7979        // テキストデータにシリアライズ
    80         Jenga::Common::Binary binary;
    81         compiler.GetObjectModule().Save( binary );
     80        std::string textString;
     81        compiler.GetObjectModule().WriteString( textString );
    8282
    8383        // サイズ
    84         *(long *)(buffer+i2) = (long)binary.GetSize();
     84        *(long *)(buffer+i2) = (long)textString.size();
    8585        i2+=sizeof(long);
    8686
    8787        //バッファが足りない場合は再確保
    88         if(BufferSize<i2+(int)binary.GetSize()+32768){
    89             while( BufferSize<i2+(int)binary.GetSize()+32768 )
     88        if(BufferSize<i2+(int)textString.size()+32768){
     89            while( BufferSize<i2+(int)textString.size()+32768 )
    9090            {
    9191                BufferSize+=32768;
     
    9696
    9797        // バッファ
    98         memcpy( buffer+i2, binary.GetBuffer(), binary.GetSize() );
    99         i2 += (int)binary.GetSize();
     98        memcpy( buffer+i2, textString.c_str(), textString.size() );
     99        i2 += (int)textString.size();
    100100    }
    101101
     
    187187
    188188        // バッファ
    189         const Jenga::Common::Binary binary( (const char *)(buffer + i2), size );
     189        const std::string textString( (const char *)(buffer + i2), size );
    190190        i2 += size;
    191191
    192192        // テキストデータからシリアライズ
    193         this->objectModule.Load( binary );
     193        this->objectModule.ReadString( textString );
    194194
    195195        compiler.SelectObjectModule( this->objectModule );
     
    247247    //ソースコード
    248248    extern char *basbuf;
    249     basbuf = const_cast<char *>(compiler.GetObjectModule().nativeSection.GetSource(0).GetBuffer());
     249    basbuf = const_cast<char *>(compiler.GetObjectModule().GetSource(0).GetBuffer());
    250250
    251251
  • trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp

    r585 r587  
    3434
    3535    //最後尾に貼り付け
    36     compiler.GetObjectModule().nativeSection.GetCurrentSource().Addition( temp );
     36    compiler.GetObjectModule().GetCurrentSource().Addition( temp );
    3737
    3838    HeapDefaultFree(temp);
     
    6464
    6565    //プログラムをファイルから読み込む
    66     compiler.GetObjectModule().nativeSection.SetCurrentSourceIndex( (int)compiler.GetObjectModule().nativeSection.GetSources().size() );
    67     compiler.GetObjectModule().nativeSection.GetSources().push_back( BasicSource() );
    68     bool result = compiler.GetObjectModule().nativeSection.GetCurrentSource().ReadFile(
     66    compiler.GetObjectModule().SetCurrentSourceIndex( (int)compiler.GetObjectModule().GetSources().size() );
     67    compiler.GetObjectModule().GetSources().push_back( BasicSource() );
     68    bool result = compiler.GetObjectModule().GetCurrentSource().ReadFile(
    6969        program.GetSourceFilePath(),
    7070        compiler.IsDebug(),
     
    7777        goto EndCompile;
    7878    }
    79     if( !compiler.GetObjectModule().nativeSection.GetCurrentSource().cannotIncludePath.empty() )
     79    if( !compiler.GetObjectModule().GetCurrentSource().cannotIncludePath.empty() )
    8080    {
    8181        compiler.errorMessenger.Output(
    8282            35,
    83             compiler.GetObjectModule().nativeSection.GetCurrentSource().cannotIncludePath,
    84             compiler.GetObjectModule().nativeSection.GetCurrentSource().cannotIncludeSourcePos
     83            compiler.GetObjectModule().GetCurrentSource().cannotIncludePath,
     84            compiler.GetObjectModule().GetCurrentSource().cannotIncludeSourcePos
    8585        );
    8686        goto EndCompile;
     
    142142
    143143    ChangeCommandToCode(basbuf);
    144     compiler.GetObjectModule().nativeSection.GetSources()[0]._ResetLength();
     144    compiler.GetObjectModule().GetSources()[0]._ResetLength();
    145145
    146146    if( compiler.errorMessenger.HasError() || bStopCompile )
  • trunk/ab5.0/abdev/BasicCompiler_Common/VarList.cpp

    r585 r587  
    639639
    640640    std::string dummyStr;
    641     if(!compiler.GetObjectModule().nativeSection.GetSource( pobj_dti->lpdwSourceIndex[pobj_dti->iProcLevel] ).GetLineInfo( pobj_dti->lpdwCp[pobj_dti->iProcLevel], i2, dummyStr )){
     641    if(!compiler.GetObjectModule().GetSource( pobj_dti->lpdwSourceIndex[pobj_dti->iProcLevel] ).GetLineInfo( pobj_dti->lpdwCp[pobj_dti->iProcLevel], i2, dummyStr )){
    642642        extern HWND hMainDlg;
    643643        //"デバッグ情報の取得に失敗"
     
    721721
    722722                std::string dummyStr;
    723                 compiler.GetObjectModule().nativeSection.GetSource( pobj_dti->lpdwSourceIndex[pobj_dti->iProcLevel] ).GetLineInfo( pobj_dti->lpdwCp[pobj_dti->iProcLevel-i2], i3, dummyStr );
     723                compiler.GetObjectModule().GetSource( pobj_dti->lpdwSourceIndex[pobj_dti->iProcLevel] ).GetLineInfo( pobj_dti->lpdwCp[pobj_dti->iProcLevel-i2], i3, dummyStr );
    724724                ShowErrorLine(i3,dummyStr.c_str());
    725725
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h

    r585 r587  
    431431   
    432432private:
    433     int vtbl_offset;
    434     int comVtblOffset;
    435     int vtblMasterListOffset;
     433    long vtbl_offset;
     434    long comVtblOffset;
     435    long vtblMasterListOffset;
    436436public:
    437437    std::vector<long> vtblMasterList;
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Delegate.h

    r585 r587  
    5757    }
    5858
    59     int GetSourceIndex() const
     59    void SetSourceIndex( int sourceIndex )
    6060    {
    61         return sourceIndex;
     61        this->sourceIndex = sourceIndex;
    6262    }
    6363
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/ObjectModule.h

    r585 r587  
    11#pragma once
    22
    3 class NativeSection
     3class ObjectModule
    44{
    55public:
     6    // メタ情報
     7    Meta meta;
     8
    69    // グローバル領域のネイティブコード
    710    NativeCode globalNativeCode;
     
    1922    virtual const char *RootTagName() const
    2023    {
    21         return "nativeSection";
     24        return "objectModule";
    2225    }
    2326    friend class boost::serialization::access;
     
    2629        trace_for_serialize( "serializing - objectModule" );
    2730
     31        ar & BOOST_SERIALIZATION_NVP( meta );
    2832        ar & BOOST_SERIALIZATION_NVP( globalNativeCode );
    2933        ar & BOOST_SERIALIZATION_NVP( dataTable );
     
    3337
    3438public:
     39    void StaticLink( ObjectModule &objectModule );
     40
    3541    int GetCurrentSourceIndex() const
    3642    {
     
    5763        return sources;
    5864    }
    59 };
    60 
    61 class ObjectModule
    62 {
    63 public:
    64     // メタ情報
    65     Meta meta;
    66 
    67     NativeSection nativeSection;
    68 
    69     // XMLシリアライズ用
    70 private:
    71     virtual const char *RootTagName() const
    72     {
    73         return "objectModule";
    74     }
    75     friend class boost::serialization::access;
    76     template<class Archive> void serialize(Archive& ar, const unsigned int version)
    77     {
    78         trace_for_serialize( "serializing - objectModule" );
    79 
    80         ar & BOOST_SERIALIZATION_NVP( meta );
    81         ar & BOOST_SERIALIZATION_NVP( nativeSection );
    82     }
    83 
    84 public:
    85     void StaticLink( ObjectModule &objectModule );
    8665
    8766    bool Read( const std::string &filePath );
    8867    bool Write( const std::string &filePath ) const;
    89     bool Load( const Jenga::Common::Binary &binary );
    90     bool Save( Jenga::Common::Binary &binary ) const;
     68    bool ReadString( const std::string &str );
     69    bool WriteString( std::string &str ) const;
    9170};
    9271typedef std::vector<ObjectModule *> ObjectModules;
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/VtblGenerator.h

    r585 r587  
    88public:
    99    // vtblを一時的に生成
    10     static int GenerateVTablePart( const Methods &methods );
     10    static LONG_PTR GenerateVTablePart( const Methods &methods );
    1111    static void GenerateFullVTables( CClass &_class );
    1212    static void GenerateVTablesForAllClasses( Classes &classes );
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Exception.cpp

    r585 r587  
    201201                lstrcpy( paramName, catchScope.GetParamType().GetClass().GetFullName().c_str() );
    202202            }
    203             paramNameDataTableOffset = compiler.GetObjectModule().nativeSection.dataTable.AddString( paramName );
     203            paramNameDataTableOffset = compiler.GetObjectModule().dataTable.AddString( paramName );
    204204            *((LONG_PTR *)(buffer+pos)) = paramNameDataTableOffset;
    205205            pos += sizeof(LONG_PTR);
     
    210210        }
    211211
    212         int dataTableOffset = compiler.GetObjectModule().nativeSection.dataTable.AddBinary( buffer, size );
     212        int dataTableOffset = compiler.GetObjectModule().dataTable.AddBinary( buffer, size );
    213213
    214214        free( buffer );
     
    218218        {
    219219            // パラメータのクラス名
    220             compiler.GetObjectModule().nativeSection.dataTable.schedules.push_back( Schedule( Schedule::DataTable, dataTableOffset + pos ) );
     220            compiler.GetObjectModule().dataTable.schedules.push_back( Schedule( Schedule::DataTable, dataTableOffset + pos ) );
    221221            pos += sizeof(LONG_PTR);
    222222
     
    227227                pUserProc = UserProc::pGlobalProc;
    228228            }
    229             compiler.GetObjectModule().nativeSection.dataTable.schedules.push_back(
     229            compiler.GetObjectModule().dataTable.schedules.push_back(
    230230                Schedule( Schedule::CatchAddress, pUserProc, dataTableOffset + pos )
    231231            );
     
    407407
    408408    /*
    409     int dataTableOffset = compiler.GetObjectModule().nativeSection.dataTable.Add( static_cast<LONG_PTR>(0) );
     409    int dataTableOffset = compiler.GetObjectModule().dataTable.Add( static_cast<LONG_PTR>(0) );
    410410
    411411#ifdef _WIN64
     
    438438
    439439    /*
    440     int dataTableOffset = compiler.GetObjectModule().nativeSection.dataTable.Add( static_cast<LONG_PTR>(0) );
     440    int dataTableOffset = compiler.GetObjectModule().dataTable.Add( static_cast<LONG_PTR>(0) );
    441441
    442442#ifdef _WIN64
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Delegate.cpp

    r585 r587  
    221221    Jenga::Common::Strings parameterStrings;
    222222    SplitParameter( dg.GetParamStr(), parameterStrings );
    223     ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( dg.GetParameters(), parameterStrings, dg.GetSourceIndex() );
     223    int sourceIndex;
     224    ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( dg.GetParameters(), parameterStrings, sourceIndex );
     225    dg.SetSourceIndex( sourceIndex );
    224226
    225227    // 動的パラメータを作る
     
    233235        if( !compiler.StringToType( dg.GetReturnTypeName(), returnType ) )
    234236        {
    235             compiler.errorMessenger.Output(3,dg.GetReturnTypeName(),dg.GetSourceIndex());
     237            compiler.errorMessenger.Output(3,dg.GetReturnTypeName(),sourceIndex);
    236238        }
    237239        else
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Linker.cpp

    r585 r587  
    255255    }
    256256
    257     nativeCode.PutEx( masterObjectModule.nativeSection.globalNativeCode );
     257    nativeCode.PutEx( masterObjectModule.globalNativeCode );
    258258
    259259    masterObjectModule.meta.GetUserProcs().Iterator_Reset();
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp

    r585 r587  
    4242    if( sourceIndex != -1 )
    4343    {
    44         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetLineInfo( sourceIndex, sourceLineNum, sourceFilePath );
     44        compiler.GetObjectModule().GetCurrentSource().GetLineInfo( sourceIndex, sourceLineNum, sourceFilePath );
    4545    }
    4646
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/ObjectModule.cpp

    r585 r587  
    9696void ObjectModule::StaticLink( ObjectModule &objectModule )
    9797{
    98     long dataSectionBaseOffset = this->nativeSection.dataTable.GetSize();
    99     int sourceIndexBase = (int)nativeSection.GetSources().size();
     98    long dataSectionBaseOffset = dataTable.GetSize();
     99    int sourceIndexBase = (int)sources.size();
    100100
    101101    // メタ情報を結合
     
    103103
    104104    // グローバル ネイティブコードを結合
    105     objectModule.nativeSection.globalNativeCode.ResetDataSectionBaseOffset( dataSectionBaseOffset );
    106     objectModule.nativeSection.globalNativeCode.ResetSourceIndexes( sourceIndexBase );
    107     nativeSection.globalNativeCode.PutEx( objectModule.nativeSection.globalNativeCode );
     105    objectModule.globalNativeCode.ResetDataSectionBaseOffset( dataSectionBaseOffset );
     106    objectModule.globalNativeCode.ResetSourceIndexes( sourceIndexBase );
     107    globalNativeCode.PutEx( objectModule.globalNativeCode );
    108108
    109109    // データテーブルを結合
    110     objectModule.nativeSection.dataTable.ResetDataSectionBaseOffset( dataSectionBaseOffset );
    111     this->nativeSection.dataTable.Add( objectModule.nativeSection.dataTable );
     110    objectModule.dataTable.ResetDataSectionBaseOffset( dataSectionBaseOffset );
     111    dataTable.Add( objectModule.dataTable );
    112112
    113113    // ソースコードを結合
    114     BOOST_FOREACH( const BasicSource &source, objectModule.nativeSection.GetSources() )
    115     {
    116         this->nativeSection.GetSources().push_back( source );
     114    BOOST_FOREACH( const BasicSource &source, objectModule.sources )
     115    {
     116        this->sources.push_back( source );
    117117    }
    118118
    119119    // TODO: basbufがいらなくなったら消す
    120120    extern char *basbuf;
    121     basbuf = this->nativeSection.GetSources()[0].GetBuffer();
     121    basbuf = this->sources[0].GetBuffer();
    122122}
    123123
    124124bool ObjectModule::Read( const std::string &filePath )
    125125{
    126     Jenga::Common::File file( filePath );
    127 
    128     Jenga::Common::Binary binary;
    129     if( !file.ReadBinary( binary ) )
     126    // XMLとして読み込む
     127    bool isSuccessful = false;
     128
     129    try{
     130#ifdef OBJECT_MODULE_IS_NOT_BINARY
     131        std::ifstream ifs( filePath.c_str() );
     132        boost::archive::xml_iarchive ia(ifs);
     133#else
     134        std::ifstream ifs( filePath.c_str(), std::ios::in | std::ios::binary );
     135        boost::archive::binary_iarchive ia(ifs);
     136#endif
     137
     138        // ファイルから読込
     139        ia >> boost::serialization::make_nvp( RootTagName(), *this );
     140
     141        isSuccessful = true;
     142    }
     143    catch( boost::archive::archive_exception e )
     144    {
     145        MessageBox( NULL, e.what(), "XMLシリアライズの例外", MB_OK );
     146    }
     147    catch(...){
     148        MessageBox( NULL, "archive_exception以外の不明な例外", "XMLシリアライズの例外", MB_OK );
     149    }
     150
     151    if( !isSuccessful )
    130152    {
    131153        return false;
    132154    }
    133155
    134     return Load( binary );
     156    return true;
    135157}
    136158bool ObjectModule::Write( const std::string &filePath ) const
    137159{
    138     Jenga::Common::File file( filePath );
    139 
    140     Jenga::Common::Binary binary;
    141     if( !Save( binary ) )
     160    bool isSuccessful = false;
     161
     162    try{
     163#ifdef OBJECT_MODULE_IS_NOT_BINARY
     164        std::ofstream ofs( filePath.c_str() );
     165        boost::archive::xml_oarchive oa(ofs);
     166#else
     167        std::ofstream ofs( filePath.c_str(), std::ios::out | std::ios::binary );
     168        boost::archive::binary_oarchive oa(ofs);
     169#endif
     170
     171        // ファイルに書き出し
     172        oa << boost::serialization::make_nvp( RootTagName(), *this );
     173
     174        isSuccessful = true;
     175    }
     176    catch( boost::archive::archive_exception e )
     177    {
     178        MessageBox( NULL, e.what(), "XMLシリアライズの例外", MB_OK );
     179    }
     180    catch(...){
     181        MessageBox( NULL, "archive_exception以外の不明な例外", "XMLシリアライズの例外", MB_OK );
     182    }
     183
     184    if( !isSuccessful )
    142185    {
    143186        return false;
    144187    }
    145188
    146     return file.WriteBinary( binary );
    147 }
    148 bool ObjectModule::Load( const Jenga::Common::Binary &binary )
     189    return true;
     190}
     191bool ObjectModule::ReadString( const std::string &str )
    149192{
    150193    bool isSuccessful = false;
     
    153196
    154197    try{
    155         std::string str( binary.GetBuffer(), binary.GetSize() );
    156 
    157198#ifdef OBJECT_MODULE_IS_NOT_BINARY
    158199        std::istringstream iss( str );
     
    183224    return true;
    184225}
    185 bool ObjectModule::Save( Jenga::Common::Binary &binary ) const
     226bool ObjectModule::WriteString( std::string &str ) const
    186227{
    187228    // 出力アーカイブの作成
     
    200241        oa << boost::serialization::make_nvp( RootTagName(), *this );
    201242
    202         binary.Put( oss.str().c_str(), static_cast<int>(oss.str().size()) );
     243        str = oss.str();
    203244
    204245        isSuccessful = true;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/ProcedureGenerator.cpp

    r585 r587  
    113113
    114114        objClass.SetTypeInfoDataTableOffset(
    115             compiler.GetObjectModule().nativeSection.dataTable.GetLastMadeConstObjectDataTableOffset()
     115            compiler.GetObjectModule().dataTable.GetLastMadeConstObjectDataTableOffset()
    116116        );
    117117    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/VtblGenerator.cpp

    r585 r587  
    33using namespace ActiveBasic::Compiler;
    44
    5 int VtblGenerator::GenerateVTablePart( const Methods &methods )
     5LONG_PTR VtblGenerator::GenerateVTablePart( const Methods &methods )
    66{
    77    const UserProc **ppsi = (const UserProc **)malloc(methods.GetVtblNum()*sizeof(UserProc *));
     
    2929    }
    3030
    31     int vtableDataTableOffset = compiler.GetObjectModule().nativeSection.dataTable.AddBinary( (void *)ppsi, methods.GetVtblNum()*sizeof(LONG_PTR) );
     31    LONG_PTR vtableDataTableOffset = compiler.GetObjectModule().dataTable.AddBinary( (void *)ppsi, methods.GetVtblNum()*sizeof(LONG_PTR) );
    3232
    3333    for( int i=0; i < methods.GetVtblNum(); i++ )
     
    6161
    6262    // 自身のクラスのvtblを生成
    63     int thisClassVtblOffset = GenerateVTablePart( _class.GetDynamicMethods() );
     63    LONG_PTR thisClassVtblOffset = GenerateVTablePart( _class.GetDynamicMethods() );
    6464    _class.SetVtblOffset( thisClassVtblOffset );
    6565    _class.vtblMasterList.push_back( thisClassVtblOffset );
     
    6868    BOOST_FOREACH( const ::Interface *pInterface, _class.GetInterfaces() )
    6969    {
    70         int tempVtblOffset = GenerateVTablePart( pInterface->GetDynamicMethods() );
     70        LONG_PTR tempVtblOffset = GenerateVTablePart( pInterface->GetDynamicMethods() );
    7171        _class.vtblMasterList.push_back( tempVtblOffset );
    7272
     
    8484
    8585    // vtblマスターリストを生成
    86     int offset = compiler.GetObjectModule().nativeSection.dataTable.AddBinary(
     86    int offset = compiler.GetObjectModule().dataTable.AddBinary(
    8787        (void *)&_class.vtblMasterList[0],
    8888        static_cast<int>(_class.vtblMasterList.size()*sizeof(LONG_PTR))
     
    119119    // 自身のクラスのvtbl
    120120    {
    121         LONG_PTR *pVtbl = (LONG_PTR *)((char *)compiler.GetObjectModule().nativeSection.dataTable.GetPtr() + _class.GetVtblOffset());
     121        LONG_PTR *pVtbl = (LONG_PTR *)((char *)compiler.GetObjectModule().dataTable.GetPtr() + _class.GetVtblOffset());
    122122
    123123        for( int i=0; i<_class.GetVtblNum(); i++ ){
     
    138138    BOOST_FOREACH( const ::Interface *pInterface, _class.GetInterfaces() )
    139139    {
    140         LONG_PTR *pVtbl = (LONG_PTR *)((char *)compiler.GetObjectModule().nativeSection.dataTable.GetPtr() + pInterface->GetVtblOffset());
     140        LONG_PTR *pVtbl = (LONG_PTR *)((char *)compiler.GetObjectModule().dataTable.GetPtr() + pInterface->GetVtblOffset());
    141141
    142142        for( int i=0; i<pInterface->GetClass().GetVtblNum(); i++ ){
     
    155155
    156156    // vtblマスターリスト
    157     LONG_PTR *pVtblMasterList = (LONG_PTR *)((char *)compiler.GetObjectModule().nativeSection.dataTable.GetPtr() + _class.GetVtblMasterListOffset() );
     157    LONG_PTR *pVtblMasterList = (LONG_PTR *)((char *)compiler.GetObjectModule().dataTable.GetPtr() + _class.GetVtblMasterListOffset() );
    158158    for( int i=0; i<static_cast<int>(_class.vtblMasterList.size()); i++ )
    159159    {
  • trunk/ab5.0/abdev/compiler_x64/Compile_Statement.cpp

    r585 r587  
    132132    if(resultType.IsDouble()){
    133133        double dbl=0;
    134         offset=compiler.GetObjectModule().nativeSection.dataTable.Add( dbl );
     134        offset=compiler.GetObjectModule().dataTable.Add( dbl );
    135135
    136136        //comisd xmm0,qword ptr[data table offset]
     
    149149    else if(resultType.IsSingle()){
    150150        float flt=0;
    151         offset=compiler.GetObjectModule().nativeSection.dataTable.Add( flt );
     151        offset=compiler.GetObjectModule().dataTable.Add( flt );
    152152
    153153        //comiss xmm0,dword ptr[data table offset]
  • trunk/ab5.0/abdev/compiler_x64/Compile_Var.cpp

    r585 r587  
    884884            char *temp;
    885885            temp=(char *)i64data;
    886             i2=compiler.GetObjectModule().nativeSection.dataTable.AddString( temp );
     886            i2=compiler.GetObjectModule().dataTable.AddString( temp );
    887887            HeapDefaultFree(temp);
    888888
     
    10531053            char *temp;
    10541054            temp=(char *)i64data;
    1055             i2=compiler.GetObjectModule().nativeSection.dataTable.AddString( temp );
     1055            i2=compiler.GetObjectModule().dataTable.AddString( temp );
    10561056            HeapDefaultFree(temp);
    10571057
  • trunk/ab5.0/abdev/compiler_x64/MakePeHdr.cpp

    r585 r587  
    115115    if( compiler.IsDebug() )
    116116    {
    117         compiler.GetObjectModule().nativeSection.dataTable.Add( (long)0x00000002 );
     117        compiler.GetObjectModule().dataTable.Add( (long)0x00000002 );
    118118    }
    119119
     
    133133    {
    134134        ActiveBasic::Compiler::LexicalAnalyzer::CollectEnums(
    135             compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     135            compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    136136            compiler.enumInfoCollection
    137137        );
     
    146146    // 名前空間情報を取得
    147147    ActiveBasic::Compiler::LexicalAnalyzer::CollectNamespaces(
    148         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     148        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    149149        compiler.GetObjectModule().meta.GetNamespaces()
    150150    );
     
    153153    {
    154154        ActiveBasic::Compiler::LexicalAnalyzer::CollectDelegates(
    155             compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     155            compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    156156            compiler.GetObjectModule().meta.GetDelegates()
    157157        );
     
    169169    //     ※オブジェクトの内容までは取得しない
    170170    ActiveBasic::Compiler::LexicalAnalyzer::CollectClassesForNameOnly(
    171         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     171        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    172172        compiler.GetObjectModule().meta.GetClasses()
    173173    );
     
    175175    //TypeDef情報を収集
    176176    ActiveBasic::Compiler::LexicalAnalyzer::CollectTypeDefs(
    177         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     177        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    178178        compiler.GetObjectModule().meta.GetTypeDefs()
    179179    );
     
    190190    //定数情報を取得
    191191    ActiveBasic::Compiler::LexicalAnalyzer::CollectConsts(
    192         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     192        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    193193        compiler.GetObjectModule().meta.GetGlobalConsts(),
    194194        compiler.GetObjectModule().meta.GetGlobalConstMacros()
     
    198198    compiler.SetCompilingClass( NULL );
    199199    ActiveBasic::Compiler::LexicalAnalyzer::CollectProcedures(
    200         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     200        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    201201        compiler.GetObjectModule().meta.GetUserProcs(),
    202202        compiler.GetObjectModule().meta.GetDllProcs()
     
    205205    // クラス情報を取得(※注 - CollectProceduresの後に呼び出す)
    206206    ActiveBasic::Compiler::LexicalAnalyzer::CollectClasses(
    207         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     207        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    208208        compiler.GetObjectModule().meta.GetClasses()
    209209    );
     
    369369
    370370        // コード生成対象を選択
    371         compiler.codeGenerator.Select( compiler.GetObjectModule().nativeSection.globalNativeCode );
     371        compiler.codeGenerator.Select( compiler.GetObjectModule().globalNativeCode );
    372372
    373373        trace_for_sourcecodestep( "★★★ グローバル領域のコンパイルを開始" );
     
    903903
    904904    //データセクションのファイル上のサイズ
    905     if(compiler.GetObjectModule().nativeSection.dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=compiler.GetObjectModule().nativeSection.dataTable.GetSize()+(FILE_ALIGNMENT-compiler.GetObjectModule().nativeSection.dataTable.GetSize()%FILE_ALIGNMENT);
    906     else FileSize_DataSection=compiler.GetObjectModule().nativeSection.dataTable.GetSize();
     905    if(compiler.GetObjectModule().dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=compiler.GetObjectModule().dataTable.GetSize()+(FILE_ALIGNMENT-compiler.GetObjectModule().dataTable.GetSize()%FILE_ALIGNMENT);
     906    else FileSize_DataSection=compiler.GetObjectModule().dataTable.GetSize();
    907907    if(FileSize_DataSection) bUse_DataSection=1;
    908908    else bUse_DataSection=0;
     
    11051105    }
    11061106
    1107     compiler.linker.SetDataTable( compiler.GetObjectModule().nativeSection.dataTable );
     1107    compiler.linker.SetDataTable( compiler.GetObjectModule().dataTable );
    11081108
    11091109    compiler.linker.SetImageBase( ImageBase );
  • trunk/ab5.0/abdev/compiler_x64/NumOpe.cpp

    r585 r587  
    763763
    764764        int dataTableOffset;
    765         if( !compiler.GetObjectModule().nativeSection.dataTable.MakeLiteralArrayBuffer( expression, baseType, dataTableOffset ) )
     765        if( !compiler.GetObjectModule().dataTable.MakeLiteralArrayBuffer( expression, baseType, dataTableOffset ) )
    766766        {
    767767            return false;
     
    792792
    793793                if(resultType.IsDouble()){
    794                     i3 = compiler.GetObjectModule().nativeSection.dataTable.Add( i64data );
     794                    i3 = compiler.GetObjectModule().dataTable.Add( i64data );
    795795
    796796                    //movlpd xmm_reg,qword ptr[data table offset]
     
    806806                    memcpy(&i32data,&flt,sizeof(long));
    807807
    808                     i3 = compiler.GetObjectModule().nativeSection.dataTable.Add( i32data );
     808                    i3 = compiler.GetObjectModule().dataTable.Add( i32data );
    809809
    810810                    //movss xmm_reg,dword ptr[data table offset]
     
    866866            // 静的領域にオブジェクトを生成
    867867            int dataTableOffset;
    868             if( !compiler.GetObjectModule().nativeSection.dataTable.MakeConstObjectToProcessStaticBuffer( expression + 2, resultType, dataTableOffset ) )
     868            if( !compiler.GetObjectModule().dataTable.MakeConstObjectToProcessStaticBuffer( expression + 2, resultType, dataTableOffset ) )
    869869            {
    870870                return false;
     
    10201020
    10211021                        //String型オブジェクトを生成
    1022                         i2 = compiler.GetObjectModule().nativeSection.dataTable.MakeConstStringObjectToProcessStaticBuffer( term );
     1022                        i2 = compiler.GetObjectModule().dataTable.MakeConstStringObjectToProcessStaticBuffer( term );
    10231023
    10241024                        //mov reg,i2
     
    10411041                    bLiteralCalculation=0;
    10421042
    1043                     i2 = compiler.GetObjectModule().nativeSection.dataTable.AddString( term, i3 );
     1043                    i2 = compiler.GetObjectModule().dataTable.AddString( term, i3 );
    10441044
    10451045                    //mov reg,i2
     
    12281228                        }
    12291229                        else{
    1230                             i3 = compiler.GetObjectModule().nativeSection.dataTable.Add( i64data );
     1230                            i3 = compiler.GetObjectModule().dataTable.Add( i64data );
    12311231
    12321232                            //movlpd xmm_reg,qword ptr[data table offset]
     
    12501250                        }
    12511251                        else{
    1252                             i3=compiler.GetObjectModule().nativeSection.dataTable.Add( i32data );
     1252                            i3=compiler.GetObjectModule().dataTable.Add( i32data );
    12531253
    12541254                            //movss xmm_reg,dword ptr[data table offset]
  • trunk/ab5.0/abdev/compiler_x64/NumOpe_Arithmetic.cpp

    r585 r587  
    470470        double dbl;
    471471        dbl=-1;
    472         i32data = compiler.GetObjectModule().nativeSection.dataTable.Add( dbl );
     472        i32data = compiler.GetObjectModule().dataTable.Add( dbl );
    473473
    474474        //mulsd xmm_reg,qword ptr[data table offset]   ※data = -1
     
    495495        float flt;
    496496        flt=-1;
    497         i32data = compiler.GetObjectModule().nativeSection.dataTable.Add( flt );
     497        i32data = compiler.GetObjectModule().dataTable.Add( flt );
    498498
    499499        //mulss xmm_reg,dword ptr[data table offset]   ※data = -1
  • trunk/ab5.0/abdev/compiler_x64/NumOpe_TypeOperation.cpp

    r585 r587  
    9999            //addsd xmm_reg,qword ptr[offset]   ※offset value:43f0000000000000
    100100            _int64 i64data=0x43f0000000000000;
    101             long temp=compiler.GetObjectModule().nativeSection.dataTable.Add( i64data );
     101            long temp=compiler.GetObjectModule().dataTable.Add( i64data );
    102102            compiler.codeGenerator.PutOld(
    103103                (char)0xF2,
     
    159159            //addss xmm_reg,dword ptr[offset]   ※offset value:5f800000
    160160            long i32data=0x5f800000;
    161             long temp=compiler.GetObjectModule().nativeSection.dataTable.Add( i32data );
     161            long temp=compiler.GetObjectModule().dataTable.Add( i32data );
    162162            compiler.codeGenerator.PutOld(
    163163                (char)0xF3,
  • trunk/ab5.0/abdev/compiler_x86/Compile_Var.cpp

    r586 r587  
    876876            char *temp;
    877877            temp=(char *)i64data;
    878             i2=compiler.GetObjectModule().nativeSection.dataTable.AddString(temp,lstrlen(temp));
     878            i2=compiler.GetObjectModule().dataTable.AddString(temp,lstrlen(temp));
    879879            HeapDefaultFree(temp);
    880880
     
    10651065            char *temp;
    10661066            temp=(char *)i64data;
    1067             i2=compiler.GetObjectModule().nativeSection.dataTable.AddString(temp,lstrlen(temp));
     1067            i2=compiler.GetObjectModule().dataTable.AddString(temp,lstrlen(temp));
    10681068            HeapDefaultFree(temp);
    10691069
  • trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp

    r586 r587  
    125125    // データテーブル
    126126    if( compiler.IsDebug() ){
    127         compiler.GetObjectModule().nativeSection.dataTable.Add( (long)0x00000002 );
     127        compiler.GetObjectModule().dataTable.Add( (long)0x00000002 );
    128128    }
    129129
     
    143143    {
    144144        ActiveBasic::Compiler::LexicalAnalyzer::CollectEnums(
    145             compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     145            compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    146146            compiler.enumInfoCollection
    147147        );
     
    156156    // 名前空間情報を取得
    157157    ActiveBasic::Compiler::LexicalAnalyzer::CollectNamespaces(
    158         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     158        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    159159        compiler.GetObjectModule().meta.GetNamespaces()
    160160    );
     
    163163    {
    164164        ActiveBasic::Compiler::LexicalAnalyzer::CollectDelegates(
    165             compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     165            compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    166166            compiler.GetObjectModule().meta.GetDelegates()
    167167        );
     
    179179    //     ※オブジェクトの内容までは取得しない
    180180    ActiveBasic::Compiler::LexicalAnalyzer::CollectClassesForNameOnly(
    181         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     181        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    182182        compiler.GetObjectModule().meta.GetClasses()
    183183    );
     
    185185    //TypeDef情報を収集
    186186    ActiveBasic::Compiler::LexicalAnalyzer::CollectTypeDefs(
    187         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     187        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    188188        compiler.GetObjectModule().meta.GetTypeDefs()
    189189    );
     
    200200    //定数情報を取得
    201201    ActiveBasic::Compiler::LexicalAnalyzer::CollectConsts(
    202         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     202        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    203203        compiler.GetObjectModule().meta.GetGlobalConsts(),
    204204        compiler.GetObjectModule().meta.GetGlobalConstMacros()
     
    208208    compiler.SetCompilingClass( NULL );
    209209    ActiveBasic::Compiler::LexicalAnalyzer::CollectProcedures(
    210         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     210        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    211211        compiler.GetObjectModule().meta.GetUserProcs(),
    212212        compiler.GetObjectModule().meta.GetDllProcs()
     
    215215    // クラス情報を取得(※注 - CollectProceduresの後に呼び出す)
    216216    ActiveBasic::Compiler::LexicalAnalyzer::CollectClasses(
    217         compiler.GetObjectModule().nativeSection.GetCurrentSource().GetBuffer(),
     217        compiler.GetObjectModule().GetCurrentSource().GetBuffer(),
    218218        compiler.GetObjectModule().meta.GetClasses()
    219219    );
     
    406406
    407407        // コード生成対象を選択
    408         compiler.codeGenerator.Select( compiler.GetObjectModule().nativeSection.globalNativeCode );
     408        compiler.codeGenerator.Select( compiler.GetObjectModule().globalNativeCode );
    409409
    410410        trace_for_sourcecodestep( "★★★ グローバル領域のコンパイルを開始" );
     
    900900
    901901    //データセクションのファイル上のサイズ
    902     if(compiler.GetObjectModule().nativeSection.dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=compiler.GetObjectModule().nativeSection.dataTable.GetSize()+(FILE_ALIGNMENT-compiler.GetObjectModule().nativeSection.dataTable.GetSize()%FILE_ALIGNMENT);
    903     else FileSize_DataSection=compiler.GetObjectModule().nativeSection.dataTable.GetSize();
     902    if(compiler.GetObjectModule().dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=compiler.GetObjectModule().dataTable.GetSize()+(FILE_ALIGNMENT-compiler.GetObjectModule().dataTable.GetSize()%FILE_ALIGNMENT);
     903    else FileSize_DataSection=compiler.GetObjectModule().dataTable.GetSize();
    904904    if(FileSize_DataSection) bUse_DataSection=1;
    905905    else bUse_DataSection=0;
     
    11041104    }
    11051105
    1106     compiler.linker.SetDataTable( compiler.GetObjectModule().nativeSection.dataTable );
     1106    compiler.linker.SetDataTable( compiler.GetObjectModule().dataTable );
    11071107
    11081108    compiler.linker.SetImageBase( ImageBase );
  • trunk/ab5.0/abdev/compiler_x86/NumOpe.cpp

    r586 r587  
    718718
    719719        int dataTableOffset;
    720         if( !compiler.GetObjectModule().nativeSection.dataTable.MakeLiteralArrayBuffer( expression, baseType, dataTableOffset ) )
     720        if( !compiler.GetObjectModule().dataTable.MakeLiteralArrayBuffer( expression, baseType, dataTableOffset ) )
    721721        {
    722722            return false;
     
    798798            // 静的領域にオブジェクトを生成
    799799            int dataTableOffset;
    800             if( !compiler.GetObjectModule().nativeSection.dataTable.MakeConstObjectToProcessStaticBuffer( expression + 2, resultType, dataTableOffset ) )
     800            if( !compiler.GetObjectModule().dataTable.MakeConstObjectToProcessStaticBuffer( expression + 2, resultType, dataTableOffset ) )
    801801            {
    802802                return false;
     
    941941
    942942                        //String型オブジェクトを生成
    943                         i2 = compiler.GetObjectModule().nativeSection.dataTable.MakeConstStringObjectToProcessStaticBuffer( term );
     943                        i2 = compiler.GetObjectModule().dataTable.MakeConstStringObjectToProcessStaticBuffer( term );
    944944                       
    945945                        // push value
     
    957957                    bLiteralCalculation=0;
    958958
    959                     i2=compiler.GetObjectModule().nativeSection.dataTable.AddString(term,i3);
     959                    i2=compiler.GetObjectModule().dataTable.AddString(term,i3);
    960960
    961961                    //push DataSize
Note: See TracChangeset for help on using the changeset viewer.