Changeset 243 in dev for trunk/abdev
- Timestamp:
- Jul 27, 2007, 4:20:59 AM (17 years ago)
- Location:
- trunk/abdev
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Statement.cpp
r241 r243 780 780 781 781 //jmp ... 782 OpBuffer[obp++]=(char)0xE9; 783 int je_schedule=obp; 784 obp+=sizeof(long); 782 CodeGenerator::PertialSchedule *pTempPertialSchedule = compiler.codeGenerator.op_jmp( 0, sizeof(long), true ); 785 783 786 784 //レキシカルスコープをレベルダウン 787 785 GetLexicalScopes().End(); 788 786 789 *((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long));//jmpジャンプ先のオフセット値790 787 //jmpジャンプ先のオフセット値 788 compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule ); 791 789 792 790 //Continueアドレスを復元 -
trunk/abdev/BasicCompiler64/CodeGenerator.cpp
r242 r243 306 306 } 307 307 308 void CodeGenerator::op_mov_MV(int op_size,int base_reg,int offset, BOOL bUseOffset,long i32data){308 void CodeGenerator::op_mov_MV(int op_size,int base_reg,int offset, Schedule::Type offsetScheduleType, BOOL bUseOffset,long i32data){ 309 309 //mov ptr[base_reg+offset],i32data 310 310 //mov ptr[base_reg ],i32data … … 326 326 327 327 //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 ); 329 329 } 330 330 else{ -
trunk/abdev/BasicCompiler64/Compile_Object.cpp
r228 r243 173 173 174 174 //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); 176 176 177 177 //add rax,PTR_SIZE -
trunk/abdev/BasicCompiler64/Compile_Statement.cpp
r242 r243 522 522 523 523 //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 ); 527 525 528 526 //レキシカルスコープをレベルダウン 529 527 GetLexicalScopes().End(); 530 528 531 *((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jmpジャンプ先のオフセット値 529 //jmpジャンプ先のオフセット値 530 compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule ); 532 531 533 532 //Continueアドレスを復元 -
trunk/abdev/BasicCompiler64/Compile_Var.cpp
r242 r243 999 999 1000 1000 //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); 1005 1002 } 1006 1003 else if( type.Is64() || type.IsPointer() ){ … … 1029 1026 else{ 1030 1027 //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); 1035 1029 } 1036 1030 } … … 1038 1032 else if( type.IsDWord() || type.IsLong() ){ 1039 1033 //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); 1044 1035 } 1045 1036 else if( type.IsWord() || type.IsInteger() ){ 1046 1037 //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); 1051 1039 } 1052 1040 else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){ 1053 1041 //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); 1058 1043 } 1059 1044 return true; -
trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h
r242 r243 159 159 void op_mov_MR (int op_size,int reg,int base_reg,long offset,char mod, Schedule::Type scheduleType = Schedule::None ); 160 160 void op_mov_MR_ex (int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType = Schedule::None ); 161 void op_mov_MV (int op_size,int base_reg,int offset, BOOL bUseOffset,long i32data);161 void op_mov_MV (int op_size,int base_reg,int offset, Schedule::Type offsetScheduleType, BOOL bUseOffset,long i32data); 162 162 void op_mov_RR (int reg1,int reg2); 163 163 void op_movsxd (int reg64,int reg32);
Note:
See TracChangeset
for help on using the changeset viewer.