Changeset 109 in dev for BasicCompiler64/Compile_Func.cpp
- Timestamp:
- May 6, 2007, 7:09:04 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/Compile_Func.cpp
r97 r109 10 10 case FUNC_ADDRESSOF: 11 11 case FUNC_VARPTR: 12 case FUNC_OBJPTR: 12 13 return DEF_PTR_VOID; 13 14 case FUNC_GETDOUBLE: … … 31 32 if(lstrcmpi(FuncName,"SizeOf")==0) return FUNC_SIZEOF; 32 33 if(lstrcmpi(FuncName,"VarPtr")==0) return FUNC_VARPTR; 34 if(lstrcmpi(FuncName,"ObjPtr")==0) return FUNC_OBJPTR; 33 35 if(lstrcmpi(FuncName,"GetDouble")==0) return FUNC_GETDOUBLE; 34 36 if(lstrcmpi(FuncName,"GetSingle")==0) return FUNC_GETSINGLE; … … 221 223 SetVarPtrToReg(REG_RAX,&RelativeVar); 222 224 225 // TODO: 取り除く(この動きはObjPtrに託す) 223 226 if( beforeType == DEF_OBJECT && lstrcmpi( Parameter, "This" ) != 0 ){ 224 227 //参照をオブジェクトポインタに変更 … … 226 229 //mov rax,qword ptr[rax] 227 230 op_mov_RM( sizeof(_int64), REG_RAX, REG_RAX, 0, MOD_BASE ); 231 } 232 } 233 void Opcode_Func_ObjPtr( const char *Parameter, Type &resultType, bool isCallOn ){ 234 if( isCallOn == false ){ 235 // 戻り値の型を取得するだけ 236 237 //変数のアドレスを取得 238 if(!GetVarType( Parameter, resultType, true )) return; 239 240 resultType.PtrLevelUp(); 241 242 return; 243 } 244 245 RELATIVE_VAR RelativeVar; 246 247 //変数のアドレスを取得 248 if(!GetVarOffsetReadOnly( Parameter, &RelativeVar, resultType )) return; 249 250 int beforeType = resultType.GetBasicType(); 251 252 resultType.PtrLevelUp(); 253 254 SetVarPtrToReg(REG_RAX,&RelativeVar); 255 256 if( beforeType == DEF_OBJECT && lstrcmpi( Parameter, "This" ) != 0 ){ 257 //参照をオブジェクトポインタに変更 258 259 //mov rax,qword ptr[rax] 260 op_mov_RM( sizeof(_int64), REG_RAX, REG_RAX, 0, MOD_BASE ); 261 } 262 else{ 263 SetError(134,NULL,cp ); 228 264 } 229 265 } … … 270 306 Opcode_Func_VarPtr( Parameter, resultType, isCallOn ); 271 307 break; 308 case FUNC_OBJPTR: 309 Opcode_Func_ObjPtr( Parameter, resultType, isCallOn ); 310 break; 272 311 273 312 case FUNC_GETDOUBLE:
Note:
See TracChangeset
for help on using the changeset viewer.