Changeset 254 in dev for trunk/abdev/BasicCompiler64/Compile_Var.cpp
- Timestamp:
- Jul 31, 2007, 4:30:31 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/Compile_Var.cpp
r243 r254 4 4 #include <jenga/include/smoothie/LexicalAnalysis.h> 5 5 6 #include <LexicalScopingImpl.h>7 6 #include <CodeGenerator.h> 8 7 #include <Compiler.h> … … 989 988 990 989 //mov qword ptr[rsp+offset],rax 991 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32); 992 obp-=sizeof(long); 993 AddLocalVarAddrSchedule(); 994 obp+=sizeof(long); 990 compiler.codeGenerator.localVarPertialSchedules.push_back( 991 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::None, true ) 992 ); 995 993 } 996 994 else if( type.IsSingle() ){ … … 999 997 1000 998 //mov dword ptr[rsp+offset],value 1001 compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::LocalVar, USE_OFFSET,*(int *)&flt); 999 compiler.codeGenerator.localVarPertialSchedules.push_back( 1000 compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::None, true, USE_OFFSET,*(int *)&flt) 1001 ); 1002 1002 } 1003 1003 else if( type.Is64() || type.IsPointer() ){ … … 1014 1014 1015 1015 //mov qword ptr[rsp+offset],rax 1016 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::LocalVar ); 1016 compiler.codeGenerator.localVarPertialSchedules.push_back( 1017 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::None, true ) 1018 ); 1017 1019 } 1018 1020 else{ … … 1022 1024 1023 1025 //mov qword ptr[rsp+offset],rax 1024 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::LocalVar ); 1026 compiler.codeGenerator.localVarPertialSchedules.push_back( 1027 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::None, true ) 1028 ); 1025 1029 } 1026 1030 else{ 1027 1031 //mov qword ptr[rsp+offset],value 1028 compiler.codeGenerator.op_mov_MV(sizeof(_int64),REG_RSP,offset, Schedule::LocalVar, USE_OFFSET,(int)i64data); 1032 compiler.codeGenerator.localVarPertialSchedules.push_back( 1033 compiler.codeGenerator.op_mov_MV(sizeof(_int64),REG_RSP,offset, Schedule::None, true, USE_OFFSET,(int)i64data) 1034 ); 1029 1035 } 1030 1036 } … … 1032 1038 else if( type.IsDWord() || type.IsLong() ){ 1033 1039 //mov dword ptr[rsp+offset],value 1034 compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::LocalVar,USE_OFFSET,(int)i64data); 1040 compiler.codeGenerator.localVarPertialSchedules.push_back( 1041 compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::None, true, USE_OFFSET,(int)i64data) 1042 ); 1035 1043 } 1036 1044 else if( type.IsWord() || type.IsInteger() ){ 1037 1045 //mov word ptr[rsp+offset],value 1038 compiler.codeGenerator.op_mov_MV(sizeof(short),REG_RSP,offset, Schedule::LocalVar,USE_OFFSET,(int)i64data); 1046 compiler.codeGenerator.localVarPertialSchedules.push_back( 1047 compiler.codeGenerator.op_mov_MV(sizeof(short),REG_RSP,offset, Schedule::None, true, USE_OFFSET,(int)i64data) 1048 ); 1039 1049 } 1040 1050 else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){ 1041 1051 //mov byte ptr[rsp+offset],value 1042 compiler.codeGenerator.op_mov_MV(sizeof(char),REG_RSP,offset, Schedule::LocalVar,USE_OFFSET,(int)i64data); 1052 compiler.codeGenerator.localVarPertialSchedules.push_back( 1053 compiler.codeGenerator.op_mov_MV(sizeof(char),REG_RSP,offset, Schedule::None, true, USE_OFFSET,(int)i64data) 1054 ); 1043 1055 } 1044 1056 return true; … … 1074 1086 1075 1087 //レキシカルスコープ 1076 pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() );1077 pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() );1088 pVar->SetScopeLevel( compiler.codeGenerator.lexicalScopes.GetNowLevel() ); 1089 pVar->SetScopeStartAddress( compiler.codeGenerator.lexicalScopes.GetStartAddress() ); 1078 1090 pVar->bLiving=TRUE; 1079 1091 … … 1109 1121 1110 1122 //レキシカルスコープ 1111 pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() );1112 pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() );1123 pVar->SetScopeLevel( compiler.codeGenerator.lexicalScopes.GetNowLevel() ); 1124 pVar->SetScopeStartAddress( compiler.codeGenerator.lexicalScopes.GetStartAddress() ); 1113 1125 pVar->bLiving=TRUE; 1114 1126 … … 1151 1163 1152 1164 //add rcx, offset 1153 compiler.codeGenerator.op_add_RV( REG_RCX, -pVar->GetOffsetAddress() ); 1154 obp-=sizeof(long); 1155 AddLocalVarAddrSchedule(); 1156 obp+=sizeof(long); 1165 compiler.codeGenerator.localVarPertialSchedules.push_back( 1166 compiler.codeGenerator.op_add_RV( REG_RCX, -pVar->GetOffsetAddress(), Schedule::None, true ) 1167 ); 1157 1168 1158 1169 //call FillMemory … … 1217 1228 if(pRelativeVar->bOffsetOffset){ 1218 1229 //add r11,offset 1219 compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::LocalVar ); 1230 compiler.codeGenerator.localVarPertialSchedules.push_back( 1231 compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::None, true ) 1232 ); 1220 1233 1221 1234 //add r11,rsp … … 1230 1243 1231 1244 //add reg,offset 1232 compiler.codeGenerator.op_add_RV(reg,(long)pRelativeVar->offset, Schedule::LocalVar ); 1245 compiler.codeGenerator.localVarPertialSchedules.push_back( 1246 compiler.codeGenerator.op_add_RV(reg,(long)pRelativeVar->offset, Schedule::None, true ) 1247 ); 1233 1248 } 1234 1249 } … … 1236 1251 if(pRelativeVar->bOffsetOffset){ 1237 1252 //add r11,qword ptr[rsp+offset] 1238 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_RSP, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::LocalVar ); 1253 compiler.codeGenerator.localVarPertialSchedules.push_back( 1254 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_RSP, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::None, true ) 1255 ); 1239 1256 } 1240 1257 else{ 1241 1258 //mov r11,qword ptr[rsp+offset] 1242 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 1259 compiler.codeGenerator.localVarPertialSchedules.push_back( 1260 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::None, true ) 1261 ); 1243 1262 } 1244 1263
Note:
See TracChangeset
for help on using the changeset viewer.