Skip to content

Commit

Permalink
Address some code nits (#90289)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronRobinsonMSFT authored Aug 10, 2023
1 parent 2b9e556 commit 3be8fa1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 71 deletions.
11 changes: 9 additions & 2 deletions src/coreclr/vm/classcompat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3128,8 +3128,15 @@ HRESULT MethodTableBuilder::LoaderFindMethodInClass(

// Note instantiation info
{
hr = MetaSig::CompareMethodSigsNT(*ppMemberSignature, *pcMemberSignature, pModule, NULL,
pHashMethodSig, cHashMethodSig, entryDesc->GetModule(), pSubst);
hr = E_FAIL;
EX_TRY
{
hr = MetaSig::CompareMethodSigs(*ppMemberSignature, *pcMemberSignature, pModule, NULL,
pHashMethodSig, cHashMethodSig, entryDesc->GetModule(), pSubst, FALSE)
? S_OK
: S_FALSE;
}
EX_CATCH_HRESULT_NO_ERRORINFO(hr);

if (hr == S_OK)
{ // Found a match
Expand Down
18 changes: 0 additions & 18 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1663,24 +1663,6 @@ void CEEInfo::getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,
}
else
{
BOOL fInstanceHelper = FALSE;

if (fInstanceHelper)
{
if (flags & CORINFO_ACCESS_ADDRESS)
{
fieldAccessor = CORINFO_FIELD_INSTANCE_ADDR_HELPER;

pResult->helper = CORINFO_HELP_GETFIELDADDR;
}
else
{
fieldAccessor = CORINFO_FIELD_INSTANCE_HELPER;

pResult->helper = getInstanceFieldHelper(pField, flags);
}
}
else
if (pField->IsEnCNew())
{
fieldAccessor = CORINFO_FIELD_INSTANCE_ADDR_HELPER;
Expand Down
37 changes: 4 additions & 33 deletions src/coreclr/vm/siginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ DEFINEELEMENTTYPEINFO(ELEMENT_TYPE_INTERNAL, -1, TYPE_GC

unsigned GetSizeForCorElementType(CorElementType etyp)
{
LIMITED_METHOD_DAC_CONTRACT;
_ASSERTE(gElementTypeInfo[etyp].m_elementType == etyp);
return gElementTypeInfo[etyp].m_cbSize;
LIMITED_METHOD_DAC_CONTRACT;
_ASSERTE(gElementTypeInfo[etyp].m_elementType == etyp);
return gElementTypeInfo[etyp].m_cbSize;
}

#ifndef DACCESS_COMPILE
Expand Down Expand Up @@ -2603,7 +2603,7 @@ UINT MetaSig::GetElemSize(CorElementType etype, TypeHandle thValueType)
if ((UINT)etype >= ARRAY_SIZE(gElementTypeInfo))
ThrowHR(COR_E_BADIMAGEFORMAT, BFA_BAD_COMPLUS_SIG);

int cbsize = gElementTypeInfo[(UINT)etype].m_cbSize;
int cbsize = GetSizeForCorElementType(etype);
if (cbsize != -1)
return(cbsize);

Expand Down Expand Up @@ -4310,35 +4310,6 @@ MetaSig::CompareMethodSigs(
return TRUE;
}

//---------------------------------------------------------------------------------------
//
//static
HRESULT
MetaSig::CompareMethodSigsNT(
PCCOR_SIGNATURE pSignature1,
DWORD cSig1,
Module * pModule1,
const Substitution * pSubst1,
PCCOR_SIGNATURE pSignature2,
DWORD cSig2,
Module * pModule2,
const Substitution * pSubst2,
TokenPairList * pVisited) //= NULL
{
STATIC_CONTRACT_NOTHROW;

HRESULT hr = S_OK;
EX_TRY
{
if (CompareMethodSigs(pSignature1, cSig1, pModule1, pSubst1, pSignature2, cSig2, pModule2, pSubst2, FALSE, pVisited))
hr = S_OK;
else
hr = S_FALSE;
}
EX_CATCH_HRESULT_NO_ERRORINFO(hr);
return hr;
}

//---------------------------------------------------------------------------------------
//
// Compare two method sigs and return whether they are the same.
Expand Down
18 changes: 0 additions & 18 deletions src/coreclr/vm/siginfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,24 +1009,6 @@ class MetaSig
TokenPairList* pVisited = NULL
);

// Nonthrowing version of CompareMethodSigs
//
// Return S_OK if they match
// S_FALSE if they don't match
// FAILED if OOM or some other blocking error
//
static HRESULT CompareMethodSigsNT(
PCCOR_SIGNATURE pSig1,
DWORD cSig1,
Module* pModule1,
const Substitution* pSubst1,
PCCOR_SIGNATURE pSig2,
DWORD cSig2,
Module* pModule2,
const Substitution* pSubst2,
TokenPairList *pVisited = NULL
);

static BOOL CompareFieldSigs(
PCCOR_SIGNATURE pSig1,
DWORD cSig1,
Expand Down

0 comments on commit 3be8fa1

Please sign in to comment.