Changeset 345 in dev
- Timestamp:
- Oct 10, 2007, 1:52:43 AM (17 years ago)
- Location:
- trunk/abdev
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/BasicCompiler.vcproj
r322 r345 91 91 ProgramDatabaseFile=".\Debug/BasicCompiler64.pdb" 92 92 SubSystem="2" 93 StackReserveSize="4194304" 93 94 TargetMachine="0" 94 95 /> -
trunk/abdev/BasicCompiler64/Compile_CallProc.cpp
r339 r345 89 89 } 90 90 91 bool Opcode_CallProc(const char *Parameter,const UserProc *pUserProc,DWORD dwFlags,const char *ObjectName){ 92 int i2; 93 91 bool Opcode_CallProc(const char *Parameter,const UserProc *pUserProc,DWORD dwFlags,const char *ObjectName) 92 { 94 93 if( pUserProc->IsMacro() ){ 95 94 if( lstrcmpi( pUserProc->GetName().c_str(), "Print" ) == 0 ){ … … 165 164 ///////////////////////////////// 166 165 pMethod = NULL; 167 if( ! isStatic ) pMethod = pobj_c->Get Methods().GetMethodPtr( pUserProc );166 if( ! isStatic ) pMethod = pobj_c->GetDynamicMethods().GetMethodPtr( pUserProc ); 168 167 if( ! pMethod ){ 169 168 //動的メソッドが取得できなかったときは静的メソッドを当たる … … 362 361 // ->func3 363 362 363 // vtblマスターリストのポインタを取得 364 364 //mov r11,qword ptr[rcx] 365 365 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,0,MOD_BASE); 366 366 367 i2 = pobj_c->GetFuncNumInVtbl( pUserProc ); 367 // vtblのポインタを取得 368 //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 ); 368 373 369 374 //call qword ptr[r11+func_index] 370 if( i2*PTR_SIZE<=0x7F){375 if( vtblIndex * PTR_SIZE <= 0x7F ){ 371 376 compiler.codeGenerator.PutOld( 372 377 (char)0x41, 373 378 (char)0xFF, 374 379 (char)0x53, 375 (char)( i2*PTR_SIZE)380 (char)(vtblIndex*PTR_SIZE) 376 381 ); 377 382 } … … 381 386 (char)0xFF, 382 387 (char)0x93, 383 (long)( i2*PTR_SIZE)388 (long)(vtblIndex*PTR_SIZE) 384 389 ); 385 390 } -
trunk/abdev/BasicCompiler64/Compile_Func.cpp
r339 r345 121 121 // ->func3 122 122 123 // vtblマスターリストのポインタを取得 123 124 //mov r11,qword ptr[rcx] 124 125 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,0,MOD_BASE); 125 126 126 int i2 = pobj_c->GetFuncNumInVtbl( &userProc ); 127 // vtblのポインタを取得 128 //mov r11,dword ptr[r11+vtblMasterListIndex] 129 int vtblMasterListIndex = pobj_c->GetVtblMasterListIndex( &userProc ); 130 compiler.codeGenerator.op_mov_RM( sizeof(_int64), REG_R11, REG_R11, vtblMasterListIndex, MOD_BASE_DISP32 ); 131 132 int vtblIndex = pobj_c->GetFuncNumInVtbl( &userProc ); 127 133 128 134 //mov rax,qword ptr[r11+func_index] 129 if(i2*PTR_SIZE<=0x7F){ 130 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_RAX,REG_R11,i2*PTR_SIZE,MOD_BASE_DISP8); 131 } 132 else{ 133 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_RAX,REG_R11,i2*PTR_SIZE,MOD_BASE_DISP32); 135 if( vtblIndex * PTR_SIZE <= 0x7F ) 136 { 137 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_RAX,REG_R11,vtblIndex*PTR_SIZE,MOD_BASE_DISP8); 138 } 139 else 140 { 141 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_RAX,REG_R11,vtblIndex*PTR_SIZE,MOD_BASE_DISP32); 134 142 } 135 143 } -
trunk/abdev/BasicCompiler64/Compile_Object.cpp
r319 r345 37 37 38 38 std::vector<const UserProc *> subs; 39 pobj_c->Get Methods().Enum( pobj_c->GetName().c_str(), subs );39 pobj_c->GetDynamicMethods().Enum( pobj_c->GetName().c_str(), subs ); 40 40 41 41 const UserProc *pUserProc; … … 57 57 // obj._System_SetType( _System_TypeBase.Search( strNamespace, name ) ) 58 58 subs.clear(); 59 pobj_c->Get Methods().Enum( "_System_SetType", subs );59 pobj_c->GetDynamicMethods().Enum( "_System_SetType", subs ); 60 60 if( subs.size() == 1 ){ 61 61 char temporary[VN_SIZE]; … … 212 212 213 213 // 仮想関数になるメソッドに使用チェックをつける 214 BOOST_FOREACH( const CMethod *pMethod, classObj.Get Methods() )214 BOOST_FOREACH( const CMethod *pMethod, classObj.GetDynamicMethods() ) 215 215 { 216 216 if( pMethod->IsVirtual() ) 217 217 { 218 218 pMethod->GetUserProc().Using(); 219 } 220 } 221 BOOST_FOREACH( const ::Interface &objInterface, classObj.GetInterfaces() ) 222 { 223 BOOST_FOREACH( const CMethod *pMethod, objInterface.GetDynamicMethods() ) 224 { 225 if( pMethod->IsVirtual() ) 226 { 227 pMethod->GetUserProc().Using(); 228 } 219 229 } 220 230 } -
trunk/abdev/BasicCompiler64/Compile_Statement.cpp
r326 r345 684 684 if(type1.IsObject()){ 685 685 std::vector<const UserProc *> subs; 686 type1.GetClass().Get Methods().Enum( CALC_EQUAL, subs );686 type1.GetClass().GetDynamicMethods().Enum( CALC_EQUAL, subs ); 687 687 if( subs.size() == 0 ){ 688 688 return; -
trunk/abdev/BasicCompiler64/MakePeHdr.cpp
r322 r345 1059 1059 //////////////////////////////////////// 1060 1060 //仮想関数データテーブルスケジュール 1061 compiler.GetObjectModule().meta.GetClasses().ActionVtblSchedule( ImageBase,MemPos_CodeSection);1061 compiler.GetObjectModule().meta.GetClasses().ActionVtblSchedule( ImageBase, MemPos_CodeSection, MemPos_DataSection ); 1062 1062 1063 1063 -
trunk/abdev/BasicCompiler64/NumOpe.cpp
r339 r345 233 233 GetVarFormatString(methodName,parameter,lpPtrOffset,dummy,refType); 234 234 235 objClass.Get Methods().Enum( methodName, userProcs );235 objClass.GetDynamicMethods().Enum( methodName, userProcs ); 236 236 if(userProcs.size()){ 237 237 //オーバーロードを解決 -
trunk/abdev/BasicCompiler64/OperatorProc.cpp
r339 r345 39 39 40 40 std::vector<const UserProc *> subs; 41 pobj_c->Get Methods().Enum( idCalc, subs );41 pobj_c->GetDynamicMethods().Enum( idCalc, subs ); 42 42 if( subs.size() == 0 ){ 43 43 return 0; … … 324 324 325 325 std::vector<const UserProc *> subs; 326 classType.GetClass().Get Methods().Enum( CALC_ARRAY_GET, subs );326 classType.GetClass().GetDynamicMethods().Enum( CALC_ARRAY_GET, subs ); 327 327 if( subs.size() == 0 ){ 328 328 return; -
trunk/abdev/BasicCompiler_Common/include/Class.h
r344 r345 75 75 { 76 76 const CClass *pInterfaceClass; 77 mutable intvtblOffset;77 mutable LONG_PTR vtblOffset; 78 78 79 79 public: … … 480 480 long vtbl_offset; 481 481 long vtblMasterListOffset; 482 std::vector< LONG_PTR> vtblMasterList;482 std::vector<long> vtblMasterList; 483 483 public: 484 484 int GetVtblMasterListIndex( const UserProc *pUserProc ) const; 485 485 int GetFuncNumInVtbl( const UserProc *pUserProc ) const; 486 LONG_PTRGetVtblMasterListOffset() const;487 void GenerateVTablePart( LONG_PTR&vtableDataTableOffset ) const;488 void GenerateVTableMasterList( const std::vector< LONG_PTR> &vtableMasterList, LONG_PTR&offset );486 long GetVtblMasterListOffset() const; 487 void GenerateVTablePart( long &vtableDataTableOffset ) const; 488 void GenerateVTableMasterList( const std::vector<long> &vtableMasterList, long &offset ); 489 489 void GenerateFullVTables(); 490 490 void ActionVtblSchedule( LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection, LONG_PTR MemPos_DataSection ); -
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r344 r345 826 826 return n; 827 827 } 828 LONG_PTRCClass::GetVtblMasterListOffset() const828 long CClass::GetVtblMasterListOffset() const 829 829 { 830 830 //既に存在する場合はそれを返す … … 836 836 return vtblMasterListOffset; 837 837 } 838 void CClass::GenerateVTablePart( LONG_PTR&vtableDataTableOffset ) const838 void CClass::GenerateVTablePart( long &vtableDataTableOffset ) const 839 839 { 840 840 const UserProc **ppsi = (const UserProc **)malloc(GetVtblNum()*sizeof(UserProc *)); … … 866 866 867 867 for( int i=0; i < GetVtblNum(); i++ ){ 868 pobj_Reloc->AddSchedule_DataSection( vtableDataTableOffset+i*sizeof(LONG_PTR));868 pobj_Reloc->AddSchedule_DataSection(static_cast<DWORD>(vtableDataTableOffset+i*sizeof(LONG_PTR))); 869 869 } 870 870 871 871 free(ppsi); 872 872 } 873 void CClass::GenerateVTableMasterList( const std::vector< LONG_PTR> &vtableMasterList, LONG_PTR&offset )873 void CClass::GenerateVTableMasterList( const std::vector<long> &vtableMasterList, long &offset ) 874 874 { 875 875 offset = compiler.GetObjectModule().dataTable.AddBinary( 876 876 (void *)&vtableMasterList[0], 877 vtableMasterList.size()*sizeof(LONG_PTR)877 static_cast<int>(vtableMasterList.size()*sizeof(LONG_PTR)) 878 878 ); 879 879 } … … 904 904 BOOST_FOREACH( const ::Interface &objInterface, interfaces ) 905 905 { 906 LONG_PTRtempVtblOffset;906 long tempVtblOffset; 907 907 objInterface.GetClass().GenerateVTablePart( tempVtblOffset ); 908 908 vtblMasterList.push_back( tempVtblOffset );
Note:
See TracChangeset
for help on using the changeset viewer.