Changeset 348 in dev
- Timestamp:
- Oct 12, 2007, 3:25:54 AM (17 years ago)
- Location:
- trunk/abdev
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_CallProc.cpp
r347 r348 330 330 // ->func3 331 331 332 int vtblMasterListIndex, vtblIndex; 333 pobj_c->GetVtblMasterListIndexAndVtblIndex( pUserProc, vtblMasterListIndex, vtblIndex ); 334 332 335 // vtblマスターリストのポインタを取得 333 336 //mov edx,dword ptr[ecx] … … 336 339 // vtblのポインタを取得 337 340 //mov edx,dword ptr[edx+vtblMasterListIndex] 338 int vtblMasterListIndex = pobj_c->GetVtblMasterListIndex( pUserProc );339 341 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EDX, vtblMasterListIndex, MOD_BASE_DISP32 ); 340 341 int vtblIndex = pobj_c->GetFuncNumInVtbl( pUserProc );342 342 343 343 //call dword ptr[edx+func_index] -
trunk/abdev/BasicCompiler32/Compile_Func.cpp
r342 r348 274 274 // ->func3 275 275 276 int vtblMasterListIndex, vtblIndex; 277 pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex ); 278 276 279 // vtblマスターリストのポインタを取得 277 280 //mov edx,dword ptr[ecx] … … 280 283 // vtblのポインタを取得 281 284 //mov edx,dword ptr[edx+vtblMasterListIndex] 282 int vtblMasterListIndex = pobj_c->GetVtblMasterListIndex( &userProc );283 285 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EDX, vtblMasterListIndex, MOD_BASE_DISP32 ); 284 285 int vtblIndex = pobj_c->GetFuncNumInVtbl( &userProc );286 286 287 287 //mov eax,dword ptr[edx+func_index] -
trunk/abdev/BasicCompiler64/Compile_CallProc.cpp
r347 r348 361 361 // ->func3 362 362 363 int vtblMasterListIndex, vtblIndex; 364 pobj_c->GetVtblMasterListIndexAndVtblIndex( pUserProc, vtblMasterListIndex, vtblIndex ); 365 363 366 // vtblマスターリストのポインタを取得 364 367 //mov r11,qword ptr[rcx] … … 367 370 // vtblのポインタを取得 368 371 //mov r11,dword ptr[r11+vtblMasterListIndex] 369 int vtblMasterListIndex = pobj_c->GetVtblMasterListIndex( pUserProc ); 370 compiler.codeGenerator.op_mov_RM( sizeof(_int64), REG_R11, REG_R11, vtblMasterListIndex, MOD_BASE_DISP32 ); 371 372 int vtblIndex = pobj_c->GetFuncNumInVtbl( pUserProc ); 372 compiler.codeGenerator.op_mov_RM( sizeof(_int64), REG_R11, REG_R11, vtblMasterListIndex*PTR_SIZE, MOD_BASE_DISP32 ); 373 373 374 374 //call qword ptr[r11+func_index] -
trunk/abdev/BasicCompiler64/Compile_Func.cpp
r345 r348 121 121 // ->func3 122 122 123 int vtblMasterListIndex, vtblIndex; 124 pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex ); 125 123 126 // vtblマスターリストのポインタを取得 124 127 //mov r11,qword ptr[rcx] … … 127 130 // vtblのポインタを取得 128 131 //mov r11,dword ptr[r11+vtblMasterListIndex] 129 int vtblMasterListIndex = pobj_c->GetVtblMasterListIndex( &userProc );130 132 compiler.codeGenerator.op_mov_RM( sizeof(_int64), REG_R11, REG_R11, vtblMasterListIndex, MOD_BASE_DISP32 ); 131 132 int vtblIndex = pobj_c->GetFuncNumInVtbl( &userProc );133 133 134 134 //mov rax,qword ptr[r11+func_index] -
trunk/abdev/BasicCompiler_Common/include/Class.h
r347 r348 493 493 std::vector<long> vtblMasterList; 494 494 public: 495 int GetVtblMasterListIndex( const UserProc *pUserProc ) const; 496 int GetFuncNumInVtbl( const UserProc *pUserProc ) const; 495 void GetVtblMasterListIndexAndVtblIndex( const UserProc *pUserProc, int &vtblMasterListIndex, int &vtblIndex ) const; 497 496 long GetVtblMasterListOffset() const; 498 497 void GenerateVTableMasterList( const std::vector<long> &vtableMasterList, long &offset ); -
trunk/abdev/BasicCompiler_Common/include/Symbol.h
r271 r348 69 69 return name; 70 70 } 71 std::string GetFullName() const; 71 72 72 73 // シンボル比較 -
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r347 r348 817 817 } 818 818 819 int CClass::GetVtblMasterListIndex( const UserProc *pUserProc ) const 820 { 821 int index = 0; 819 void CClass::GetVtblMasterListIndexAndVtblIndex( const UserProc *pUserProc, int &vtblMasterListIndex, int &vtblIndex ) const 820 { 821 vtblMasterListIndex = 0; 822 823 vtblIndex = 0; 822 824 BOOST_FOREACH( const CMethod *pMethod, GetDynamicMethods() ){ 823 825 if( &pMethod->GetUserProc() == pUserProc ) 824 826 { 825 return index; 827 return; 828 } 829 830 if( pMethod->IsVirtual() ) 831 { 832 vtblIndex++; 826 833 } 827 834 } … … 829 836 BOOST_FOREACH( const ::Interface *pInterface, interfaces ) 830 837 { 831 index++; 832 838 vtblMasterListIndex++; 839 840 vtblIndex = 0; 833 841 BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() ){ 834 842 if( &pMethod->GetUserProc() == pUserProc ) 835 843 { 836 return index; 844 return; 845 } 846 847 if( pMethod->IsVirtual() ) 848 { 849 vtblIndex++; 837 850 } 838 851 } … … 840 853 841 854 SetError(); 842 return 0; 843 } 844 int CClass::GetFuncNumInVtbl( const UserProc *pUserProc ) const 845 { 846 int n = 0; 847 BOOST_FOREACH( const CMethod *pMethod, GetDynamicMethods() ){ 848 if( &pMethod->GetUserProc() == pUserProc ) break; 849 if( pMethod->IsVirtual() ) n++; 850 } 851 return n; 855 return; 852 856 } 853 857 long CClass::GetVtblMasterListOffset() const … … 1523 1527 } 1524 1528 1525 if( pobj_c->GetName() == "Object" || dwClassType == ESC_TYPE ){ 1529 if( pobj_c->GetName() == "Object" 1530 || pobj_c->GetFullName() == "ActiveBasic.Core.InterfaceInfo" 1531 || dwClassType == ESC_TYPE ) 1532 { 1533 // 何も継承しない 1534 1526 1535 if( &pobj_c->GetSuperClass() || pobj_c->GetVtblNum() ) 1527 1536 { -
trunk/abdev/BasicCompiler_Common/src/Symbol.cpp
r271 r348 26 26 namespaceScopes = NamespaceScopes( areaName ); 27 27 name = nestName; 28 } 29 30 std::string Symbol::GetFullName() const 31 { 32 if( namespaceScopes.size() ) 33 { 34 return namespaceScopes.ToString() + "." + name; 35 } 36 37 return name; 28 38 } 29 39
Note:
See TracChangeset
for help on using the changeset viewer.