Changeset 345 in dev for trunk/abdev/BasicCompiler64
- Timestamp:
- Oct 10, 2007, 1:52:43 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler64
- Files:
-
- 8 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;
Note:
See TracChangeset
for help on using the changeset viewer.