Skip to content

Commit

Permalink
Delete Module::GetPropertyInfoForMethodDef (#98883)
Browse files Browse the repository at this point in the history
Left over from the time where Module had cache for this method
  • Loading branch information
jkotas authored Feb 24, 2024
1 parent 99a7964 commit 7b54246
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 26 deletions.
18 changes: 0 additions & 18 deletions src/coreclr/vm/ceeload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3402,24 +3402,6 @@ MethodDesc *Module::FindMethod(mdToken pMethod)
RETURN pMDRet;
}

//
// GetPropertyInfoForMethodDef wraps the metadata function of the same name.
//

HRESULT Module::GetPropertyInfoForMethodDef(mdMethodDef md, mdProperty *ppd, LPCSTR *pName, ULONG *pSemantic)
{
CONTRACTL
{
INSTANCE_CHECK;
NOTHROW;
GC_NOTRIGGER;
MODE_ANY;
}
CONTRACTL_END;

return GetMDImport()->GetPropertyInfoForMethodDef(md, ppd, pName, pSemantic);
}

// Return true if this module has any live (jitted) JMC functions.
// If a module has no jitted JMC functions, then it's as if it's a
// non-user module.
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/vm/ceeload.h
Original file line number Diff line number Diff line change
Expand Up @@ -1324,8 +1324,6 @@ class Module : public ModuleBase
MethodDesc *FindMethodThrowing(mdToken pMethod);
MethodDesc *FindMethod(mdToken pMethod);

HRESULT GetPropertyInfoForMethodDef(mdMethodDef md, mdProperty *ppd, LPCSTR *pName, ULONG *pSemantic);

public:

// Debugger stuff
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/clrtocomcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ UINT32 CLRToCOMLateBoundWorker(
ULONG uSemantic;

// See if there is property information for this member.
hr = pItfMT->GetModule()->GetPropertyInfoForMethodDef(pItfMD->GetMemberDef(), &propToken, &strMemberName, &uSemantic);
hr = pItfMT->GetMDImport()->GetPropertyInfoForMethodDef(pItfMD->GetMemberDef(), &propToken, &strMemberName, &uSemantic);
if (hr != S_OK)
{
// Non-property method
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/commtmemberinfomap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ void ComMTMemberInfoMap::GetMethodPropsForMeth(
rProps[ix].bFunction2Getter = FALSE;

// See if there is property information for this member.
hr = pMeth->GetModule()->GetPropertyInfoForMethodDef(pMeth->GetMemberDef(), &pd, &pPropName, &uSemantic);
hr = pMeth->GetMDImport()->GetPropertyInfoForMethodDef(pMeth->GetMemberDef(), &pd, &pPropName, &uSemantic);
IfFailThrow(hr);

if (hr == S_OK)
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/vm/dispatchinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2578,10 +2578,9 @@ bool DispatchInfo::IsPropertyAccessorVisible(bool fIsSetter, OBJECTREF* pMemberI

// Check to see if the new method is a property accessor.
mdToken tkMember = mdTokenNil;
MethodTable *pDeclaringMT = pMDForProperty->GetMethodTable();
if (pMDForProperty->GetModule()->GetPropertyInfoForMethodDef(pMDForProperty->GetMemberDef(), &tkMember, NULL, NULL) == S_OK)
if (pMDForProperty->GetMDImport()->GetPropertyInfoForMethodDef(pMDForProperty->GetMemberDef(), &tkMember, NULL, NULL) == S_OK)
{
if (IsMemberVisibleFromCom(pDeclaringMT, tkMember, pMDForProperty->GetMemberDef()))
if (IsMemberVisibleFromCom(pMDForProperty->GetMethodTable(), tkMember, pMDForProperty->GetMemberDef()))
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/interoputil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2558,7 +2558,7 @@ BOOL IsMethodVisibleFromCom(MethodDesc *pMD)
mdMethodDef md = pMD->GetMemberDef();

// See if there is property information for this member.
hr = pMD->GetModule()->GetPropertyInfoForMethodDef(md, &pd, &pPropName, &uSemantic);
hr = pMD->GetMDImport()->GetPropertyInfoForMethodDef(md, &pd, &pPropName, &uSemantic);
IfFailThrow(hr);

if (hr == S_OK)
Expand Down

0 comments on commit 7b54246

Please sign in to comment.