Changeset 63 in dev for BasicCompiler64


Ignore:
Timestamp:
Feb 23, 2007, 2:12:26 AM (18 years ago)
Author:
dai_9181
Message:

CClass::GetSize、CClass::GetMemberOffsetを追加

Location:
BasicCompiler64
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/CParameter.cpp

    r59 r63  
    118118    //////////////////////////////////////////////////////
    119119
    120         int object_size;
    121         object_size=GetSizeOfClass(pobj_Class);
     120        int object_size = pobj_Class->GetSize();
    122121
    123122        //mov rcx,object_size
  • BasicCompiler64/Compile_CallProc.cpp

    r51 r63  
    267267        //////////////////////////////////////////////////////
    268268
    269             int object_size;
    270             object_size=GetSizeOfClass(psi->u.Return_pobj_c);
     269            int object_size = psi->u.Return_pobj_c->GetSize();
    271270
    272271            //mov rcx,object_size
  • BasicCompiler64/Compile_ProcOp.cpp

    r51 r63  
    569569
    570570            //実体クラスを持つメンバのコンストラクタ(引数有りを除く)を呼び出す
    571             int offset;
    572             int MemberTypeSize;
    573             int MemberObjectNum;
    574             if(pobj_CompilingClass->vtbl_num) offset=PTR_SIZE;
    575             else offset=0;
    576571            for(i3=0;i3<pobj_CompilingClass->iMemberNum;i3++){
    577572                CMember *pMember = pobj_CompilingClass->ppobj_Member[i3];
    578                 MemberTypeSize=
     573                int MemberTypeSize=
    579574                    GetTypeSize(pMember->TypeInfo.type,
    580575                        pMember->TypeInfo.u.lpIndex);
    581576
    582                 MemberObjectNum=
     577                int MemberObjectNum=
    583578                    JumpSubScripts(pMember->SubScripts);
    584579
    585                 offset=GetSizeOfClassMember(pobj_CompilingClass,pMember->name,NULL);
     580                int offset = pobj_CompilingClass->GetMemberOffset( pMember->name, NULL );
    586581
    587582                if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){
     
    608603                pobj_CompilingClass->IsAbstract()==false){
    609604                    //関数テーブルに値をセット
    610                     offset=(int)pobj_CompilingClass->GetVtblGlobalOffset();
     605                    int offset = (int)pobj_CompilingClass->GetVtblGlobalOffset();
    611606
    612607                    //mov rax,offset
     
    672667            //実体クラスを持つメンバのデストラクタを呼び出す
    673668            //※コンストラクタと逆順序で呼び出す
    674             int offset;
    675             int MemberTypeSize;
    676             int MemberObjectNum;
    677669            for(i3=pobj_CompilingClass->iMemberNum-1;i3>=0;i3--){
    678670                CMember *pMember = pobj_CompilingClass->ppobj_Member[i3];
    679                 MemberTypeSize=
     671                int MemberTypeSize=
    680672                    GetTypeSize(pMember->TypeInfo.type,
    681673                        pMember->TypeInfo.u.lpIndex);
    682674
    683                 MemberObjectNum=
     675                int MemberObjectNum=
    684676                    JumpSubScripts(pMember->SubScripts);
    685677
    686                 offset=GetSizeOfClassMember(pobj_CompilingClass,pMember->name,NULL);
     678                int offset = pobj_CompilingClass->GetMemberOffset( pMember->name, NULL );
    687679
    688680                if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){
  • BasicCompiler64/Compile_Set_Var.cpp

    r62 r63  
    9393                op_mov_RR(REG_RDI,VarReg);
    9494
    95                 int object_size = GetSizeOfClass((CClass *)lpVarIndex);
     95                CClass *pClass = (CClass *)lpVarIndex;
     96                int object_size = pClass->GetSize();
    9697
    9798                //mov rcx,object_size
  • BasicCompiler64/Compile_Var.cpp

    r62 r63  
    4343        *pType=MAKE_PTR_TYPE(NATURAL_TYPE(*pType),PTR_LEVEL(*pType)-1);
    4444        if((*pType)==DEF_OBJECT){
     45            CClass *pClass = (CClass *)lpIndex;
    4546            //imul reg,objsize
    46             op_imul_value(sizeof(_int64),reg,GetSizeOfClassMember((CClass *)lpIndex,NULL,NULL));
     47            op_imul_value( sizeof(_int64), reg, pClass->GetSize() );
    4748        }
    4849        else{
     
    180181}
    181182BOOL GetMemberOffset(bool isErrorEnabled, bool isWriteAccess, CClass *pobj_c, char *member, int *pType, RELATIVE_VAR *pRelativeVar, LONG_PTR *plpNestIndex, BOOL bPrivateAccess){
    182     int i,offset;
     183    int i;
    183184
    184185
     
    200201    ////////////////////////////
    201202
    202     offset=GetSizeOfClassMember(pobj_c,VarName,&i);
     203    int offset = pobj_c->GetMemberOffset( VarName, &i );
    203204    if(i==pobj_c->iMemberNum){
    204205        if(isErrorEnabled) SetError(103,VarName,cp);
     
    821822                i=GetOneParameter(InitBuf,i,temporary);
    822823
    823                 i3=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i2]->name,NULL);
     824                i3=pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i2]->name, NULL );
    824825
    825826                if(!SetInitGlobalData(offset+i3,
     
    959960                i=GetOneParameter(InitBuf,i,temporary);
    960961
    961                 i3=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i2]->name,NULL);
     962                i3=pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i2]->name, NULL );
    962963
    963964                if(!InitLocalVar(offset+i3,
  • BasicCompiler64/NumOpe.cpp

    r56 r63  
    1515
    1616        extern CClass *pobj_StringClass;
    17         int object_size;
    18         object_size=GetSizeOfClass(pobj_StringClass);
     17        int object_size = pobj_StringClass->GetSize();
    1918
    2019        //mov rcx,object_size
  • BasicCompiler64/OperatorProc.cpp

    r51 r63  
    137137        //////////////////////////////////////////////////////
    138138
    139             int object_size;
    140             object_size=GetSizeOfClass(psi->u.Return_pobj_c);
     139            int object_size = psi->u.Return_pobj_c->GetSize();
    141140
    142141            //mov rcx,object_size
  • BasicCompiler64/WatchList.cpp

    r62 r63  
    7878    if(PTR_LEVEL(*pType)){
    7979        *pType=MAKE_PTR_TYPE(NATURAL_TYPE(*pType),PTR_LEVEL(*pType)-1);
    80         if((*pType)==DEF_OBJECT)
    81             array_num*=GetSizeOfClassMember((CClass *)lpIndex,NULL,NULL);
    82         else
    83             array_num*=GetTypeSize(*pType,-1);
     80        if((*pType)==DEF_OBJECT){
     81            CClass *pClass = (CClass *)lpIndex;
     82            array_num *= pClass->GetSize();
     83        }
     84        else{
     85            array_num *= GetTypeSize(*pType,-1);
     86        }
    8487    }
    8588    else{
     
    100103
    101104BOOL Debugging_GetMember(CClass *pobj_c,char *member,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpNestIndex,BOOL bPrivateAccess){
    102     int i,i2,offset;
     105    int i,i2;
    103106
    104107    //直接参照に切り替え
     
    120123    ////////////////////////////
    121124
    122     offset=GetSizeOfClassMember(pobj_c,VarName,&i);
     125    int offset = pobj_c->GetMemberOffset( VarName, &i );
    123126    if(i==pobj_c->iMemberNum) return 0;
    124127
  • BasicCompiler64/varlist.cpp

    r55 r63  
    168168
    169169        LONG_PTR offset;
    170         offset=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i]->name,&i2);
     170        offset=pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i]->name, &i2 );
    171171
    172172        if(pobj_c->ppobj_Member[i]->SubScripts[0]!=-1){
     
    428428
    429429    for(i=0;i<psi->pobj_ParentClass->iMemberNum;i++){
    430         offset=GetSizeOfClassMember(psi->pobj_ParentClass,psi->pobj_ParentClass->ppobj_Member[i]->name,&i2);
     430        offset=psi->pobj_ParentClass->GetMemberOffset( psi->pobj_ParentClass->ppobj_Member[i]->name,&i2);
    431431
    432432        if(psi->pobj_ParentClass->ppobj_Member[i]->SubScripts[0]!=-1){
Note: See TracChangeset for help on using the changeset viewer.