Changeset 229 in dev for trunk/abdev/BasicCompiler32/Compile_Calc_PushVar.cpp
- Timestamp:
- Jul 24, 2007, 11:35:33 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Calc_PushVar.cpp
r225 r229 10 10 if(pRelativeVar->bOffsetOffset){ 11 11 //fld ptr[ecx+offset] 12 compiler.codeGenerator.op_fld_base_offset(type,REG_ECX,(int)pRelativeVar->offset); 13 obp-=sizeof(long); 14 pobj_GlobalVarSchedule->add(); 15 obp+=sizeof(long); 12 compiler.codeGenerator.op_fld_base_offset(type,REG_ECX,(int)pRelativeVar->offset, Schedule::GlobalVar ); 16 13 } 17 14 else{ 18 15 //mov ecx,offset 19 compiler.codeGenerator.op_mov_RV(REG_ECX,(int)pRelativeVar->offset); 20 obp-=sizeof(long); 21 pobj_GlobalVarSchedule->add(); 22 obp+=sizeof(long); 16 compiler.codeGenerator.op_mov_RV(REG_ECX,(int)pRelativeVar->offset, Schedule::GlobalVar ); 23 17 24 18 //fld ptr[ecx] … … 32 26 if(pRelativeVar->bOffsetOffset){ 33 27 //fld ptr[ebp+ecx+offset] 34 compiler.codeGenerator.op_fld_base_offset_ex(type,REG_EBP,REG_ECX,(int)pRelativeVar->offset,USE_OFFSET); 35 obp-=sizeof(long); 36 AddLocalVarAddrSchedule(); 37 obp+=sizeof(long); 28 compiler.codeGenerator.op_fld_base_offset_ex(type,REG_EBP,REG_ECX,(int)pRelativeVar->offset,USE_OFFSET, Schedule::LocalVar ); 38 29 } 39 30 else{ 40 31 //fld ptr[ebp+offset] 41 compiler.codeGenerator.op_fld_base_offset(type,REG_EBP,(int)pRelativeVar->offset); 42 obp-=sizeof(long); 43 AddLocalVarAddrSchedule(); 44 obp+=sizeof(long); 32 compiler.codeGenerator.op_fld_base_offset(type,REG_EBP,(int)pRelativeVar->offset, Schedule::LocalVar ); 45 33 } 46 34 } … … 48 36 if(pRelativeVar->bOffsetOffset){ 49 37 //add ecx,qword ptr[ebp+offset] 50 compiler.codeGenerator.op_add_RM(sizeof(long),REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 51 obp-=sizeof(long); 52 AddLocalVarAddrSchedule(); 53 obp+=sizeof(long); 38 compiler.codeGenerator.op_add_RM(sizeof(long),REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 54 39 } 55 40 else{ 56 41 //mov ecx,qword ptr[ebp+offset] 57 compiler.codeGenerator.op_mov_RM(sizeof(long),REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 58 obp-=sizeof(long); 59 AddLocalVarAddrSchedule(); 60 obp+=sizeof(long); 42 compiler.codeGenerator.op_mov_RM(sizeof(long),REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 61 43 } 62 44 … … 98 80 if(pRelativeVar->bOffsetOffset){ 99 81 //mov reg, ptr[ecx+offset] 100 compiler.codeGenerator.op_mov_RM(varSize,reg,REG_ECX,(int)pRelativeVar->offset + offsetOf64Head,MOD_BASE_DISP32 );82 compiler.codeGenerator.op_mov_RM(varSize,reg,REG_ECX,(int)pRelativeVar->offset + offsetOf64Head,MOD_BASE_DISP32, Schedule::GlobalVar ); 101 83 } 102 84 else{ 103 85 //mov reg, ptr[offset] 104 compiler.codeGenerator.op_mov_RM(varSize,reg,0,(int)pRelativeVar->offset + offsetOf64Head,MOD_DISP32); 105 } 106 obp-=sizeof(long); 107 pobj_GlobalVarSchedule->add(); 108 obp+=sizeof(long); 86 compiler.codeGenerator.op_mov_RM(varSize,reg,0,(int)pRelativeVar->offset + offsetOf64Head,MOD_DISP32, Schedule::GlobalVar ); 87 } 109 88 } 110 89 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 111 90 if(pRelativeVar->bOffsetOffset){ 112 91 //add ecx,qword ptr[offset] 113 compiler.codeGenerator.op_add_RM(varSize,REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32 );92 compiler.codeGenerator.op_add_RM(varSize,REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32, Schedule::GlobalVar ); 114 93 } 115 94 else{ 116 95 //mov ecx,qword ptr[offset] 117 compiler.codeGenerator.op_mov_RM(varSize,REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32); 118 } 119 obp-=sizeof(long); 120 pobj_GlobalVarSchedule->add(); 121 obp+=sizeof(long); 96 compiler.codeGenerator.op_mov_RM(varSize,REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32, Schedule::GlobalVar ); 97 } 122 98 123 99 goto directmem; … … 126 102 if(pRelativeVar->bOffsetOffset){ 127 103 //mov reg, ptr[ebp+ecx+offset] 128 compiler.codeGenerator.op_mov_RM_ex(varSize,reg,REG_EBP,REG_ECX,(int)pRelativeVar->offset + offsetOf64Head,USE_OFFSET );104 compiler.codeGenerator.op_mov_RM_ex(varSize,reg,REG_EBP,REG_ECX,(int)pRelativeVar->offset + offsetOf64Head,USE_OFFSET, Schedule::LocalVar ); 129 105 } 130 106 else{ 131 107 //mov reg, ptr[ebp+offset] 132 compiler.codeGenerator.op_mov_RM(varSize,reg,REG_EBP,(int)pRelativeVar->offset + offsetOf64Head,MOD_BASE_DISP32); 133 } 134 obp-=sizeof(long); 135 AddLocalVarAddrSchedule(); 136 obp+=sizeof(long); 108 compiler.codeGenerator.op_mov_RM(varSize,reg,REG_EBP,(int)pRelativeVar->offset + offsetOf64Head,MOD_BASE_DISP32, Schedule::LocalVar ); 109 } 137 110 } 138 111 else if(pRelativeVar->dwKind==VAR_REFLOCAL){ 139 112 if(pRelativeVar->bOffsetOffset){ 140 113 //add ecx,qword ptr[ebp+offset] 141 compiler.codeGenerator.op_add_RM(varSize,REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32 );114 compiler.codeGenerator.op_add_RM(varSize,REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 142 115 } 143 116 else{ 144 117 //mov ecx,qword ptr[ebp+offset] 145 compiler.codeGenerator.op_mov_RM(varSize,REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 146 } 147 obp-=sizeof(long); 148 AddLocalVarAddrSchedule(); 149 obp+=sizeof(long); 118 compiler.codeGenerator.op_mov_RM(varSize,REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 119 } 150 120 151 121 goto directmem; … … 170 140 if(pRelativeVar->bOffsetOffset){ 171 141 //push dword ptr[ecx+offset] 172 OpBuffer[obp++]=(char)0xFF; 173 OpBuffer[obp++]=(char)0xB1; 174 *((long *)(OpBuffer+obp))=pRelativeVar->offset; 175 pobj_GlobalVarSchedule->add(); 176 obp+=sizeof(long); 142 compiler.codeGenerator.op_push_M( REG_ECX, pRelativeVar->offset, Schedule::GlobalVar ); 177 143 } 178 144 else{ 179 145 //push dword ptr[offset] 180 OpBuffer[obp++]=(char)0xFF; 181 OpBuffer[obp++]=(char)0x35; 182 *((long *)(OpBuffer+obp))=pRelativeVar->offset; 183 pobj_GlobalVarSchedule->add(); 184 obp+=sizeof(long); 146 compiler.codeGenerator.op_push_M( REG_NON, pRelativeVar->offset, Schedule::GlobalVar ); 185 147 } 186 148 } 187 149 else if(pRelativeVar->dwKind==VAR_REFGLOBAL){ 188 150 //mov eax,dword ptr[offset] 189 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 190 obp-=sizeof(long); 191 pobj_GlobalVarSchedule->add(); 192 obp+=sizeof(long); 151 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32, Schedule::GlobalVar ); 193 152 194 153 if(pRelativeVar->bOffsetOffset){
Note:
See TracChangeset
for help on using the changeset viewer.