Skip to content

Commit da38f78

Browse files
authored
Stop creating map of assembly refs to name for Module (#106210)
1 parent b2f0e36 commit da38f78

File tree

2 files changed

+0
-65
lines changed

2 files changed

+0
-65
lines changed

src/coreclr/vm/ceeload.cpp

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,6 @@ void Module::Initialize(AllocMemTracker *pamTracker, LPCWSTR szName)
474474
m_dwExportedTypeCount = 0;
475475
m_dwCustomAttributeCount = 0;
476476

477-
if (m_AssemblyRefByNameTable == NULL)
478-
{
479-
Module::CreateAssemblyRefByNameTable(pamTracker);
480-
}
481-
482477
#if defined(PROFILING_SUPPORTED) && !defined(DACCESS_COMPILE)
483478
m_pJitInlinerTrackingMap = NULL;
484479
if (ReJitManager::IsReJITInlineTrackingEnabled())
@@ -4875,59 +4870,6 @@ class CheckAsmOffsets
48754870

48764871
//-------------------------------------------------------------------------------
48774872

4878-
#ifndef DACCESS_COMPILE
4879-
4880-
void Module::CreateAssemblyRefByNameTable(AllocMemTracker *pamTracker)
4881-
{
4882-
CONTRACTL
4883-
{
4884-
THROWS;
4885-
GC_NOTRIGGER;
4886-
INJECT_FAULT(COMPlusThrowOM(););
4887-
}
4888-
CONTRACTL_END
4889-
4890-
LoaderHeap * pHeap = GetLoaderAllocator()->GetLowFrequencyHeap();
4891-
IMDInternalImport * pImport = GetMDImport();
4892-
4893-
DWORD dwMaxRid = pImport->GetCountWithTokenKind(mdtAssemblyRef);
4894-
if (dwMaxRid == 0)
4895-
return;
4896-
4897-
S_SIZE_T dwAllocSize = S_SIZE_T(sizeof(LPWSTR)) * S_SIZE_T(dwMaxRid);
4898-
m_AssemblyRefByNameTable = (LPCSTR *) pamTracker->Track( pHeap->AllocMem(dwAllocSize) );
4899-
4900-
DWORD dwCount = 0;
4901-
for (DWORD rid=1; rid <= dwMaxRid; rid++)
4902-
{
4903-
mdAssemblyRef mdToken = TokenFromRid(rid,mdtAssemblyRef);
4904-
LPCSTR szName;
4905-
HRESULT hr;
4906-
4907-
hr = pImport->GetAssemblyRefProps(mdToken, NULL, NULL, &szName, NULL, NULL, NULL, NULL);
4908-
4909-
if (SUCCEEDED(hr))
4910-
{
4911-
m_AssemblyRefByNameTable[dwCount++] = szName;
4912-
}
4913-
}
4914-
m_AssemblyRefByNameCount = dwCount;
4915-
}
4916-
4917-
bool Module::HasReferenceByName(LPCUTF8 pModuleName)
4918-
{
4919-
LIMITED_METHOD_CONTRACT;
4920-
4921-
for (DWORD i=0; i < m_AssemblyRefByNameCount; i++)
4922-
{
4923-
if (0 == strcmp(pModuleName, m_AssemblyRefByNameTable[i]))
4924-
return true;
4925-
}
4926-
4927-
return false;
4928-
}
4929-
#endif
4930-
49314873
#ifdef DACCESS_COMPILE
49324874
void DECLSPEC_NORETURN ModuleBase::ThrowTypeLoadExceptionImpl(IMDInternalImport *pInternalImport,
49334875
mdToken token,

src/coreclr/vm/ceeload.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,9 +1316,6 @@ class Module : public ModuleBase
13161316

13171317
mdAssemblyRef FindAssemblyRef(Assembly *targetAssembly);
13181318

1319-
void CreateAssemblyRefByNameTable(AllocMemTracker *pamTracker);
1320-
bool HasReferenceByName(LPCUTF8 pModuleName);
1321-
13221319
#endif // !DACCESS_COMPILE
13231320

13241321
DWORD GetAssemblyRefMax() {LIMITED_METHOD_CONTRACT; return m_ManifestModuleReferencesMap.GetSize() - 1; }
@@ -1591,10 +1588,6 @@ class Module : public ModuleBase
15911588
PTR_JITInlineTrackingMap m_pJitInlinerTrackingMap;
15921589
#endif // defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA)
15931590

1594-
1595-
LPCSTR *m_AssemblyRefByNameTable; // array that maps mdAssemblyRef tokens into their simple name
1596-
DWORD m_AssemblyRefByNameCount; // array size
1597-
15981591
// a.dll calls a method in b.dll and that method call a method in c.dll. When ngening
15991592
// a.dll it is possible then method in b.dll can be inlined. When that happens a.ni.dll stores
16001593
// an added native metadata which has information about assemblyRef to c.dll

0 commit comments

Comments
 (0)