Changeset 336 in dev
- Timestamp:
- Sep 29, 2007, 12:45:16 PM (17 years ago)
- Location:
- trunk/abdev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Func.cpp
r335 r336 307 307 308 308 309 if( userProc.GetMethod().IsDynamic() ) 310 { 311 ///////////////////////////////////////////////////////////////// 312 // オブジェクト ポインタをpush 313 ///////////////////////////////////////////////////////////////// 314 315 // オブジェクト名を取得 316 char objectName[VN_SIZE]; 317 char memberName[VN_SIZE]; 318 char *thisPtrName = "This"; 319 Type type; 320 if( SplitMemberName( methodInstanceName, objectName, memberName ) ) 321 { 322 if( GetVarType( objectName, type, false ) ) 323 { 324 thisPtrName = objectName; 325 } 326 } 327 328 // オブジェクト ポインタを取得 329 RELATIVE_VAR relativeVar; 330 GetVarOffsetReadOnly( thisPtrName, &relativeVar, type ); 331 if( !type.IsObject() ) 332 { 333 extern int cp; 334 SetError(1,NULL,cp); 335 return; 336 } 337 338 SetVarPtrToEax( &relativeVar ); 339 340 //mov eax,dword ptr[eax] 341 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE ); 342 343 //push eax 344 compiler.codeGenerator.op_push( REG_EAX ); 345 } 346 347 309 348 ///////////////////////////////////////////////////////////////// 310 // オブジェクト ポインタをpush349 // call _CreateDynamicDelegate/_CreateStaticDelegate 311 350 ///////////////////////////////////////////////////////////////// 312 351 313 // オブジェクト名を取得314 char objectName[VN_SIZE];315 char memberName[VN_SIZE];316 char *thisPtrName = "This";317 Type type;318 if( SplitMemberName( methodInstanceName, objectName, memberName ) )319 {320 if( GetVarType( objectName, type, false ) )321 {322 thisPtrName = objectName;323 }324 }325 326 // オブジェクト ポインタを取得327 RELATIVE_VAR relativeVar;328 GetVarOffsetReadOnly( thisPtrName, &relativeVar, type );329 if( !type.IsObject() )330 {331 extern int cp;332 SetError(1,NULL,cp);333 return;334 }335 336 SetVarPtrToEax( &relativeVar );337 338 //mov eax,dword ptr[eax]339 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE );340 341 //push eax342 compiler.codeGenerator.op_push( REG_EAX );343 344 345 /////////////////////////////////////////////////////////////////346 // call _System_CreateSimpleDynamicDelegate347 /////////////////////////////////////////////////////////////////348 349 352 std::vector<const UserProc *> subs; 350 dgClass.GetStaticMethods().Enum( "_CreateDelegate", subs ); 351 352 // call _System_CreateSimpleDynamicDelegate 353 if( userProc.GetMethod().IsDynamic() ) 354 { 355 dgClass.GetStaticMethods().Enum( "_CreateDynamicDelegate", subs ); 356 } 357 else 358 { 359 dgClass.GetStaticMethods().Enum( "_CreateStaticDelegate", subs ); 360 } 361 362 // call _CreateDynamicDelegate 353 363 compiler.codeGenerator.op_call( subs[0] ); 354 364 } … … 496 506 i = GetOneParameter( paramsStr, i, methodPtrParamStr ); 497 507 498 char objPtrValueStr[VN_SIZE] ;508 char objPtrValueStr[VN_SIZE]=""; 499 509 if( isDynamicCall ) 500 510 { -
trunk/abdev/BasicCompiler_Common/include/Method.h
r206 r336 55 55 virtual bool IsVirtual() const = 0; 56 56 virtual bool IsConst() const = 0; 57 virtual bool IsDynamic() const = 0; 57 58 virtual bool IsStatic() const = 0; 58 59 virtual const CClass *GetInheritsClassPtr() const = 0; … … 118 119 return isConst; 119 120 } 121 virtual bool IsDynamic() const 122 { 123 return true; 124 } 120 125 virtual bool IsStatic() const 121 126 { … … 159 164 } 160 165 virtual bool IsConst() const{SetError();return false;} 166 virtual bool IsDynamic() const 167 { 168 return false; 169 } 161 170 virtual bool IsStatic() const 162 171 { -
trunk/abdev/BasicCompiler_Common/include/Procedure.h
r326 r336 348 348 this->pMethod = pMethod; 349 349 } 350 const CMethod &GetMethod() const; 350 351 351 352 bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine, bool isStatic ); -
trunk/abdev/BasicCompiler_Common/include/ver.h
r324 r336 6 6 // バージョン付加文字列 7 7 #ifdef _AMD64_ 8 #define VER_INFO "(x64) (rev.3 38)"8 #define VER_INFO "(x64) (rev.342)" 9 9 #else 10 #define VER_INFO "(rev.3 38)"10 #define VER_INFO "(rev.342)" 11 11 #endif -
trunk/abdev/BasicCompiler_Common/src/Procedure.cpp
r324 r336 46 46 } 47 47 return ( pMethod->IsVirtual() != 0 ); 48 } 49 const CMethod &UserProc::GetMethod() const 50 { 51 if( !HasParentClass() ) 52 { 53 Jenga::Throw( "グローバル関数に対してUserProc::GetMethodメソッドが呼ばれた" ); 54 } 55 return *pMethod; 48 56 } 49 57
Note:
See TracChangeset
for help on using the changeset viewer.