Changeset 62 in dev for BasicCompiler64
- Timestamp:
- Feb 22, 2007, 3:57:56 AM (18 years ago)
- Location:
- BasicCompiler64
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/Compile_Calc.cpp
r55 r62 286 286 } 287 287 288 if( VarType == DEF_OBJECT && VarRelativeVar.dwKind == VAR_REFLOCAL ){ 288 if( VarType == DEF_OBJECT 289 && (VarRelativeVar.dwKind == VAR_REFLOCAL || VarRelativeVar.dwKind == VAR_REFGLOBAL ) ){ 289 290 // 参照型オブジェクトへの代入(初期化)はポインタ変数と同様の処理に値する 290 291 PTR_LEVEL_UP( VarType ); 291 292 292 VarRelativeVar.dwKind = VAR_LOCAL; 293 if( VarRelativeVar.dwKind == VAR_REFGLOBAL ){ 294 VarRelativeVar.dwKind = VAR_GLOBAL; 295 } 296 else if( VarRelativeVar.dwKind == VAR_REFLOCAL ){ 297 VarRelativeVar.dwKind = VAR_LOCAL; 298 } 293 299 294 300 if( CalcType == DEF_OBJECT ){ -
BasicCompiler64/Compile_Calc_PushVar.cpp
r40 r62 27 27 obp+=sizeof(long); 28 28 } 29 } 30 else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){ 31 SetError(300,NULL,cp); 29 32 } 30 33 else if(pRelativeVar->dwKind==VAR_LOCAL){ … … 109 112 } 110 113 } 114 else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){ 115 SetError(300,NULL,cp); 116 } 111 117 else if(pRelativeVar->dwKind==VAR_LOCAL){ 112 118 if(pRelativeVar->bOffsetOffset){ … … 188 194 } 189 195 } 196 else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){ 197 if(pRelativeVar->bOffsetOffset){ 198 //add r11,qword ptr[offset] 199 op_add_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32); 200 obp-=sizeof(long); 201 pobj_GlobalVarSchedule->add(); 202 obp+=sizeof(long); 203 } 204 else{ 205 //mov r11,qword ptr[offset] 206 op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32); 207 obp-=sizeof(long); 208 pobj_GlobalVarSchedule->add(); 209 obp+=sizeof(long); 210 } 211 212 goto directmem; 213 } 190 214 else if(pRelativeVar->dwKind==VAR_LOCAL){ 191 215 if(pRelativeVar->bOffsetOffset){ -
BasicCompiler64/Compile_Set_Var.cpp
r40 r62 153 153 obp+=sizeof(long); 154 154 } 155 } 156 else if(pRelative->dwKind==VAR_REFGLOBAL){ 157 SetError(300,NULL,cp); 155 158 } 156 159 else if(pRelative->dwKind==VAR_LOCAL){ … … 242 245 } 243 246 } 247 else if(pRelative->dwKind==VAR_REFGLOBAL){ 248 SetError(300,NULL,cp); 249 } 244 250 else if(pRelative->dwKind==VAR_LOCAL){ 245 251 if(pRelative->bOffsetOffset){ … … 367 373 } 368 374 } 375 else if( pRelative->dwKind == VAR_REFGLOBAL ){ 376 if(pRelative->bOffsetOffset){ 377 //add r11,qword ptr[offset] 378 op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelative->offset, MOD_DISP32 ); 379 obp-=sizeof(long); 380 pobj_GlobalVarSchedule->add(); 381 obp+=sizeof(long); 382 } 383 else{ 384 //mov r11,qword ptr[offset] 385 op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelative->offset,MOD_DISP32); 386 obp-=sizeof(long); 387 pobj_GlobalVarSchedule->add(); 388 obp+=sizeof(long); 389 } 390 391 goto directmem; 392 } 369 393 else if(pRelative->dwKind==VAR_LOCAL){ 370 394 if(pRelative->bOffsetOffset){ … … 386 410 if(pRelative->bOffsetOffset){ 387 411 //add r11,qword ptr[rsp+offset] 388 OpBuffer[obp++]=(char)0x4C; 389 OpBuffer[obp++]=(char)0x03; 390 OpBuffer[obp++]=(char)0x9C; 391 OpBuffer[obp++]=(char)0x24; 392 *((long *)(OpBuffer+obp))=(int)pRelative->offset; 412 op_add_RM( sizeof(_int64), REG_R11, REG_RSP, (int)pRelative->offset, MOD_BASE_DISP32 ); 413 obp-=sizeof(long); 393 414 AddLocalVarAddrSchedule(); 394 415 obp+=sizeof(long); -
BasicCompiler64/Compile_Var.cpp
r56 r62 647 647 pRelativeVar->offset=GlobalVar[i].offset; 648 648 pRelativeVar->bOffsetOffset=0; 649 pRelativeVar->dwKind=VAR_GLOBAL; 649 if(GlobalVar[i].fRef){ 650 // 参照型 651 pRelativeVar->dwKind = VAR_REFGLOBAL; 652 } 653 else pRelativeVar->dwKind=VAR_GLOBAL; 650 654 *pType=GlobalVar[i].type; 651 655 lpIndex=GlobalVar[i].u.index; … … 1181 1185 GetNowStaticVarFullName(VarName,temporary); 1182 1186 1183 AddGlobalVariable( temporary,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);1187 AddGlobalVariable(isRef,temporary,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags); 1184 1188 1185 1189 /* … … 1194 1198 ///////////////////////// 1195 1199 1196 AddGlobalVariable( VarName,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);1200 AddGlobalVariable(isRef,VarName,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags); 1197 1201 } 1198 1202 else{ … … 1367 1371 } 1368 1372 } 1373 else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){ 1374 if(pRelativeVar->bOffsetOffset){ 1375 //add r11,qword ptr[offset] 1376 op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 1377 obp-=sizeof(long); 1378 pobj_GlobalVarSchedule->add(); 1379 obp+=sizeof(long); 1380 } 1381 else{ 1382 //mov r11,qword ptr[offset] 1383 op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32); 1384 obp-=sizeof(long); 1385 pobj_GlobalVarSchedule->add(); 1386 obp+=sizeof(long); 1387 } 1388 1389 goto directmem; 1390 } 1369 1391 else if(pRelativeVar->dwKind==VAR_LOCAL){ 1370 1392 if(pRelativeVar->bOffsetOffset){ -
BasicCompiler64/Opcode.h
r56 r62 53 53 //変数の種類 54 54 #define NON_VAR 0 55 #define VAR_GLOBAL 1 //Global Variable 56 #define VAR_LOCAL 2 //Local Variable 57 #define VAR_REFLOCAL 3 //Local Refference Variable 58 #define VAR_DIRECTMEM 5 //Direct memory 55 #define VAR_GLOBAL 1 // Global Variable 56 #define VAR_REFGLOBAL 2 // Global Refference Variable 57 #define VAR_LOCAL 3 // Local Variable 58 #define VAR_REFLOCAL 4 // Local Refference Variable 59 #define VAR_DIRECTMEM 5 // Direct memory 59 60 60 61 -
BasicCompiler64/WatchList.cpp
r40 r62 14 14 if(pRelativeVar->dwKind==VAR_GLOBAL){ 15 15 return ImageBase+MemPos_RWSection+pRelativeVar->offset; 16 } 17 else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){ 18 extern HANDLE hDebugProcess; 19 LONG_PTR lpData; 20 SIZE_T stAccBytes; 21 ReadProcessMemory(hDebugProcess, 22 (void *)(ImageBase+MemPos_RWSection+pRelativeVar->offset), 23 &lpData, 24 sizeof(LONG_PTR), 25 &stAccBytes); 26 27 return lpData; 16 28 } 17 29 else if(pRelativeVar->dwKind==VAR_LOCAL){ … … 430 442 431 443 pRelativeVar->offset=GlobalVar[i].offset; 432 pRelativeVar->dwKind=VAR_GLOBAL; 444 if(GlobalVar[i].fRef) pRelativeVar->dwKind=VAR_REFGLOBAL; 445 else pRelativeVar->dwKind=VAR_GLOBAL; 433 446 *pType=GlobalVar[i].type; 434 447 lpIndex=GlobalVar[i].u.index;
Note:
See TracChangeset
for help on using the changeset viewer.