Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions src/coreclr/vm/ceeload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,6 @@ void Module::Initialize(AllocMemTracker *pamTracker, LPCWSTR szName)
m_dwExportedTypeCount = 0;
m_dwCustomAttributeCount = 0;

if (m_AssemblyRefByNameTable == NULL)
{
Module::CreateAssemblyRefByNameTable(pamTracker);
}

#if defined(PROFILING_SUPPORTED) && !defined(DACCESS_COMPILE)
m_pJitInlinerTrackingMap = NULL;
if (ReJitManager::IsReJITInlineTrackingEnabled())
Expand Down Expand Up @@ -4873,59 +4868,6 @@ class CheckAsmOffsets

//-------------------------------------------------------------------------------

#ifndef DACCESS_COMPILE

void Module::CreateAssemblyRefByNameTable(AllocMemTracker *pamTracker)
{
CONTRACTL
{
THROWS;
GC_NOTRIGGER;
INJECT_FAULT(COMPlusThrowOM(););
}
CONTRACTL_END

LoaderHeap * pHeap = GetLoaderAllocator()->GetLowFrequencyHeap();
IMDInternalImport * pImport = GetMDImport();

DWORD dwMaxRid = pImport->GetCountWithTokenKind(mdtAssemblyRef);
if (dwMaxRid == 0)
return;

S_SIZE_T dwAllocSize = S_SIZE_T(sizeof(LPWSTR)) * S_SIZE_T(dwMaxRid);
m_AssemblyRefByNameTable = (LPCSTR *) pamTracker->Track( pHeap->AllocMem(dwAllocSize) );

DWORD dwCount = 0;
for (DWORD rid=1; rid <= dwMaxRid; rid++)
{
mdAssemblyRef mdToken = TokenFromRid(rid,mdtAssemblyRef);
LPCSTR szName;
HRESULT hr;

hr = pImport->GetAssemblyRefProps(mdToken, NULL, NULL, &szName, NULL, NULL, NULL, NULL);

if (SUCCEEDED(hr))
{
m_AssemblyRefByNameTable[dwCount++] = szName;
}
}
m_AssemblyRefByNameCount = dwCount;
}

bool Module::HasReferenceByName(LPCUTF8 pModuleName)
{
LIMITED_METHOD_CONTRACT;

for (DWORD i=0; i < m_AssemblyRefByNameCount; i++)
{
if (0 == strcmp(pModuleName, m_AssemblyRefByNameTable[i]))
return true;
}

return false;
}
#endif

#ifdef DACCESS_COMPILE
void DECLSPEC_NORETURN ModuleBase::ThrowTypeLoadExceptionImpl(IMDInternalImport *pInternalImport,
mdToken token,
Expand Down
7 changes: 0 additions & 7 deletions src/coreclr/vm/ceeload.h
Original file line number Diff line number Diff line change
Expand Up @@ -1319,9 +1319,6 @@ class Module : public ModuleBase

mdAssemblyRef FindAssemblyRef(Assembly *targetAssembly);

void CreateAssemblyRefByNameTable(AllocMemTracker *pamTracker);
bool HasReferenceByName(LPCUTF8 pModuleName);

#endif // !DACCESS_COMPILE

DWORD GetAssemblyRefMax() {LIMITED_METHOD_CONTRACT; return m_ManifestModuleReferencesMap.GetSize() - 1; }
Expand Down Expand Up @@ -1588,10 +1585,6 @@ class Module : public ModuleBase
PTR_JITInlineTrackingMap m_pJitInlinerTrackingMap;
#endif // defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA)


LPCSTR *m_AssemblyRefByNameTable; // array that maps mdAssemblyRef tokens into their simple name
DWORD m_AssemblyRefByNameCount; // array size

// a.dll calls a method in b.dll and that method call a method in c.dll. When ngening
// a.dll it is possible then method in b.dll can be inlined. When that happens a.ni.dll stores
// an added native metadata which has information about assemblyRef to c.dll
Expand Down