Changeset 64 in dev for BasicCompiler64/Compile_Func.cpp


Ignore:
Timestamp:
Mar 8, 2007, 2:49:34 AM (17 years ago)
Author:
dai_9181
Message:

すべてのオブジェクトを参照型に切り替えた。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/Compile_Func.cpp

    r51 r64  
    6262
    6363    TYPEINFO TypeInfo={type,lpIndex};
    64     if(IsStringObjectType(&TypeInfo)){
     64    if(IsStringObjectType(TypeInfo)){
    6565        //Stringオブジェクトの場合
    6666        sprintf(temporary,"%s.Length",tempParm);
     
    195195}
    196196void Opcode_Func_SizeOf( const char *Parameter ){
    197     int type,size;
    198197    LONG_PTR lpIndex;
    199 
    200     type=GetTypeFixed(Parameter,&lpIndex);
    201     size=GetTypeSize(type,lpIndex);
     198    int type = GetTypeFixed(Parameter,&lpIndex);
     199
     200    int size;
     201    if( type == DEF_OBJECT ){
     202        CClass *pClass = (CClass *)lpIndex;
     203        size = pClass->GetSize();
     204    }
     205    else{
     206        size=GetTypeSize(type,lpIndex);
     207    }
    202208
    203209    //mov rax,size
     
    210216    if(!GetVarOffsetReadOnly( Parameter, &ReturnTypeInfo.type, &RelativeVar, &ReturnTypeInfo.u.lpIndex )) return;
    211217
     218    int beforeType = ReturnTypeInfo.type;
     219
    212220    PTR_LEVEL_UP( ReturnTypeInfo.type );
    213221
    214222    SetVarPtrToReg(REG_RAX,&RelativeVar);
     223
     224    if( beforeType == DEF_OBJECT && lstrcmpi( Parameter, "This" ) != 0 ){
     225        //参照をオブジェクトポインタに変更
     226
     227        //mov rax,qword ptr[rax]
     228        op_mov_RM( sizeof(_int64), REG_RAX, REG_RAX, 0, MOD_BASE );
     229    }
    215230}
    216231void Opcode_Func_GetPtrData( const char *Parameter, const int type ){
Note: See TracChangeset for help on using the changeset viewer.