diff --git a/src/coreclr/vm/classcompat.h b/src/coreclr/vm/classcompat.h index 2320318c954fb..0f022cf4e76c5 100644 --- a/src/coreclr/vm/classcompat.h +++ b/src/coreclr/vm/classcompat.h @@ -350,6 +350,7 @@ class MethodTableBuilder DispatchMapBuilder *pDispatchMapBuilder; +#ifndef DACCESS_COMPILE MethodDesc* GetMethodDescForSlot(WORD slot) { CONTRACTL @@ -365,6 +366,7 @@ class MethodTableBuilder (MethodTable::GetMethodDescForSlotAddress(pVtable[slot]) == pVtableMD[slot])); return pVtableMD[slot]; } +#endif // DACCESS_COMPILE void SetMethodDescForSlot(WORD slot, MethodDesc* pMD) { diff --git a/src/coreclr/vm/method.cpp b/src/coreclr/vm/method.cpp index f26a5ff7b5ede..4f7e9d1cc825a 100644 --- a/src/coreclr/vm/method.cpp +++ b/src/coreclr/vm/method.cpp @@ -285,6 +285,7 @@ LPCUTF8 MethodDesc::GetNameThrowing() } //******************************************************************************* +#ifndef DACCESS_COMPILE LPCUTF8 MethodDesc::GetName(USHORT slot) { // MethodDesc::GetDeclMethodDesc can throw. @@ -293,6 +294,7 @@ LPCUTF8 MethodDesc::GetName(USHORT slot) CONSISTENCY_CHECK(IsInterface() || !pDeclMD->IsInterface()); return pDeclMD->GetName(); } +#endif // DACCESS_COMPILE //******************************************************************************* LPCUTF8 MethodDesc::GetName() @@ -590,6 +592,7 @@ PTR_PCODE MethodDesc::GetAddrOfSlot() } //******************************************************************************* +#ifndef DACCESS_COMPILE PTR_MethodDesc MethodDesc::GetDeclMethodDesc(UINT32 slotNumber) { CONTRACTL { @@ -642,6 +645,7 @@ PTR_MethodDesc MethodDesc::GetDeclMethodDesc(UINT32 slotNumber) CONSISTENCY_CHECK((UINT32)pMDResult->GetSlot() == slotNumber); return PTR_MethodDesc(pMDResult); } +#endif // DACCESS_COMPILE //******************************************************************************* // Returns a hash for the method. diff --git a/src/coreclr/vm/method.hpp b/src/coreclr/vm/method.hpp index 168ccaef52d62..3d1f41eaa0144 100644 --- a/src/coreclr/vm/method.hpp +++ b/src/coreclr/vm/method.hpp @@ -333,7 +333,9 @@ class MethodDesc // See the TypeString class for better control over name formatting. LPCUTF8 GetName(); +#ifndef DACCESS_COMPILE LPCUTF8 GetName(USHORT slot); +#endif // DACCESS_COMPILE LPCUTF8 GetNameThrowing(); @@ -1053,7 +1055,9 @@ class MethodDesc PTR_PCODE GetAddrOfSlot(); +#ifndef DACCESS_COMPILE PTR_MethodDesc GetDeclMethodDesc(UINT32 slotNumber); +#endif // DACCESS_COMPILE public: mdMethodDef GetMemberDef() const; diff --git a/src/coreclr/vm/methodtable.cpp b/src/coreclr/vm/methodtable.cpp index e6c78910ded7c..925112aafe107 100644 --- a/src/coreclr/vm/methodtable.cpp +++ b/src/coreclr/vm/methodtable.cpp @@ -5857,41 +5857,6 @@ bool MethodTable::DispatchMapTypeMatchesMethodTable(DispatchMapTypeID typeID, Me return intIt.CurrentInterfaceMatches(this, pMT); } -//========================================================================================== -MethodDesc * MethodTable::GetIntroducingMethodDesc(DWORD slotNumber) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - } - CONTRACTL_END; - - MethodDesc * pCurrentMD = GetMethodDescForSlot(slotNumber); - DWORD dwSlot = pCurrentMD->GetSlot(); - MethodDesc * pIntroducingMD = NULL; - - MethodTable * pParentType = GetParentMethodTable(); - MethodTable * pPrevParentType = NULL; - - // Find this method in the parent. - // If it does exist in the parent, it would be at the same vtable slot. - while ((pParentType != NULL) && - (dwSlot < pParentType->GetNumVirtuals())) - { - pPrevParentType = pParentType; - pParentType = pParentType->GetParentMethodTable(); - } - - if (pPrevParentType != NULL) - { - pIntroducingMD = pPrevParentType->GetMethodDescForSlot(dwSlot); - } - - return pIntroducingMD; -} - //========================================================================================== // There is a case where a method declared in a type can be explicitly // overridden by a methodImpl on another method within the same type. In diff --git a/src/coreclr/vm/methodtable.h b/src/coreclr/vm/methodtable.h index 66ecee9073d80..55fb72b291127 100644 --- a/src/coreclr/vm/methodtable.h +++ b/src/coreclr/vm/methodtable.h @@ -1671,11 +1671,13 @@ class MethodTable // Slots <-> the MethodDesc associated with the slot. // +#ifndef DACCESS_COMPILE // Get the MethodDesc that implements a given slot // NOTE: Since this may fill in the slot with a temporary entrypoint if that hasn't happened // yet, when writing asserts, GetMethodDescForSlot_NoThrow should be used to avoid // the presence of an assert hiding bugs. MethodDesc* GetMethodDescForSlot(DWORD slot); +#endif // This api produces the same result as GetMethodDescForSlot, but it uses a variation on the // algorithm that does not allocate a temporary entrypoint for the slot if it doesn't exist. @@ -2434,8 +2436,6 @@ class MethodTable MethodTable *LookupDispatchMapType(DispatchMapTypeID typeID); bool DispatchMapTypeMatchesMethodTable(DispatchMapTypeID typeID, MethodTable* pMT); - MethodDesc *GetIntroducingMethodDesc(DWORD slotNumber); - // Determines whether all methods in the given interface have their final implementing // slot in a parent class. I.e. if this returns TRUE, it is trivial (no VSD lookup) to // dispatch pItfMT methods on this class if one knows how to dispatch them on pParentMT. diff --git a/src/coreclr/vm/methodtable.inl b/src/coreclr/vm/methodtable.inl index 37600f2644008..9ad333b065573 100644 --- a/src/coreclr/vm/methodtable.inl +++ b/src/coreclr/vm/methodtable.inl @@ -404,6 +404,7 @@ inline BOOL MethodTable::HasLayout() } //========================================================================================== +#ifndef DACCESS_COMPILE inline MethodDesc* MethodTable::GetMethodDescForSlot(DWORD slot) { CONTRACTL @@ -425,6 +426,7 @@ inline MethodDesc* MethodTable::GetMethodDescForSlot(DWORD slot) return MethodTable::GetMethodDescForSlotAddress(pCode); } +#endif // DACCESS_COMPILE //========================================================================================== inline MethodDesc* MethodTable::GetMethodDescForSlot_NoThrow(DWORD slot) diff --git a/src/coreclr/vm/methodtablebuilder.h b/src/coreclr/vm/methodtablebuilder.h index a4420fadb9642..eebc635106431 100644 --- a/src/coreclr/vm/methodtablebuilder.h +++ b/src/coreclr/vm/methodtablebuilder.h @@ -2265,7 +2265,6 @@ class MethodTableBuilder inline BOOL IsMethodImpl(); inline MethodClassification MethodType(); inline bmtMDMethod *GetMDMethod() const; - inline MethodDesc *GetIntroducingMethodDesc(); inline bmtMDMethod * operator->(); inline bmtMDMethod * operator*() { WRAPPER_NO_CONTRACT; return GetMDMethod(); } }; // class DeclaredMethodIterator diff --git a/src/coreclr/vm/methodtablebuilder.inl b/src/coreclr/vm/methodtablebuilder.inl index 6e55c063db53f..aa5f1223c6ccd 100644 --- a/src/coreclr/vm/methodtablebuilder.inl +++ b/src/coreclr/vm/methodtablebuilder.inl @@ -136,38 +136,6 @@ MethodTableBuilder::DeclaredMethodIterator::GetMDMethod() const return m_declaredMethods[m_idx]; } -//******************************************************************************* -inline class MethodDesc * -MethodTableBuilder::DeclaredMethodIterator::GetIntroducingMethodDesc() -{ - STANDARD_VM_CONTRACT; - - bmtMDMethod *pCurrentMD = GetMDMethod(); - DWORD dwSlot = pCurrentMD->GetSlotIndex(); - MethodDesc *pIntroducingMD = NULL; - - bmtRTType *pParentType = pCurrentMD->GetOwningType()->GetParentType(); - bmtRTType *pPrevParentType = NULL; - - // Find this method in the parent. - // If it does exist in the parent, it would be at the same vtable slot. - while (pParentType != NULL && - dwSlot < pParentType->GetMethodTable()->GetNumVirtuals()) - { - pPrevParentType = pParentType; - pParentType = pParentType->GetParentType(); - } - - if (pPrevParentType != NULL) - { - pIntroducingMD = - pPrevParentType->GetMethodTable()->GetMethodDescForSlot(dwSlot); - } - - return pIntroducingMD; -} - - //*************************************************************************************** inline MethodTableBuilder::bmtMDMethod * MethodTableBuilder::DeclaredMethodIterator::operator->()