Changeset 336 in dev for trunk/abdev/BasicCompiler32
- Timestamp:
- Sep 29, 2007, 12:45:16 PM (17 years ago)
- File:
-
- 1 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 {
Note:
See TracChangeset
for help on using the changeset viewer.