From 1450bde147ba8c8ad1aa347a3c00b877b7fa799e Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Tue, 28 Aug 2018 13:26:57 +0300 Subject: [PATCH] [System.Reflection] CoreFX import for MemberInfo (#9746) Part of #9660. The imported CoreFX types: - MemberInfo; The changes: - used MemberInfo type from CoreFX; - moved MetadataToken property from MemberInfo to leaf classes; added unit tests. - updated icall-def.h for related types; - updated corlib version; - added overridings for new HasSameMetadataDefinitionAs property to leaf classes; - included more MemberInfo xunit tests to verify HasSameMetadataDefinitionAs property; - renamed MemberInfoExtensions class to DbLinqMemberInfoExtensions in System.Data.Linq assembly to avoid a conflict with the class imported to System.Reflection namespace. - [acceptance-tests] removed AssemblyExtensions class which duplicates the same functionality introduced in System.Reflection. --- .../GCStressTests/AssemblyExtensions.cs | 14 ------------ acceptance-tests/coreclr.mk | 5 ++--- configure.ac | 2 +- external/api-snapshot | 2 +- external/corefx | 2 +- .../src/DbLinq/Schema/Dbml/Adapter/EnumType.cs | 2 +- .../src/DbLinq/Util/MemberInfoExtensions.cs | 2 +- mcs/class/corlib/Makefile | 1 + mcs/class/corlib/ReferenceSources/RuntimeType.cs | 3 ++- mcs/class/corlib/System.Reflection/MonoEvent.cs | 11 +++++++++ mcs/class/corlib/System.Reflection/MonoField.cs | 11 +++++++++ mcs/class/corlib/System.Reflection/MonoMethod.cs | 24 +++++++++++++++++++- mcs/class/corlib/System.Reflection/MonoProperty.cs | 11 +++++++++ .../corlib/Test/System.Reflection/EventInfoTest.cs | 7 ++++++ .../corlib/Test/System.Reflection/FieldInfoTest.cs | 8 +++++++ .../Test/System.Reflection/PropertyInfoTest.cs | 7 ++++++ mcs/class/corlib/coreclr/MemberInfo.cs | 26 ++++++++++++++++++++++ mcs/class/corlib/corefx/SR.cs | 2 ++ mcs/class/corlib/corlib.csproj | 6 ++++- mcs/class/corlib/corlib.dll.sources | 9 +++++++- mcs/class/corlib/corlib_xtest.dll.sources | 4 ++++ mono/metadata/icall-def.h | 12 +++++++--- 22 files changed, 142 insertions(+), 29 deletions(-) delete mode 100644 acceptance-tests/GCStressTests/AssemblyExtensions.cs create mode 100644 mcs/class/corlib/coreclr/MemberInfo.cs diff --git a/acceptance-tests/GCStressTests/AssemblyExtensions.cs b/acceptance-tests/GCStressTests/AssemblyExtensions.cs deleted file mode 100644 index 418d5db66eb..00000000000 --- a/acceptance-tests/GCStressTests/AssemblyExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.IO; -using System.Reflection; - -namespace System.Runtime.Loader -{ - public static class AssemblyExtensions - { - public static Type[] GetTypes(this Assembly assembly) - { - return assembly.GetTypes (); - } - } -} diff --git a/acceptance-tests/coreclr.mk b/acceptance-tests/coreclr.mk index 51dbbe569e4..13b43e9df6b 100644 --- a/acceptance-tests/coreclr.mk +++ b/acceptance-tests/coreclr.mk @@ -3689,9 +3689,8 @@ CORECLR_STRESSTEST_RUNNER_CS_SRC= \ $(CORECLR_PATH)/tests/src/GC/Stress/Framework/RFLogging.cs \ $(CORECLR_PATH)/tests/src/GC/Stress/Framework/DetourHelpers.cs \ $(CORECLR_PATH)/tests/src/GC/Stress/Framework/LoaderClass.cs \ - GCStressTests/AssemblyLoadContext.cs \ - GCStressTests/AssemblyExtensions.cs - + GCStressTests/AssemblyLoadContext.cs + CORECLR_TESTLIBRARY_CS_SRC = \ $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/TestFramework.cs \ $(CORECLR_PATH)/tests/src/Common/CoreCLRTestLibrary/Utilities.cs \ diff --git a/configure.ac b/configure.ac index 206051a37f6..a39e6fdf75c 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,7 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3` # There is no ordering of corlib versions, no old or new, # the runtime expects an exact match. # -MONO_CORLIB_VERSION=67C68E7F-E554-4766-A151-8B94F457A035 +MONO_CORLIB_VERSION=1324ECE7-2D9C-47B9-8723-21A2D38095B2 # # Put a quoted #define in config.h. diff --git a/external/api-snapshot b/external/api-snapshot index af1fa6a781a..9b498af27f9 160000 --- a/external/api-snapshot +++ b/external/api-snapshot @@ -1 +1 @@ -Subproject commit af1fa6a781a2d8d5478c0e753fc5331a5d1560db +Subproject commit 9b498af27f97d2536bb7ef6693caed26e7a0ed6c diff --git a/external/corefx b/external/corefx index edbba4b4c32..0db66279df6 160000 --- a/external/corefx +++ b/external/corefx @@ -1 +1 @@ -Subproject commit edbba4b4c325ba500d1938e750f0304021eea76b +Subproject commit 0db66279df60f619daf86afe7bd31744624481c1 diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/Adapter/EnumType.cs b/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/Adapter/EnumType.cs index 8d2a5f67e81..1df830139f7 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/Adapter/EnumType.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/Adapter/EnumType.cs @@ -139,7 +139,7 @@ namespace DbLinq.Schema.Dbml.Adapter string literalType = string.IsNullOrEmpty(Name) ? "enum" : Name; literalType += " "; literalType += string.Join(", ", keyValues.ToArray()); - MemberInfoExtensions.SetMemberValue(memberInfo, owner, literalType); + DbLinqMemberInfoExtensions.SetMemberValue(memberInfo, owner, literalType); } internal EnumType(object owner, MemberInfo memberInfo) diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Util/MemberInfoExtensions.cs b/mcs/class/System.Data.Linq/src/DbLinq/Util/MemberInfoExtensions.cs index cbc9324022f..d750ef4ee62 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Util/MemberInfoExtensions.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Util/MemberInfoExtensions.cs @@ -35,7 +35,7 @@ namespace DbLinq.Util #if !MONO_STRICT public #endif - static class MemberInfoExtensions + static class DbLinqMemberInfoExtensions { /// /// Returns the type of the specified member diff --git a/mcs/class/corlib/Makefile b/mcs/class/corlib/Makefile index 468232a7d07..34283f302b2 100644 --- a/mcs/class/corlib/Makefile +++ b/mcs/class/corlib/Makefile @@ -43,6 +43,7 @@ RESX_RESOURCE_STRING = \ ../../../external/corefx/src/System.Net.Requests/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Net.Http/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Numerics.Vectors/src/Resources/Strings.resx \ + ../../../external/corefx/src/System.Reflection.TypeExtensions/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Runtime.Extensions/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Runtime.InteropServices.RuntimeInformation/src/Resources/Strings.resx \ ../../../external/corefx/src/System.Runtime.Numerics/src/Resources/Strings.resx \ diff --git a/mcs/class/corlib/ReferenceSources/RuntimeType.cs b/mcs/class/corlib/ReferenceSources/RuntimeType.cs index c58f8a82388..13d972709c0 100644 --- a/mcs/class/corlib/ReferenceSources/RuntimeType.cs +++ b/mcs/class/corlib/ReferenceSources/RuntimeType.cs @@ -800,6 +800,8 @@ namespace System } } + public sealed override bool HasSameMetadataDefinitionAs (MemberInfo other) => HasSameMetadataDefinitionAsCore (other); + public override bool IsSZArray { get { // TODO: intrinsic @@ -826,6 +828,5 @@ namespace System return RuntimeTypeHandle.IsSubclassOf (this, rtType); } - } } diff --git a/mcs/class/corlib/System.Reflection/MonoEvent.cs b/mcs/class/corlib/System.Reflection/MonoEvent.cs index 876de83bff0..7067f2369b4 100644 --- a/mcs/class/corlib/System.Reflection/MonoEvent.cs +++ b/mcs/class/corlib/System.Reflection/MonoEvent.cs @@ -209,5 +209,16 @@ namespace System.Reflection { public override IList GetCustomAttributesData () { return CustomAttributeData.GetCustomAttributes (this); } + + public override int MetadataToken { + get { + return get_metadata_token (this); + } + } + + public sealed override bool HasSameMetadataDefinitionAs (MemberInfo other) => HasSameMetadataDefinitionAsCore (other); + + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern int get_metadata_token (MonoEvent monoEvent); } } diff --git a/mcs/class/corlib/System.Reflection/MonoField.cs b/mcs/class/corlib/System.Reflection/MonoField.cs index ef2180fed03..4c18f97caae 100644 --- a/mcs/class/corlib/System.Reflection/MonoField.cs +++ b/mcs/class/corlib/System.Reflection/MonoField.cs @@ -318,5 +318,16 @@ namespace System.Reflection { get { return get_core_clr_security_level () == 1; } } #endif + + public sealed override bool HasSameMetadataDefinitionAs (MemberInfo other) => HasSameMetadataDefinitionAsCore (other); + + public override int MetadataToken { + get { + return get_metadata_token (this); + } + } + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal static extern int get_metadata_token (MonoField monoField); } } diff --git a/mcs/class/corlib/System.Reflection/MonoMethod.cs b/mcs/class/corlib/System.Reflection/MonoMethod.cs index e3e22863f61..c92bb369b1c 100644 --- a/mcs/class/corlib/System.Reflection/MonoMethod.cs +++ b/mcs/class/corlib/System.Reflection/MonoMethod.cs @@ -108,7 +108,7 @@ namespace System.Reflection { { return ParameterInfo.New (GetReturnType (method.mhandle), method, get_retval_marshal (method.mhandle)); } - }; + } abstract class RuntimeMethodInfo : MethodInfo, ISerializable { @@ -220,6 +220,9 @@ namespace System.Reflection { [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern MonoMethod get_base_method (MonoMethod method, bool definition); + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern int get_metadata_token (MonoMethod method); + public override MethodInfo GetBaseDefinition () { return get_base_method (this, true); @@ -246,6 +249,12 @@ namespace System.Reflection { return MonoMethodInfo.GetReturnParameterInfo (this); } } + + public override int MetadataToken { + get { + return get_metadata_token (this); + } + } public override MethodImplAttributes GetMethodImplementationFlags () { @@ -560,6 +569,8 @@ namespace System.Reflection { public override bool IsSecuritySafeCritical { get { return get_core_clr_security_level () == 1; } } + + public sealed override bool HasSameMetadataDefinitionAs (MemberInfo other) => HasSameMetadataDefinitionAsCore (other); } @@ -809,6 +820,8 @@ namespace System.Reflection { public extern int get_core_clr_security_level (); #endif + public sealed override bool HasSameMetadataDefinitionAs (MemberInfo other) => HasSameMetadataDefinitionAsCore (other); + public override bool IsSecurityTransparent { get { return get_core_clr_security_level () == 0; } } @@ -820,5 +833,14 @@ namespace System.Reflection { public override bool IsSecuritySafeCritical { get { return get_core_clr_security_level () == 1; } } + + public override int MetadataToken { + get { + return get_metadata_token (this); + } + } + + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern int get_metadata_token (MonoCMethod method); } } diff --git a/mcs/class/corlib/System.Reflection/MonoProperty.cs b/mcs/class/corlib/System.Reflection/MonoProperty.cs index 16f44ec583b..54aed946912 100644 --- a/mcs/class/corlib/System.Reflection/MonoProperty.cs +++ b/mcs/class/corlib/System.Reflection/MonoProperty.cs @@ -462,5 +462,16 @@ namespace System.Reflection { public override IList GetCustomAttributesData () { return CustomAttributeData.GetCustomAttributes (this); } + + public sealed override bool HasSameMetadataDefinitionAs (MemberInfo other) => HasSameMetadataDefinitionAsCore (other); + + public override int MetadataToken { + get { + return get_metadata_token (this); + } + } + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal static extern int get_metadata_token (MonoProperty monoProperty); } } diff --git a/mcs/class/corlib/Test/System.Reflection/EventInfoTest.cs b/mcs/class/corlib/Test/System.Reflection/EventInfoTest.cs index 311bf0f56a7..faddd7b03f9 100644 --- a/mcs/class/corlib/Test/System.Reflection/EventInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/EventInfoTest.cs @@ -123,6 +123,13 @@ namespace MonoTests.System.Reflection Assert.AreEqual (type.Module, ev.Module); } + [Test] + public void MetadataToken () + { + EventInfo ev = typeof (TestClass).GetEvent ("pub"); + Assert.IsTrue ((int)ev.MetadataToken > 0); + } + #pragma warning disable 67 public class PrivateEvent { diff --git a/mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs b/mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs index 2a73eecbacb..62680cc63a4 100644 --- a/mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs @@ -224,6 +224,14 @@ namespace MonoTests.System.Reflection Assert.AreEqual (typeof (ObsoleteAttribute), attrs [0].GetType (), "#D10"); } + [Test] + public void MetadataToken () + { + Type type = typeof (FieldInfoTest); + FieldInfo field = type.GetField ("i"); + Assert.IsTrue ((int)field.MetadataToken > 0); + } + [Test] // GetFieldFromHandle (RuntimeFieldHandle) public void GetFieldFromHandle1_Handle_Zero () { diff --git a/mcs/class/corlib/Test/System.Reflection/PropertyInfoTest.cs b/mcs/class/corlib/Test/System.Reflection/PropertyInfoTest.cs index 5163fef438b..3ce24eb9c59 100644 --- a/mcs/class/corlib/Test/System.Reflection/PropertyInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/PropertyInfoTest.cs @@ -560,5 +560,12 @@ namespace MonoTests.System.Reflection Assert.AreEqual ("param", defaultParam.Name, "#1"); Assert.AreEqual ("test", defaultParam.DefaultValue, "#2"); } + + [Test] + public void MetadataToken () + { + PropertyInfo property = typeof (Base).GetProperty ("P"); + Assert.IsTrue ((int)property.MetadataToken > 0); + } } } diff --git a/mcs/class/corlib/coreclr/MemberInfo.cs b/mcs/class/corlib/coreclr/MemberInfo.cs new file mode 100644 index 00000000000..de8926b2e38 --- /dev/null +++ b/mcs/class/corlib/coreclr/MemberInfo.cs @@ -0,0 +1,26 @@ +namespace System.Reflection { + partial class MemberInfo { + internal virtual bool CacheEquals (object o) + { + throw new NotImplementedException (); + } + + internal bool HasSameMetadataDefinitionAsCore (MemberInfo other) where TOther : MemberInfo + { + if (other == null) + throw new ArgumentNullException (nameof (other)); + + // Ensure that "other" is a runtime-implemented MemberInfo. Do this check before calling any methods on it! + if (!(other is TOther)) + return false; + + if (MetadataToken != other.MetadataToken) + return false; + + if (!(Module.Equals (other.Module))) + return false; + + return true; + } + } +} \ No newline at end of file diff --git a/mcs/class/corlib/corefx/SR.cs b/mcs/class/corlib/corefx/SR.cs index 7d6c3d757b2..b8f2cf20392 100644 --- a/mcs/class/corlib/corefx/SR.cs +++ b/mcs/class/corlib/corefx/SR.cs @@ -397,6 +397,8 @@ partial class SR public const string Arg_NullArgumentNullRef = "The method was called with a null array argument."; public const string Arg_TypeNotSupported = "Specified type is not supported"; public const string Arg_InsufficientNumberOfElements = "At least {0} element(s) are expected in the parameter \"{1}\"."; + public const string NoMetadataTokenAvailable = "There is no metadata token available for the given member."; + public const string PlatformNotSupported_ReflectionTypeExtensions = "System.Reflection.TypeExtensions is not supported on NET Standard 1.3 or 1.5."; public const string Argument_EmptyApplicationName = "ApplicationId cannot have an empty string for the name."; public const string ArgumentOutOfRange_GenericPositive = "Value must be positive."; public const string Argument_PathEmpty = "Path cannot be the empty string or all whitespace."; diff --git a/mcs/class/corlib/corlib.csproj b/mcs/class/corlib/corlib.csproj index 9a02bbba5ac..37f8df172e1 100644 --- a/mcs/class/corlib/corlib.csproj +++ b/mcs/class/corlib/corlib.csproj @@ -405,6 +405,7 @@ + @@ -546,6 +547,7 @@ + @@ -652,6 +654,8 @@ + + @@ -858,7 +862,6 @@ - @@ -1973,6 +1976,7 @@ + diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index dd82602833c..c88b8917e2a 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -1148,6 +1148,7 @@ ReferenceSources/AppContextDefaultValues.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/AssemblyKeyNameAttribute.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/AssemblyMetadataAttribute.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/AssemblyNameFlags.cs +../../../external/corefx/src/System.Runtime.Extensions/src/System/Reflection/AssemblyNameProxy.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/AssemblyProductAttribute.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/AssemblySignatureKeyAttribute.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/AssemblyTitleAttribute.cs @@ -1171,6 +1172,7 @@ ReferenceSources/AppContextDefaultValues.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/IReflectableType.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/ManifestResourceInfo.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/MemberFilter.cs +../../../external/corefx/src/Common/src/CoreLib/System/Reflection/MemberInfo.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/MemberTypes.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/MethodAttributes.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/MethodImplAttributes.cs @@ -1192,9 +1194,11 @@ ReferenceSources/AppContextDefaultValues.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/TypeAttributes.cs ../../../external/corefx/src/Common/src/CoreLib/System/Reflection/TypeFilter.cs +../../../external/corefx/src/System.Reflection.TypeExtensions/src/System/Reflection/TypeExtensions.cs +../../../external/corefx/src/System.Reflection.TypeExtensions/src/System/Reflection/Requires.cs + ../referencesource/mscorlib/system/reflection/CustomAttributeExtensions.cs ../referencesource/mscorlib/system/reflection/mdimport.cs -../referencesource/mscorlib/system/reflection/memberinfo.cs ../referencesource/mscorlib/system/reflection/memberinfoserializationholder.cs ../referencesource/mscorlib/system/reflection/methodbase.cs ../referencesource/mscorlib/system/reflection/methodinfo.cs @@ -1555,6 +1559,7 @@ ReferenceSources/AppContextDefaultValues.cs ../referencesource/mscorlib/microsoft/win32/safehandles/win32safehandles.cs coreclr/SorterArray.cs +coreclr/MemberInfo.cs corefx/AwaitTaskContinuation.cs corefx/SynchronizationContext.cs @@ -1805,3 +1810,5 @@ corefx/Mono.SafePasswordHandle.Unix.cs ../../../external/corefx/src/Common/src/Microsoft/Win32/SafeHandles/SafeHandleCache.cs ../../../external/corefx/src/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/*.cs + +../../../external/corefx/src/Common/src/System/NotImplemented.cs diff --git a/mcs/class/corlib/corlib_xtest.dll.sources b/mcs/class/corlib/corlib_xtest.dll.sources index 0013123b35e..62a9cf76765 100644 --- a/mcs/class/corlib/corlib_xtest.dll.sources +++ b/mcs/class/corlib/corlib_xtest.dll.sources @@ -1,4 +1,5 @@ ../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs +../../../external/corefx/src/Common/tests/System/MockType.cs ../../../external/corefx/src/Common/tests/System/RandomExtensions.cs ../../../external/corefx/src/Common/tests/System/RandomDataGenerator.cs @@ -15,6 +16,7 @@ ../../../external/corefx/src/System.Reflection/tests/ConstructorInfoTests.cs ../../../external/corefx/src/System.Reflection/tests/ManifestResourceInfoTests.cs +#../../../external/corefx/src/System.Reflection/tests/MemberInfoTests.cs #TODO: audit the commented out tests and fix or disable @@ -152,6 +154,8 @@ ../../../external/corefx/src/System.Runtime/tests/System/String.SplitTests.cs ../../../external/corefx/src/System.Runtime/tests/System/NullableTests.cs ../../../external/corefx/src/System.Runtime/tests/System/Reflection/BindingFlagsDoNotWrap.netcoreapp.cs +../../../external/corefx/src/System.Runtime/tests/System/Reflection/MemberInfoTests.cs +../../../external/corefx/src/System.Runtime/tests/System/Reflection/MemberInfoTests.netcoreapp.cs ../../../external/corefx/src/System.Runtime/tests/System/Text/*.cs ../../../external/corefx/src/System.Runtime/tests/System/Runtime/CompilerServices/*.cs:RuntimeHelpersTests.netcoreapp.cs,ConditionalWeakTableTests.netcoreapp.cs,ConditionalWeakTableTests.cs diff --git a/mono/metadata/icall-def.h b/mono/metadata/icall-def.h index ed961626480..a64360733de 100644 --- a/mono/metadata/icall-def.h +++ b/mono/metadata/icall-def.h @@ -592,9 +592,6 @@ HANDLES(ICALL(FILEDI_1, "GetTypeModifiers", ves_icall_System_Reflection_FieldInf HANDLES(ICALL(FILEDI_2, "get_marshal_info", ves_icall_System_Reflection_FieldInfo_get_marshal_info)) HANDLES(ICALL(FILEDI_3, "internal_from_handle_type", ves_icall_System_Reflection_FieldInfo_internal_from_handle_type)) -ICALL_TYPE(MEMBERI, "System.Reflection.MemberInfo", MEMBERI_1) -HANDLES(ICALL(MEMBERI_1, "get_MetadataToken", ves_icall_reflection_get_token)) - ICALL_TYPE(MBASE, "System.Reflection.MethodBase", MBASE_1) HANDLES(ICALL(MBASE_1, "GetCurrentMethod", ves_icall_GetCurrentMethod)) HANDLES(ICALL(MBASE_2, "GetMethodBodyInternal", ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal)) @@ -620,6 +617,10 @@ ICALL_TYPE(MCMETH, "System.Reflection.MonoCMethod", MCMETH_1) HANDLES(ICALL(MCMETH_1, "GetGenericMethodDefinition_impl", ves_icall_MonoMethod_GetGenericMethodDefinition)) ICALL(MCMETH_2, "InternalInvoke", ves_icall_InternalInvoke) HANDLES(ICALL(MCMETH_3, "get_core_clr_security_level", ves_icall_MonoMethod_get_core_clr_security_level)) +HANDLES(ICALL(MCMETH_4, "get_metadata_token", ves_icall_reflection_get_token)) + +ICALL_TYPE(MEV, "System.Reflection.MonoEvent", MEV_1) +HANDLES(ICALL(MEV_1, "get_metadata_token", ves_icall_reflection_get_token)) ICALL_TYPE(MEVIN, "System.Reflection.MonoEventInfo", MEVIN_1) HANDLES(ICALL(MEVIN_1, "get_event_info", ves_icall_MonoEventInfo_get_event_info)) @@ -632,6 +633,7 @@ ICALL(MFIELD_3, "GetValueInternal", ves_icall_MonoField_GetValueInternal) HANDLES(ICALL(MFIELD_6, "ResolveType", ves_icall_MonoField_ResolveType)) HANDLES(ICALL(MFIELD_4, "SetValueInternal", ves_icall_MonoField_SetValueInternal)) ICALL(MFIELD_7, "get_core_clr_security_level", ves_icall_MonoField_get_core_clr_security_level) +HANDLES(ICALL(MFIELD_8, "get_metadata_token", ves_icall_reflection_get_token)) ICALL_TYPE(MMETH, "System.Reflection.MonoMethod", MMETH_2) HANDLES(ICALL(MMETH_2, "GetGenericArguments", ves_icall_MonoMethod_GetGenericArguments)) @@ -643,6 +645,7 @@ HANDLES(ICALL(MMETH_6, "get_IsGenericMethod", ves_icall_MonoMethod_get_IsGeneric HANDLES(ICALL(MMETH_7, "get_IsGenericMethodDefinition", ves_icall_MonoMethod_get_IsGenericMethodDefinition)) HANDLES(ICALL(MMETH_8, "get_base_method", ves_icall_MonoMethod_get_base_method)) HANDLES(ICALL(MMETH_10, "get_core_clr_security_level", ves_icall_MonoMethod_get_core_clr_security_level)) +HANDLES(ICALL(MMETH_12, "get_metadata_token", ves_icall_reflection_get_token)) HANDLES(ICALL(MMETH_9, "get_name", ves_icall_MonoMethod_get_name)) ICALL_TYPE(MMETHI, "System.Reflection.MonoMethodInfo", MMETHI_4) @@ -651,6 +654,9 @@ HANDLES(ICALL(MMETHI_1, "get_method_info", ves_icall_get_method_info)) HANDLES(ICALL(MMETHI_2, "get_parameter_info", ves_icall_System_Reflection_MonoMethodInfo_get_parameter_info)) HANDLES(ICALL(MMETHI_3, "get_retval_marshal", ves_icall_System_MonoMethodInfo_get_retval_marshal)) +ICALL_TYPE(MPROP, "System.Reflection.MonoProperty", MPROP_1) +HANDLES(ICALL(MPROP_1, "get_metadata_token", ves_icall_reflection_get_token)) + ICALL_TYPE(MPROPI, "System.Reflection.MonoPropertyInfo", MPROPI_1) HANDLES(ICALL(MPROPI_1, "GetTypeModifiers", ves_icall_MonoPropertyInfo_GetTypeModifiers)) ICALL(MPROPI_3, "get_default_value", ves_icall_property_info_get_default_value) -- 2.11.4.GIT