Skip to content

Commit

Permalink
Remove unused members on Module - crossgen remnants (#103848)
Browse files Browse the repository at this point in the history
  • Loading branch information
elinor-fung authored Jun 23, 2024
1 parent 386f16f commit 8e92aef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 36 deletions.
2 changes: 0 additions & 2 deletions src/coreclr/vm/binder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,8 +1155,6 @@ void CoreLibBinder::AttachModule(Module * pModule)
c_rgCoreLibFieldDescriptions, c_nCoreLibFieldDescriptions);

pGlobalBinder->AllocateTables();

pModule->m_pBinder = pGlobalBinder;
}

void CoreLibBinder::SetDescriptions(Module * pModule,
Expand Down
22 changes: 6 additions & 16 deletions src/coreclr/vm/ceeload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,6 @@ Module::Module(Assembly *pAssembly, PEAssembly *pPEAssembly)
m_pPEAssembly = pPEAssembly;
m_dwTransientFlags = CLASSES_FREED;

// Memory allocated on LoaderHeap is zero-filled. Spot-check it here.
_ASSERTE(m_pBinder == NULL);

pPEAssembly->AddRef();
}

Expand Down Expand Up @@ -418,20 +415,12 @@ void Module::Initialize(AllocMemTracker *pamTracker, LPCWSTR szName)

m_Crst.Init(CrstModule);
m_LookupTableCrst.Init(CrstModuleLookupTable, CrstFlags(CRST_UNSAFE_ANYMODE | CRST_DEBUGGER_THREAD));
m_FixupCrst.Init(CrstModuleFixup, (CrstFlags)(CRST_HOST_BREAKABLE|CRST_REENTRANCY));
m_InstMethodHashTableCrst.Init(CrstInstMethodHashTable, CRST_REENTRANCY);
m_ISymUnmanagedReaderCrst.Init(CrstISymUnmanagedReader, CRST_DEBUGGER_THREAD);

AllocateMaps();
m_dwTransientFlags &= ~((DWORD)CLASSES_FREED); // Set flag indicating LookupMaps are now in a consistent and destructable state

#ifdef FEATURE_COLLECTIBLE_TYPES
if (GetAssembly()->IsCollectible())
{
InterlockedOr((LONG*)&m_dwPersistedFlags, COLLECTIBLE_MODULE);
}
#endif // FEATURE_COLLECTIBLE_TYPES

#ifdef FEATURE_READYTORUN
m_pNativeImage = NULL;
if ((m_pReadyToRunInfo = ReadyToRunInfo::Initialize(this, pamTracker)) != NULL)
Expand Down Expand Up @@ -723,7 +712,6 @@ void Module::Destruct()
ClearInMemorySymbolStream();

m_Crst.Destroy();
m_FixupCrst.Destroy();
m_LookupTableCrst.Destroy();
m_InstMethodHashTableCrst.Destroy();
m_ISymUnmanagedReaderCrst.Destroy();
Expand Down Expand Up @@ -830,6 +818,12 @@ MethodTable *Module::GetGlobalMethodTable()

#endif // !DACCESS_COMPILE

BOOL Module::IsCollectible()
{
LIMITED_METHOD_DAC_CONTRACT;
return GetAssembly()->IsCollectible();
}

BOOL Module::IsManifest()
{
WRAPPER_NO_CONTRACT;
Expand Down Expand Up @@ -4543,10 +4537,6 @@ void Module::EnumMemoryRegions(CLRDataEnumMemoryFlags flags,
{
m_pAvailableClassesCaseIns->EnumMemoryRegions(flags);
}
if (m_pBinder.IsValid())
{
m_pBinder->EnumMemoryRegions(flags);
}

// Save the LookupMap structures.
m_MethodDefToDescMap.ListEnumMemoryRegions(flags);
Expand Down
20 changes: 2 additions & 18 deletions src/coreclr/vm/ceeload.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,7 @@ class Module : public ModuleBase
WRAP_EXCEPTIONS = 0x00000020,

// unused = 0x00000040,

// This flag applies to assembly, but is also stored here so that it can be cached in ngen image
COLLECTIBLE_MODULE = 0x00000080,
// unused = 0x00000080,

//If attribute value has been cached before
DEFAULT_DLL_IMPORT_SEARCH_PATHS_IS_CACHED = 0x00000400,
Expand All @@ -679,7 +677,6 @@ class Module : public ModuleBase
PTR_Assembly m_pAssembly;

CrstExplicitInit m_Crst;
CrstExplicitInit m_FixupCrst;

// Debugging symbols reader interface. This will only be
// initialized if needed, either by the debugging subsystem or for
Expand Down Expand Up @@ -808,16 +805,8 @@ class Module : public ModuleBase
// m_pAvailableClasses.
PTR_EEClassHashTable m_pAvailableClassesCaseIns;

// Pointer to binder, if we have one
friend class CoreLibBinder;
PTR_CoreLibBinder m_pBinder;

public:
BOOL IsCollectible()
{
LIMITED_METHOD_DAC_CONTRACT;
return (m_dwPersistedFlags & COLLECTIBLE_MODULE) != 0;
}
BOOL IsCollectible();

#ifdef FEATURE_READYTORUN
private:
Expand Down Expand Up @@ -1505,11 +1494,6 @@ class Module : public ModuleBase
InstrumentedILOffsetMapping GetInstrumentedILOffsetMapping(mdMethodDef token);

public:
CrstBase* GetFixupCrst()
{
return &m_FixupCrst;
}

// LoaderHeap for storing IJW thunks
PTR_LoaderHeap m_pThunkHeap;

Expand Down

0 comments on commit 8e92aef

Please sign in to comment.