Changeset 232 in dev for trunk/abdev/BasicCompiler64/Compile_Var.cpp
- Timestamp:
- Jul 25, 2007, 4:04:11 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/Compile_Var.cpp
r228 r232 868 868 869 869 //mov qword ptr[offset],rax 870 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,0,offset,MOD_DISP32); 871 obp-=sizeof(long); 872 pobj_GlobalVarSchedule->add(); 873 obp+=sizeof(long); 870 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,0,offset,MOD_DISP32, Schedule::GlobalVar ); 874 871 } 875 872 else{ … … 992 989 993 990 //mov rax,i64data 994 compiler.codeGenerator.op_mov 64_ToReg(REG_RAX,i64data);991 compiler.codeGenerator.op_mov_RV64(REG_RAX,i64data); 995 992 996 993 //mov qword ptr[rsp+offset],rax … … 1034 1031 if(i64data&0xFFFFFFFF00000000){ 1035 1032 //mov rax,i64data 1036 compiler.codeGenerator.op_mov 64_ToReg(REG_RAX,i64data);1033 compiler.codeGenerator.op_mov_RV64(REG_RAX,i64data); 1037 1034 1038 1035 //mov qword ptr[rsp+offset],rax … … 1116 1113 //アラインメントを考慮 1117 1114 if( pVar->GetType().IsStruct() ){ 1118 int alignment = pVar->GetType().GetClass(). iAlign;1115 int alignment = pVar->GetType().GetClass().GetFixedAlignment(); 1119 1116 1120 1117 if( alignment ){ … … 1222 1219 if(pRelativeVar->bOffsetOffset){ 1223 1220 //add r11,offset 1224 OpBuffer[obp++]=(char)0x49; 1225 OpBuffer[obp++]=(char)0x81; 1226 OpBuffer[obp++]=(char)0xC3; 1227 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 1228 pobj_GlobalVarSchedule->add(); 1229 obp+=sizeof(long); 1221 compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::GlobalVar ); 1230 1222 1231 1223 //mov reg,r11 … … 1234 1226 else{ 1235 1227 //mov reg,offset 1236 compiler.codeGenerator.op_mov64_ToReg(reg,(long)pRelativeVar->offset); 1237 obp-=sizeof(long); 1238 pobj_GlobalVarSchedule->add(); 1239 obp+=sizeof(long); 1228 compiler.codeGenerator.op_mov_RV( sizeof(_int64), reg, (long)pRelativeVar->offset, Schedule::GlobalVar ); 1240 1229 } 1241 1230 } … … 1243 1232 if(pRelativeVar->bOffsetOffset){ 1244 1233 //add r11,qword ptr[offset] 1245 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 1246 obp-=sizeof(long); 1247 pobj_GlobalVarSchedule->add(); 1248 obp+=sizeof(long); 1234 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelativeVar->offset, MOD_DISP32, Schedule::GlobalVar ); 1249 1235 } 1250 1236 else{ 1251 1237 //mov r11,qword ptr[offset] 1252 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32); 1253 obp-=sizeof(long); 1254 pobj_GlobalVarSchedule->add(); 1255 obp+=sizeof(long); 1238 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32, Schedule::GlobalVar ); 1256 1239 } 1257 1240 … … 1261 1244 if(pRelativeVar->bOffsetOffset){ 1262 1245 //add r11,offset 1263 OpBuffer[obp++]=(char)0x49; 1264 OpBuffer[obp++]=(char)0x81; 1265 OpBuffer[obp++]=(char)0xC3; 1266 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 1267 AddLocalVarAddrSchedule(); 1268 obp+=sizeof(long); 1246 compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::LocalVar ); 1269 1247 1270 1248 //add r11,rsp … … 1279 1257 1280 1258 //add reg,offset 1281 compiler.codeGenerator.op_add_RV(reg,(int)pRelativeVar->offset); 1282 obp-=sizeof(long); 1283 AddLocalVarAddrSchedule(); 1284 obp+=sizeof(long); 1259 compiler.codeGenerator.op_add_RV(reg,(long)pRelativeVar->offset, Schedule::LocalVar ); 1285 1260 } 1286 1261 } … … 1288 1263 if(pRelativeVar->bOffsetOffset){ 1289 1264 //add r11,qword ptr[rsp+offset] 1290 OpBuffer[obp++]=(char)0x4C; 1291 OpBuffer[obp++]=(char)0x03; 1292 OpBuffer[obp++]=(char)0x9C; 1293 OpBuffer[obp++]=(char)0x24; 1294 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 1295 AddLocalVarAddrSchedule(); 1296 obp+=sizeof(long); 1265 compiler.codeGenerator.op_add_RM( REG_R11, REG_RSP, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::LocalVar ); 1297 1266 } 1298 1267 else{ 1299 1268 //mov r11,qword ptr[rsp+offset] 1300 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 1301 obp-=sizeof(long); 1302 AddLocalVarAddrSchedule(); 1303 obp+=sizeof(long); 1269 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 1304 1270 } 1305 1271 … … 1331 1297 // ルートポインタを引き渡す 1332 1298 //mov rdx,offset 1333 compiler.codeGenerator.op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->GetOffsetAddress()); 1334 obp-=sizeof(long); 1335 pobj_GlobalVarSchedule->add(); 1336 obp+=sizeof(long); 1299 compiler.codeGenerator.op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->GetOffsetAddress(), Schedule::GlobalVar ); 1337 1300 1338 1301 // Thisポインタを引き渡す
Note:
See TracChangeset
for help on using the changeset viewer.