Skip to content

Commit 7a06f23

Browse files
authored
Delete LOADEDMODULES cache (#116126)
* Delete LOADEDMODULES cache This cache is not used by the runtime and it is not compiled into debugger (mscordbi). It looks like a left-over from fusion. * Delete FEATURE_METADATA_IN_VM The only feature left was a free-threaded marshaller that should not be needed for the limited use of IMetadata interfaces by profilers.
1 parent 2411805 commit 7a06f23

18 files changed

+62
-929
lines changed

src/coreclr/md/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
add_compile_definitions(FEATURE_METADATA_EMIT)
22
add_compile_definitions(FEATURE_METADATA_INTERNAL_APIS)
33
add_compile_definitions($<$<OR:$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>,$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>>:FEATURE_METADATA_EMIT_IN_DEBUGGER>)
4-
add_compile_definitions($<$<NOT:$<OR:$<BOOL:$<TARGET_PROPERTY:DAC_COMPONENT>>,$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>>>:FEATURE_METADATA_IN_VM>)
54
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>:FEATURE_METADATA_CUSTOM_DATA_SOURCE>)
65
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>:FEATURE_METADATA_DEBUGGEE_DATA_SOURCE>)
76
add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:DBI_COMPONENT>>:FEATURE_METADATA_LOAD_TRUSTED_IMAGES>)

src/coreclr/md/compiler/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ set(MDCOMPILER_SOURCES
1616
regmeta_emit.cpp
1717
regmeta_import.cpp
1818
regmeta_imetadatatables.cpp
19-
regmeta_vm.cpp
2019
)
2120

