Changeset 243 in dev for trunk/abdev/BasicCompiler64


Ignore:
Timestamp:
Jul 27, 2007, 4:20:59 AM (17 years ago)
Author:
dai_9181
Message:
 
Location:
trunk/abdev/BasicCompiler64
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler64/CodeGenerator.cpp

    r242 r243  
    306306}
    307307
    308 void CodeGenerator::op_mov_MV(int op_size,int base_reg,int offset,BOOL bUseOffset,long i32data){
     308void CodeGenerator::op_mov_MV(int op_size,int base_reg,int offset, Schedule::Type offsetScheduleType, BOOL bUseOffset,long i32data){
    309309    //mov ptr[base_reg+offset],i32data
    310310    //mov ptr[base_reg       ],i32data
     
    326326
    327327        //ModR/M, SIB, disp
    328         set_mod_rm_sib_disp(MOD_BASE_DISP32,0,SCALE_NON,INDEX_NON,base_reg,offset);
     328        set_mod_rm_sib_disp(MOD_BASE_DISP32,0,SCALE_NON,INDEX_NON,base_reg,offset, offsetScheduleType );
    329329    }
    330330    else{
  • trunk/abdev/BasicCompiler64/Compile_Object.cpp

    r228 r243  
    173173
    174174    //mov qword ptr[rax],typeSize(オブジェクトのサイズ)
    175     compiler.codeGenerator.op_mov_MV(sizeof(_int64),REG_RAX,0,NON_OFFSET,typeSize);
     175    compiler.codeGenerator.op_mov_MV(sizeof(_int64),REG_RAX,0, Schedule::None, NON_OFFSET,typeSize);
    176176
    177177    //add rax,PTR_SIZE
  • trunk/abdev/BasicCompiler64/Compile_Statement.cpp

    r242 r243  
    522522
    523523    //jmp ...
    524     OpBuffer[obp++]=(char)0xE9;
    525     int je_schedule=obp;
    526     obp+=sizeof(long);
     524    CodeGenerator::PertialSchedule *pTempPertialSchedule = compiler.codeGenerator.op_jmp( 0, sizeof(long), true );
    527525
    528526    //レキシカルスコープをレベルダウン
    529527    GetLexicalScopes().End();
    530528
    531     *((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jmpジャンプ先のオフセット値
     529    //jmpジャンプ先のオフセット値
     530    compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule );
    532531
    533532    //Continueアドレスを復元
  • trunk/abdev/BasicCompiler64/Compile_Var.cpp

    r242 r243  
    999999
    10001000        //mov dword ptr[rsp+offset],value
    1001         compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset,USE_OFFSET,*(int *)&flt);
    1002         obp-=sizeof(long)+sizeof(long);
    1003         AddLocalVarAddrSchedule();
    1004         obp+=sizeof(long)+sizeof(long);
     1001        compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::LocalVar, USE_OFFSET,*(int *)&flt);
    10051002    }
    10061003    else if( type.Is64() || type.IsPointer() ){
     
    10291026            else{
    10301027                //mov qword ptr[rsp+offset],value
    1031                 compiler.codeGenerator.op_mov_MV(sizeof(_int64),REG_RSP,offset,USE_OFFSET,(int)i64data);
    1032                 obp-=sizeof(long)+sizeof(long);
    1033                 AddLocalVarAddrSchedule();
    1034                 obp+=sizeof(long)+sizeof(long);
     1028                compiler.codeGenerator.op_mov_MV(sizeof(_int64),REG_RSP,offset, Schedule::LocalVar, USE_OFFSET,(int)i64data);
    10351029            }
    10361030        }
     
    10381032    else if( type.IsDWord() || type.IsLong() ){
    10391033        //mov dword ptr[rsp+offset],value
    1040         compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset,USE_OFFSET,(int)i64data);
    1041         obp-=sizeof(long)+sizeof(long);
    1042         AddLocalVarAddrSchedule();
    1043         obp+=sizeof(long)+sizeof(long);
     1034        compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::LocalVar,USE_OFFSET,(int)i64data);
    10441035    }
    10451036    else if( type.IsWord() || type.IsInteger() ){
    10461037        //mov word ptr[rsp+offset],value
    1047         compiler.codeGenerator.op_mov_MV(sizeof(short),REG_RSP,offset,USE_OFFSET,(int)i64data);
    1048         obp-=sizeof(long)+sizeof(short);
    1049         AddLocalVarAddrSchedule();
    1050         obp+=sizeof(long)+sizeof(short);
     1038        compiler.codeGenerator.op_mov_MV(sizeof(short),REG_RSP,offset, Schedule::LocalVar,USE_OFFSET,(int)i64data);
    10511039    }
    10521040    else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){
    10531041        //mov byte ptr[rsp+offset],value
    1054         compiler.codeGenerator.op_mov_MV(sizeof(char),REG_RSP,offset,USE_OFFSET,(int)i64data);
    1055         obp-=sizeof(long)+sizeof(char);
    1056         AddLocalVarAddrSchedule();
    1057         obp+=sizeof(long)+sizeof(char);
     1042        compiler.codeGenerator.op_mov_MV(sizeof(char),REG_RSP,offset, Schedule::LocalVar,USE_OFFSET,(int)i64data);
    10581043    }
    10591044    return true;
Note: See TracChangeset for help on using the changeset viewer.