diff options
author | Mike McLaughlin <mikem@microsoft.com> | 2021-06-25 08:54:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-25 08:54:28 +0300 |
commit | cef40a107ff2f810219b3b28af709b0b778a3472 (patch) | |
tree | b743c86609c0a686af08ec9be8625b19dfd5ec6a /src/coreclr/vm | |
parent | 7ed5a67c0bbb48bdce3cfd962e333c8f7db047a4 (diff) |
Move the metadata update related APIs to the MetadataUpdater class (#54590)
Move the metadata update related APIs to the MetadataUpdater class
The old APIs AssemblyExtensions.ApplyUpdate() and AssemblyExtensions.GetApplyUpdateCapabilities() will be removed
after all the references to them have been changed to the new APIs.
Add the new IsSupported API described in issue https://github.com/dotnet/runtime/issues/51159.
Change the tests to use the MetadataUpdater APIs.
Fix the ApplyUpdate qcalls and icalls
Add the ILLink substitutions for MetadataUpdater.IsSupported property
Change the old APIs to call the new ones
Update mono's MetadataUpdater.IsSupported property
Update feature switch doc
Fixed the argument checking in coreclr's MetadataUpdater.ApplyUpdate().
Diffstat (limited to 'src/coreclr/vm')
-rw-r--r-- | src/coreclr/vm/assemblynative.cpp | 18 | ||||
-rw-r--r-- | src/coreclr/vm/assemblynative.hpp | 1 | ||||
-rw-r--r-- | src/coreclr/vm/ecalllist.h | 8 |
3 files changed, 24 insertions, 3 deletions
diff --git a/src/coreclr/vm/assemblynative.cpp b/src/coreclr/vm/assemblynative.cpp index 19e23c44c5b..b74038fa377 100644 --- a/src/coreclr/vm/assemblynative.cpp +++ b/src/coreclr/vm/assemblynative.cpp @@ -1450,3 +1450,21 @@ void QCALLTYPE AssemblyNative::ApplyUpdate( END_QCALL; } + +// static +BOOL QCALLTYPE AssemblyNative::IsApplyUpdateSupported() +{ + QCALL_CONTRACT; + + BOOL result = false; + + BEGIN_QCALL; + +#ifdef EnC_SUPPORTED + BOOL result = CORDebuggerAttached() || g_pConfig->ForceEnc() || g_pConfig->DebugAssembliesModifiable(); +#endif + + END_QCALL; + + return result; +} diff --git a/src/coreclr/vm/assemblynative.hpp b/src/coreclr/vm/assemblynative.hpp index 25ebf74d5c8..54ca987a86f 100644 --- a/src/coreclr/vm/assemblynative.hpp +++ b/src/coreclr/vm/assemblynative.hpp @@ -129,6 +129,7 @@ public: static void QCALLTYPE TraceSatelliteSubdirectoryPathProbed(LPCWSTR filePath, HRESULT hr); static void QCALLTYPE ApplyUpdate(QCall::AssemblyHandle assembly, UINT8* metadataDelta, INT32 metadataDeltaLength, UINT8* ilDelta, INT32 ilDeltaLength, UINT8* pdbDelta, INT32 pdbDeltaLength); + static BOOL QCALLTYPE IsApplyUpdateSupported(); }; #endif diff --git a/src/coreclr/vm/ecalllist.h b/src/coreclr/vm/ecalllist.h index 1822422f596..5cc1d5827fb 100644 --- a/src/coreclr/vm/ecalllist.h +++ b/src/coreclr/vm/ecalllist.h @@ -438,7 +438,11 @@ FCFuncEnd() FCFuncStart(gAssemblyExtensionsFuncs) QCFuncElement("InternalTryGetRawMetadata", AssemblyNative::InternalTryGetRawMetadata) +FCFuncEnd() + +FCFuncStart(gMetadataUpdaterFuncs) QCFuncElement("ApplyUpdate", AssemblyNative::ApplyUpdate) + QCFuncElement("IsApplyUpdateSupported", AssemblyNative::IsApplyUpdateSupported) FCFuncEnd() FCFuncStart(gAssemblyLoadContextFuncs) @@ -1121,11 +1125,8 @@ FCClassElement("ArgIterator", "System", gVarArgFuncs) FCClassElement("Array", "System", gArrayFuncs) FCClassElement("Assembly", "System.Reflection", gAssemblyFuncs) FCClassElement("AssemblyBuilder", "System.Reflection.Emit", gAssemblyBuilderFuncs) - FCClassElement("AssemblyExtensions", "System.Reflection.Metadata", gAssemblyExtensionsFuncs) - FCClassElement("AssemblyLoadContext", "System.Runtime.Loader", gAssemblyLoadContextFuncs) - FCClassElement("AssemblyName", "System.Reflection", gAssemblyNameFuncs) FCClassElement("Buffer", "System", gBufferFuncs) FCClassElement("CLRConfig", "System", gClrConfig) @@ -1168,6 +1169,7 @@ FCClassElement("Math", "System", gMathFuncs) FCClassElement("MathF", "System", gMathFFuncs) FCClassElement("MdUtf8String", "System", gMdUtf8String) FCClassElement("MetadataImport", "System.Reflection", gMetaDataImport) +FCClassElement("MetadataUpdater", "System.Reflection.Metadata", gMetadataUpdaterFuncs) FCClassElement("MissingMemberException", "System", gMissingMemberExceptionFuncs) FCClassElement("MngdFixedArrayMarshaler", "System.StubHelpers", gMngdFixedArrayMarshalerFuncs) FCClassElement("MngdNativeArrayMarshaler", "System.StubHelpers", gMngdNativeArrayMarshalerFuncs) |