Changeset 585 in dev for trunk/ab5.0


Ignore:
Timestamp:
May 10, 2008, 1:40:33 PM (16 years ago)
Author:
dai_9181
Message:

NativeSectionクラスを追加(64bit版だけ一旦コミット)。

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

Legend:

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

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

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

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

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

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

    r561 r585  
    639639
    640640    std::string dummyStr;
    641     if(!compiler.GetObjectModule().GetSource( pobj_dti->lpdwSourceIndex[pobj_dti->iProcLevel] ).GetLineInfo( pobj_dti->lpdwCp[pobj_dti->iProcLevel], i2, dummyStr )){
     641    if(!compiler.GetObjectModule().nativeSection.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().GetSource( pobj_dti->lpdwSourceIndex[pobj_dti->iProcLevel] ).GetLineInfo( pobj_dti->lpdwCp[pobj_dti->iProcLevel-i2], i3, dummyStr );
     723                compiler.GetObjectModule().nativeSection.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

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

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

    r404 r585  
    11#pragma once
    22
    3 class ObjectModule
     3class NativeSection
    44{
    55public:
    6     // メタ情報
    7     Meta meta;
    8 
    96    // グローバル領域のネイティブコード
    107    NativeCode globalNativeCode;
     
    2219    virtual const char *RootTagName() const
    2320    {
    24         return "objectModule";
     21        return "nativeSection";
    2522    }
    2623    friend class boost::serialization::access;
     
    2926        trace_for_serialize( "serializing - objectModule" );
    3027
    31         ar & BOOST_SERIALIZATION_NVP( meta );
    3228        ar & BOOST_SERIALIZATION_NVP( globalNativeCode );
    3329        ar & BOOST_SERIALIZATION_NVP( dataTable );
     
    3733
    3834public:
    39     void StaticLink( ObjectModule &objectModule );
    40 
    4135    int GetCurrentSourceIndex() const
    4236    {
     
    6357        return sources;
    6458    }
     59};
     60
     61class ObjectModule
     62{
     63public:
     64    // メタ情報
     65    Meta meta;
     66
     67    NativeSection nativeSection;
     68
     69    // XMLシリアライズ用
     70private:
     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
     84public:
     85    void StaticLink( ObjectModule &objectModule );
    6586
    6687    bool Read( const std::string &filePath );
    6788    bool Write( const std::string &filePath ) const;
    68     bool ReadString( const std::string &str );
    69     bool WriteString( std::string &str ) const;
     89    bool Load( const Jenga::Common::Binary &binary );
     90    bool Save( Jenga::Common::Binary &binary ) const;
    7091};
    7192typedef std::vector<ObjectModule *> ObjectModules;
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/VtblGenerator.h

    r559 r585  
    88public:
    99    // vtblを一時的に生成
    10     static LONG_PTR GenerateVTablePart( const Methods &methods );
     10    static int 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

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

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

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

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

    r532 r585  
    9696void ObjectModule::StaticLink( ObjectModule &objectModule )
    9797{
    98     long dataSectionBaseOffset = dataTable.GetSize();
    99     int sourceIndexBase = (int)sources.size();
     98    long dataSectionBaseOffset = this->nativeSection.dataTable.GetSize();
     99    int sourceIndexBase = (int)nativeSection.GetSources().size();
    100100
    101101    // メタ情報を結合
     
    103103
    104104    // グローバル ネイティブコードを結合
    105     objectModule.globalNativeCode.ResetDataSectionBaseOffset( dataSectionBaseOffset );
    106     objectModule.globalNativeCode.ResetSourceIndexes( sourceIndexBase );
    107     globalNativeCode.PutEx( objectModule.globalNativeCode );
     105    objectModule.nativeSection.globalNativeCode.ResetDataSectionBaseOffset( dataSectionBaseOffset );
     106    objectModule.nativeSection.globalNativeCode.ResetSourceIndexes( sourceIndexBase );
     107    nativeSection.globalNativeCode.PutEx( objectModule.nativeSection.globalNativeCode );
    108108
    109109    // データテーブルを結合
    110     objectModule.dataTable.ResetDataSectionBaseOffset( dataSectionBaseOffset );
    111     dataTable.Add( objectModule.dataTable );
     110    objectModule.nativeSection.dataTable.ResetDataSectionBaseOffset( dataSectionBaseOffset );
     111    this->nativeSection.dataTable.Add( objectModule.nativeSection.dataTable );
    112112
    113113    // ソースコードを結合
    114     BOOST_FOREACH( const BasicSource &source, objectModule.sources )
    115     {
    116         this->sources.push_back( source );
     114    BOOST_FOREACH( const BasicSource &source, objectModule.nativeSection.GetSources() )
     115    {
     116        this->nativeSection.GetSources().push_back( source );
    117117    }
    118118
    119119    // TODO: basbufがいらなくなったら消す
    120120    extern char *basbuf;
    121     basbuf = this->sources[0].GetBuffer();
     121    basbuf = this->nativeSection.GetSources()[0].GetBuffer();
    122122}
    123123
    124124bool ObjectModule::Read( const std::string &filePath )
    125125{
    126     // XMLとして読み込む
     126    Jenga::Common::File file( filePath );
     127
     128    Jenga::Common::Binary binary;
     129    if( !file.ReadBinary( binary ) )
     130    {
     131        return false;
     132    }
     133
     134    return Load( binary );
     135}
     136bool ObjectModule::Write( const std::string &filePath ) const
     137{
     138    Jenga::Common::File file( filePath );
     139
     140    Jenga::Common::Binary binary;
     141    if( !Save( binary ) )
     142    {
     143        return false;
     144    }
     145
     146    return file.WriteBinary( binary );
     147}
     148bool ObjectModule::Load( const Jenga::Common::Binary &binary )
     149{
    127150    bool isSuccessful = false;
    128151
     152    // 入力アーカイブの作成
     153
    129154    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 )
    152     {
    153         return false;
    154     }
    155 
    156     return true;
    157 }
    158 bool ObjectModule::Write( const std::string &filePath ) const
    159 {
    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 )
    185     {
    186         return false;
    187     }
    188 
    189     return true;
    190 }
    191 bool ObjectModule::ReadString( const std::string &str )
    192 {
    193     bool isSuccessful = false;
    194 
    195     // 入力アーカイブの作成
    196 
    197     try{
     155        std::string str( binary.GetBuffer(), binary.GetSize() );
     156
    198157#ifdef OBJECT_MODULE_IS_NOT_BINARY
    199158        std::istringstream iss( str );
     
    224183    return true;
    225184}
    226 bool ObjectModule::WriteString( std::string &str ) const
     185bool ObjectModule::Save( Jenga::Common::Binary &binary ) const
    227186{
    228187    // 出力アーカイブの作成
     
    241200        oa << boost::serialization::make_nvp( RootTagName(), *this );
    242201
    243         str = oss.str();
     202        binary.Put( oss.str().c_str(), static_cast<int>(oss.str().size()) );
    244203
    245204        isSuccessful = true;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/ProcedureGenerator.cpp

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

    r559 r585  
    33using namespace ActiveBasic::Compiler;
    44
    5 LONG_PTR VtblGenerator::GenerateVTablePart( const Methods &methods )
     5int VtblGenerator::GenerateVTablePart( const Methods &methods )
    66{
    77    const UserProc **ppsi = (const UserProc **)malloc(methods.GetVtblNum()*sizeof(UserProc *));
     
    2929    }
    3030
    31     LONG_PTR vtableDataTableOffset = compiler.GetObjectModule().dataTable.AddBinary( (void *)ppsi, methods.GetVtblNum()*sizeof(LONG_PTR) );
     31    int vtableDataTableOffset = compiler.GetObjectModule().nativeSection.dataTable.AddBinary( (void *)ppsi, methods.GetVtblNum()*sizeof(LONG_PTR) );
    3232
    3333    for( int i=0; i < methods.GetVtblNum(); i++ )
     
    6161
    6262    // 自身のクラスのvtblを生成
    63     LONG_PTR thisClassVtblOffset = GenerateVTablePart( _class.GetDynamicMethods() );
     63    int thisClassVtblOffset = GenerateVTablePart( _class.GetDynamicMethods() );
    6464    _class.SetVtblOffset( thisClassVtblOffset );
    6565    _class.vtblMasterList.push_back( thisClassVtblOffset );
     
    6868    BOOST_FOREACH( const ::Interface *pInterface, _class.GetInterfaces() )
    6969    {
    70         LONG_PTR tempVtblOffset = GenerateVTablePart( pInterface->GetDynamicMethods() );
     70        int tempVtblOffset = GenerateVTablePart( pInterface->GetDynamicMethods() );
    7171        _class.vtblMasterList.push_back( tempVtblOffset );
    7272
     
    8484
    8585    // vtblマスターリストを生成
    86     int offset = compiler.GetObjectModule().dataTable.AddBinary(
     86    int offset = compiler.GetObjectModule().nativeSection.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().dataTable.GetPtr() + _class.GetVtblOffset());
     121        LONG_PTR *pVtbl = (LONG_PTR *)((char *)compiler.GetObjectModule().nativeSection.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().dataTable.GetPtr() + pInterface->GetVtblOffset());
     140        LONG_PTR *pVtbl = (LONG_PTR *)((char *)compiler.GetObjectModule().nativeSection.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().dataTable.GetPtr() + _class.GetVtblMasterListOffset() );
     157    LONG_PTR *pVtblMasterList = (LONG_PTR *)((char *)compiler.GetObjectModule().nativeSection.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

    r584 r585  
    132132    if(resultType.IsDouble()){
    133133        double dbl=0;
    134         offset=compiler.GetObjectModule().dataTable.Add( dbl );
     134        offset=compiler.GetObjectModule().nativeSection.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().dataTable.Add( flt );
     151        offset=compiler.GetObjectModule().nativeSection.dataTable.Add( flt );
    152152
    153153        //comiss xmm0,dword ptr[data table offset]
  • trunk/ab5.0/abdev/compiler_x64/Compile_Var.cpp

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

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

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

    r468 r585  
    470470        double dbl;
    471471        dbl=-1;
    472         i32data = compiler.GetObjectModule().dataTable.Add( dbl );
     472        i32data = compiler.GetObjectModule().nativeSection.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().dataTable.Add( flt );
     497        i32data = compiler.GetObjectModule().nativeSection.dataTable.Add( flt );
    498498
    499499        //mulss xmm_reg,dword ptr[data table offset]   ※data = -1
  • trunk/ab5.0/abdev/compiler_x64/NumOpe_TypeOperation.cpp

    r468 r585  
    9999            //addsd xmm_reg,qword ptr[offset]   ※offset value:43f0000000000000
    100100            _int64 i64data=0x43f0000000000000;
    101             long temp=compiler.GetObjectModule().dataTable.Add( i64data );
     101            long temp=compiler.GetObjectModule().nativeSection.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().dataTable.Add( i32data );
     161            long temp=compiler.GetObjectModule().nativeSection.dataTable.Add( i32data );
    162162            compiler.codeGenerator.PutOld(
    163163                (char)0xF3,
Note: See TracChangeset for help on using the changeset viewer.