Changeset 63 in dev for BasicCompiler32


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

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

Location:
BasicCompiler32
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/CParameter.cpp

    r59 r63  
    130130
    131131void CParameter::SetObjectParameter(CClass *pobj_Class,LPSTR Parameter){
    132     int object_size;
    133     object_size=GetSizeOfClass(pobj_Class);
     132    int object_size = pobj_Class->GetSize();
    134133
    135134    //push object_size
  • BasicCompiler32/Compile_CallProc.cpp

    r51 r63  
    259259        //////////////////////////////////////////////////////
    260260
    261         int object_size;
    262         object_size=GetSizeOfClass(psi->u.Return_pobj_c);
     261        int object_size = psi->u.Return_pobj_c->GetSize();
    263262
    264263        //push object_size
  • BasicCompiler32/Compile_ProcOp.cpp

    r55 r63  
    515515
    516516            //実体クラスを持つメンバのコンストラクタ(引数有りを除く)を呼び出す
    517             int offset;
    518             int MemberTypeSize;
    519             int MemberObjectNum;
    520             if(pobj_CompilingClass->vtbl_num) offset=PTR_SIZE;
    521             else offset=0;
    522517            for(i3=0;i3<pobj_CompilingClass->iMemberNum;i3++){
    523518                CMember *pMember = pobj_CompilingClass->ppobj_Member[i3];
    524                 MemberTypeSize=
     519                int MemberTypeSize=
    525520                    GetTypeSize(pMember->TypeInfo.type,
    526521                        pMember->TypeInfo.u.lpIndex);
    527522
    528                 MemberObjectNum=
     523                int MemberObjectNum=
    529524                    JumpSubScripts(pMember->SubScripts);
    530525
    531                 offset=GetSizeOfClassMember(pobj_CompilingClass,pMember->name,NULL);
     526                int offset = pobj_CompilingClass->GetMemberOffset( pMember->name, NULL );
    532527
    533528                if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){
     
    561556                pobj_CompilingClass->IsAbstract()==false){
    562557                    //関数テーブルに値をセット
    563                     offset=pobj_CompilingClass->GetVtblGlobalOffset();
     558                    int offset = (int)pobj_CompilingClass->GetVtblGlobalOffset();
    564559
    565560                    //mov eax,offset
  • BasicCompiler32/Compile_Set_Var.cpp

    r62 r63  
    4646                //※コピーを行う
    4747
    48                 int object_size;
    49                 object_size=GetSizeOfClass((CClass *)lpVarIndex);
     48                int object_size = pVarClass->GetSize();
    5049
    5150                //mov ecx,object_size
  • BasicCompiler32/Compile_Var.cpp

    r62 r63  
    2525        *pType=MAKE_PTR_TYPE(NATURAL_TYPE(*pType),PTR_LEVEL(*pType)-1);
    2626        if((*pType)==DEF_OBJECT){
     27            CClass *pClass = (CClass *)lpIndex;
     28            int objsize = pClass->GetSize();
     29
    2730            //imul ebx,objsize
    2831            OpBuffer[obp++]=(char)0x69;
    2932            OpBuffer[obp++]=(char)0xDB;
    30             *((long *)(OpBuffer+obp))=GetSizeOfClassMember((CClass *)lpIndex,NULL,NULL);
     33            *((long *)(OpBuffer+obp))=objsize;
    3134            obp+=sizeof(long);
    3235        }
     
    158161}
    159162BOOL GetMemberOffset(bool isErrorEnabled, bool isWriteAccess, CClass *pobj_c, char *member, int *pType, RELATIVE_VAR *pRelativeVar, LONG_PTR *plpNestIndex, BOOL bPrivateAccess){
    160     int i,offset;
     163    int i;
    161164
    162165    //クラス、配列の構成要素を解析する
     
    173176    ////////////////////////////
    174177
    175     offset=GetSizeOfClassMember(pobj_c,VarName,&i);
     178    int offset=pobj_c->GetMemberOffset( VarName, &i );
    176179    if(i==pobj_c->iMemberNum){
    177180        if(isErrorEnabled) SetError(103,VarName,cp);
     
    789792                i=GetOneParameter(InitBuf,i,temporary);
    790793
    791                 i3=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i2]->name,NULL);
     794                i3=pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i2]->name, NULL );
    792795
    793796                if(!SetInitGlobalData(offset+i3,
     
    922925                i=GetOneParameter(InitBuf,i,temporary);
    923926
    924                 i3=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i2]->name,NULL);
     927                i3 = pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i2]->name, NULL );
    925928
    926929                if(!InitLocalVar(offset+i3,
  • BasicCompiler32/NumOpe.cpp

    r56 r63  
    7575
    7676    extern CClass *pobj_StringClass;
    77     int object_size;
    78     object_size=GetSizeOfClass(pobj_StringClass);
     77    int object_size = pobj_StringClass->GetSize();
    7978
    8079    //push object_size
  • BasicCompiler32/OperatorProc.cpp

    r51 r63  
    125125        //////////////////////////////////////////////////////
    126126
    127         int object_size;
    128         object_size=GetSizeOfClass(psi->u.Return_pobj_c);
     127        int object_size = psi->u.Return_pobj_c->GetSize();
    129128
    130129        //push object_size
  • BasicCompiler32/VarList.cpp

    r55 r63  
    165165        }
    166166
    167         LONG_PTR offset;
    168         offset=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i]->name,&i2);
     167        LONG_PTR offset = pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i]->name, &i2 );
    169168
    170169        if(pobj_c->ppobj_Member[i]->SubScripts[0]!=-1){
     
    423422
    424423    for(i=0;i<psi->pobj_ParentClass->iMemberNum;i++){
    425         offset=GetSizeOfClassMember(psi->pobj_ParentClass,psi->pobj_ParentClass->ppobj_Member[i]->name,&i2);
     424        offset = psi->pobj_ParentClass->GetMemberOffset( psi->pobj_ParentClass->ppobj_Member[i]->name, &i2 );
    426425
    427426        if(psi->pobj_ParentClass->ppobj_Member[i]->SubScripts[0]!=-1){
  • BasicCompiler32/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*=GetSizeOfClass((CClass *)lpIndex);
    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
Note: See TracChangeset for help on using the changeset viewer.