Changeset 349 in dev for trunk/abdev/BasicCompiler64/Compile_Object.cpp
- Timestamp:
- Oct 13, 2007, 11:45:58 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/Compile_Object.cpp
r346 r349 90 90 } 91 91 } 92 void Operator_New( const CClass &classObj, const char *objectSizeStr, const char *parameter, const Type &baseType ){ 93 int typeSize = classObj.GetSize(); 94 95 if(classObj.IsAbstract()){ 92 void Operator_New( const CClass &objClass, const char *objectSizeStr, const char *parameter, const Type &baseType ) 93 { 94 const CClass *pClass = &objClass; 95 int typeSize = pClass->GetSize(); 96 97 if( pClass->IsInterface() ) 98 { 99 pClass = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr(); 100 } 101 102 if( pClass->IsAbstract() ){ 96 103 //抽象クラスだったとき 97 SetError(125, classObj.GetName().c_str(),cp);104 SetError(125,pClass->GetName().c_str(),cp); 98 105 } 99 106 … … 177 184 178 185 179 const CMethod *method = classObj.GetDestructorMethod();186 const CMethod *method = pClass->GetDestructorMethod(); 180 187 if( method == NULL ) return; 181 188 … … 201 208 202 209 //仮想関数テーブルを初期化 203 if( classObj.IsExistVirtualFunctions()204 && ! classObj.IsAbstract() )210 if( pClass->IsExistVirtualFunctions() 211 && !pClass->IsAbstract() ) 205 212 { 206 213 // mov rcx,vtblAddress 207 compiler.codeGenerator.op_mov_RV_vtbl( REG_RCX, &classObj);214 compiler.codeGenerator.op_mov_RV_vtbl( REG_RCX, pClass ); 208 215 209 216 //mov qword ptr[rax],rcx … … 212 219 213 220 // 仮想関数になるメソッドに使用チェックをつける 214 BOOST_FOREACH( const CMethod *pMethod, classObj.GetDynamicMethods() )221 BOOST_FOREACH( const CMethod *pMethod, pClass->GetDynamicMethods() ) 215 222 { 216 223 if( pMethod->IsVirtual() ) … … 219 226 } 220 227 } 221 BOOST_FOREACH( const ::Interface *pInterface, classObj.GetInterfaces() )228 BOOST_FOREACH( const ::Interface *pInterface, pClass->GetInterfaces() ) 222 229 { 223 230 BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() ) … … 238 245 //////////////////////////// 239 246 240 _call_constructor( &classObj,parameter,typeSize,bSomeObjects);247 _call_constructor(pClass,parameter,typeSize,bSomeObjects); 241 248 242 249
Note:
See TracChangeset
for help on using the changeset viewer.