2221
set(MDCOMPILER_HEADERS

src/coreclr/md/compiler/assemblymd.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
#include "mdlog.h"
1616
#include "importhelper.h"
1717

18-
#ifdef _MSC_VER
19-
#pragma warning(disable: 4102)
20-
#endif
21-
2218
//*******************************************************************************
2319
// Get the properties for the given Assembly token.
2420
//*******************************************************************************
@@ -582,10 +578,5 @@ STDMETHODIMP RegMeta::FindAssembliesByName( // S_OK or error
582578
ULONG cMax, // [IN] The max number to put
583579
ULONG *pcAssemblies) // [OUT] The number of assemblies returned.
584580
{
585-
#ifdef FEATURE_METADATA_IN_VM
586-
return COR_E_NOTSUPPORTED;
587-
#else //!FEATURE_METADATA_IN_VM
588-
// Calls to fusion are not supported outside VM
589581
return E_NOTIMPL;
590-
#endif //!FEATURE_METADATA_IN_VM
591582
} // RegMeta::FindAssembliesByName

src/coreclr/md/compiler/classfactory.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
//*****************************************************************************
1616
#include "stdafx.h"
1717

18-
#ifdef FEATURE_METADATA_IN_VM
19-
2018
#include "classfactory.h"
2119
#include "disp.h"
2220
#include "regmeta.h"
@@ -143,5 +141,3 @@ MDClassFactory::LockServer(
143141
// @FUTURE: Should we return E_NOTIMPL instead of S_OK?
144142
return S_OK;
145143
}
146-
147-
#endif //FEATURE_METADATA_IN_VM

src/coreclr/md/compiler/disp.cpp

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ Disp::DefineScope(
102102
// Get the requested interface.
103103
IfFailGo(pMeta->QueryInterface(riid, (void **)ppIUnk));
104104

105-
// Add the new RegMeta to the cache.
106-
IfFailGo(pMeta->AddToCache());
107-
108105
LOG((LOGMD, "{%08x} Created new emit scope\n", pMeta));
109106

110107
ErrExit:
@@ -182,33 +179,10 @@ Disp::OpenRawScope(
182179
_ASSERTE(!IsOfReserved(dwOpenFlags));
183180
#endif //!FEATURE_METADATA_LOAD_TRUSTED_IMAGES
184181

185-
{
186-
}
187-
188182
if (IsOfReadOnly(dwOpenFlags) && IsOfReadWrite(dwOpenFlags))
189183
{ // Invalid combination of flags - ofReadOnly & ofWrite
190184
IfFailGo(E_INVALIDARG);
191185
}
192-
// If open-for-read, and there is already an open-for-read copy, return it.
193-
if (IsOfReadOnly(dwOpenFlags))
194-
{
195-
RegMeta::FindCachedReadOnlyEntry(szFileName, dwOpenFlags, &pMeta);
196-
if (pMeta != NULL)
197-
{
198-
// Return the requested interface.
199-
hr = pMeta->QueryInterface(riid, (void **) ppIUnk);
200-
if (FAILED(hr))
201-
{
202-
pMeta = NULL; // Don't delete cached RegMeta!
203-
}
204-
else
205-
{
206-
pMeta->Release(); // Give back refcount from QI
207-
}
208-
209-
goto ErrExit;
210-
}
211-
}
212186
// Create a new coclass for this guy.
213187
pMeta = new (nothrow) RegMeta();
214188
IfNullGo(pMeta);
@@ -228,15 +202,6 @@ Disp::OpenRawScope(
228202
// Obtain the requested interface.
229203
IfFailGo(pMeta->QueryInterface(riid, (void **)ppIUnk) );
230204

231-
// Add the new RegMeta to the cache. If this is read-only, any future opens will
232-
// find this entry. If, due to another thread concurrently opening the same file,
233-
// there is already another copy in the cache, well, then there will be two
234-
// read-only copies in the cache. This is considered to be somewhat of a corner
235-
// case, and the only harm is temporary memory usage. All requests will be
236-
// satisfied by one or the other (depending on search algorithm), and eventually,
237-
// the "other" copy will be released.
238-
IfFailGo(pMeta->AddToCache());
239-
240205
#if defined(_DEBUG)
241206
if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_MD_RegMetaDump))
242207
{
@@ -317,9 +282,6 @@ HRESULT Disp::OpenRawScopeOnMemory( // Return code.
317282
// Return the requested interface.
318283
IfFailGo( pMeta->QueryInterface(riid, (void **) ppIUnk) );
319284

320-
// Add the new RegMeta to the cache.
321-
IfFailGo(pMeta->AddToCache());
322-
323285
#if defined(_DEBUG)
324286
if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_MD_RegMetaDump))
325287
{
@@ -446,9 +408,6 @@ Disp::DefinePortablePdbScope(
446408
// Get the requested interface.
447409
IfFailGo(pMeta->QueryInterface(riid, (void**)ppIUnk));
448410

449-
// Add the new RegMeta to the cache.
450-
IfFailGo(pMeta->AddToCache());
451-
452411
LOG((LOGMD, "{%08x} Created new emit scope\n", pMeta));
453412

454413
ErrExit:
@@ -528,9 +487,6 @@ HRESULT Disp::OpenRawScopeOnCustomDataSource( // Return code.
528487
// Return the requested interface.
529488
IfFailGo(pMeta->QueryInterface(riid, (void **)ppIUnk));
530489

531-
// Add the new RegMeta to the cache.
532-
IfFailGo(pMeta->AddToCache());
533-
534490
#if defined(_DEBUG)
535491
if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_MD_RegMetaDump))
536492
{
@@ -847,20 +803,6 @@ HRESULT Disp::GetOption( // Return code.
847803
return hr;
848804
} // Disp::GetOption
849805

850-
#if defined(FEATURE_METADATA_IN_VM)
851-
852-
//---------------------------------------------------------------------------------------
853-
//
854-
// Process detach destruction.
855-
// Called from DllMain of clr.dll/RoMetadata.dll/MidlrtMd.dll.
856-
//
857-
void DeleteMetaData()
858-
{
859-
LOADEDMODULES::DeleteStatics();
860-
}
861-
862-
#endif //FEATURE_METADATA_IN_VM
863-
864806
//
865807
// This is the entrypoint for usages of MetaData that need to start with the dispenser (e.g.
866808
// mscordbi.dll and profiling API).

src/coreclr/md/compiler/emit.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,6 +2933,22 @@ HRESULT RegMeta::SetParamProps( // Return code.
29332933
#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
29342934
} // RegMeta::SetParamProps
29352935

2936+
//*****************************************************************************
2937+
// Persist a set of security custom attributes into a set of permission set
2938+
// blobs on the same class or method.
2939+
//
2940+
// Notes:
2941+
// Only in the full version because this is an emit operation.
2942+
//*****************************************************************************
2943+
HRESULT RegMeta::DefineSecurityAttributeSet(// Return code.
2944+
mdToken tkObj, // [IN] Class or method requiring security attributes.
2945+
COR_SECATTR rSecAttrs[], // [IN] Array of security attribute descriptions.
2946+
ULONG cSecAttrs, // [IN] Count of elements in above array.
2947+
ULONG *pulErrorAttr) // [OUT] On error, index of attribute causing problem.
2948+
{
2949+
return E_NOTIMPL;
2950+
} // RegMeta::DefineSecurityAttributeSet
2951+
29362952
//*****************************************************************************
29372953
// Apply edit and continue changes to this metadata.
29382954
//*****************************************************************************

0 commit comments

Comments
 (0)