Changeset 342 in dev for trunk/abdev/BasicCompiler32
- Timestamp:
- Oct 9, 2007, 1:10:33 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_CallProc.cpp
r339 r342 81 81 } 82 82 83 bool Opcode_CallProc(const char *Parameter,const UserProc *pUserProc,DWORD dwFlags,const char *ObjectName ){ 84 int i2; 85 83 bool Opcode_CallProc(const char *Parameter,const UserProc *pUserProc,DWORD dwFlags,const char *ObjectName ) 84 { 86 85 if( pUserProc->IsMacro() ){ 87 86 if( lstrcmpi( pUserProc->GetName().c_str(), "Print" ) == 0 ){ … … 157 156 ///////////////////////////////// 158 157 pMethod = NULL; 159 if( ! isStatic ) pMethod = pobj_c->Get Methods().GetMethodPtr( pUserProc );158 if( ! isStatic ) pMethod = pobj_c->GetDynamicMethods().GetMethodPtr( pUserProc ); 160 159 if( ! pMethod ){ 161 160 //動的メソッドが取得できなかったときは静的メソッドを当たる … … 331 330 // ->func3 332 331 332 // vtblマスターリストのポインタを取得 333 333 //mov edx,dword ptr[ecx] 334 334 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, 0, MOD_BASE ); 335 336 i2 = pobj_c->GetFuncNumInVtbl( pUserProc ); 335 336 // vtblのポインタを取得 337 //mov edx,dword ptr[edx+vtblMasterListIndex] 338 int vtblMasterListIndex = pobj_c->GetVtblMasterListIndex( pUserProc ); 339 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EDX, vtblMasterListIndex, MOD_BASE_DISP32 ); 340 341 int vtblIndex = pobj_c->GetFuncNumInVtbl( pUserProc ); 337 342 338 343 //call dword ptr[edx+func_index] 339 if(i2*PTR_SIZE<=0x7F){ 344 if( vtblIndex * PTR_SIZE <= 0x7F ) 345 { 340 346 compiler.codeGenerator.PutOld( 341 347 (char)0xFF, 342 348 (char)0x52, 343 (char)( i2*PTR_SIZE)349 (char)(vtblIndex*PTR_SIZE) 344 350 ); 345 351 } … … 349 355 (char)0x92 350 356 ); 351 compiler.codeGenerator.PutOld( (long)( i2*PTR_SIZE), Schedule::None );357 compiler.codeGenerator.PutOld( (long)(vtblIndex*PTR_SIZE), Schedule::None ); 352 358 } 353 359 } -
trunk/abdev/BasicCompiler32/Compile_Func.cpp
r339 r342 274 274 // ->func3 275 275 276 // vtblマスターリストのポインタを取得 276 277 //mov edx,dword ptr[ecx] 277 278 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, 0, MOD_BASE ); 278 279 int i2 = pobj_c->GetFuncNumInVtbl( &userProc ); 279 280 // vtblのポインタを取得 281 //mov edx,dword ptr[edx+vtblMasterListIndex] 282 int vtblMasterListIndex = pobj_c->GetVtblMasterListIndex( &userProc ); 283 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EDX, vtblMasterListIndex, MOD_BASE_DISP32 ); 284 285 int vtblIndex = pobj_c->GetFuncNumInVtbl( &userProc ); 280 286 281 287 //mov eax,dword ptr[edx+func_index] 282 if(i2*PTR_SIZE<=0x7F){ 283 compiler.codeGenerator.op_mov_RM(sizeof(long),REG_EAX,REG_EDX,i2*PTR_SIZE,MOD_BASE_DISP8); 288 if( vtblIndex * PTR_SIZE <= 0x7F ) 289 { 290 compiler.codeGenerator.op_mov_RM(sizeof(long),REG_EAX,REG_EDX,vtblIndex*PTR_SIZE,MOD_BASE_DISP8); 284 291 } 285 292 else{ 286 compiler.codeGenerator.op_mov_RM(sizeof(long),REG_EAX,REG_EDX, i2*PTR_SIZE,MOD_BASE_DISP32);293 compiler.codeGenerator.op_mov_RM(sizeof(long),REG_EAX,REG_EDX,vtblIndex*PTR_SIZE,MOD_BASE_DISP32); 287 294 } 288 295 } -
trunk/abdev/BasicCompiler32/Compile_Object.cpp
r334 r342 39 39 40 40 std::vector<const UserProc *> subs; 41 pobj_c->Get Methods().Enum( pobj_c->GetName().c_str(), subs );41 pobj_c->GetDynamicMethods().Enum( pobj_c->GetName().c_str(), subs ); 42 42 43 43 const UserProc *pUserProc; … … 59 59 // obj._System_SetType( _System_TypeBase.Search( strNamespace, name ) ) 60 60 subs.clear(); 61 pobj_c->Get Methods().Enum( "_System_SetType", subs );61 pobj_c->GetDynamicMethods().Enum( "_System_SetType", subs ); 62 62 if( subs.size() == 1 ){ 63 63 char temporary[VN_SIZE]; … … 217 217 218 218 // 仮想関数になるメソッドに使用チェックをつける 219 BOOST_FOREACH( const CMethod *pMethod, classObj.Get Methods() )219 BOOST_FOREACH( const CMethod *pMethod, classObj.GetDynamicMethods() ) 220 220 { 221 221 if( pMethod->IsVirtual() ) … … 224 224 } 225 225 } 226 BOOST_FOREACH( const ::Interface &objInterface, classObj.GetInterfaces() ) 227 { 228 BOOST_FOREACH( const CMethod *pMethod, objInterface.GetClass().GetDynamicMethods() ) 229 { 230 if( pMethod->IsVirtual() ) 231 { 232 pMethod->GetUserProc().Using(); 233 } 234 } 235 } 226 236 } 227 237 -
trunk/abdev/BasicCompiler32/Compile_Statement.cpp
r326 r342 923 923 if(type1.IsObject()){ 924 924 std::vector<const UserProc *> subs; 925 type1.GetClass().Get Methods().Enum( CALC_EQUAL, subs );925 type1.GetClass().GetDynamicMethods().Enum( CALC_EQUAL, subs ); 926 926 if( subs.size() == 0 ){ 927 927 return; -
trunk/abdev/BasicCompiler32/MakePeHdr.cpp
r334 r342 1061 1061 //////////////////////////////////////// 1062 1062 //仮想関数データテーブルスケジュール 1063 compiler.GetObjectModule().meta.GetClasses().ActionVtblSchedule( ImageBase,MemPos_CodeSection);1063 compiler.GetObjectModule().meta.GetClasses().ActionVtblSchedule( ImageBase, MemPos_CodeSection, MemPos_DataSection ); 1064 1064 1065 1065 -
trunk/abdev/BasicCompiler32/NumOpe.cpp
r334 r342 232 232 GetVarFormatString(methodName,parameter,lpPtrOffset,dummy,refType); 233 233 234 objClass.Get Methods().Enum( methodName, userProcs );234 objClass.GetDynamicMethods().Enum( methodName, userProcs ); 235 235 if(userProcs.size()){ 236 236 //オーバーロードを解決 -
trunk/abdev/BasicCompiler32/OperatorProc.cpp
r334 r342 34 34 35 35 std::vector<const UserProc *> subs; 36 pobj_c->Get Methods().Enum( idCalc, subs );36 pobj_c->GetDynamicMethods().Enum( idCalc, subs ); 37 37 if( subs.size() == 0 ){ 38 38 return 0; … … 254 254 void CallIndexerGetterProc( const Type &classType, const char *ObjectName, char *Parameter,Type &resultType, DWORD dwProcFlags ){ 255 255 std::vector<const UserProc *> subs; 256 classType.GetClass().Get Methods().Enum( CALC_ARRAY_GET, subs );256 classType.GetClass().GetDynamicMethods().Enum( CALC_ARRAY_GET, subs ); 257 257 if( subs.size() == 0 ){ 258 258 return;
Note:
See TracChangeset
for help on using the changeset viewer.