2015-08-26 07:17:56 -04:00
|
|
|
#if !FULL_AOT_RUNTIME
|
|
|
|
using System.Reflection.Emit;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
|
|
namespace System.Reflection
|
|
|
|
{
|
|
|
|
partial class MethodBase
|
|
|
|
{
|
|
|
|
//
|
|
|
|
// This is a quick version for our own use. We should override
|
|
|
|
// it where possible so that it does not allocate an array.
|
|
|
|
// They cannot be abstract otherwise we break public contract
|
|
|
|
//
|
|
|
|
internal virtual ParameterInfo[] GetParametersInternal ()
|
|
|
|
{
|
|
|
|
// Override me
|
|
|
|
return GetParameters ();
|
|
|
|
}
|
|
|
|
|
|
|
|
internal virtual int GetParametersCount ()
|
|
|
|
{
|
|
|
|
// Override me
|
|
|
|
return GetParametersInternal ().Length;
|
|
|
|
}
|
|
|
|
|
|
|
|
internal virtual Type GetParameterType (int pos)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException ();
|
|
|
|
}
|
|
|
|
|
2018-05-10 08:37:03 +00:00
|
|
|
internal virtual int get_next_table_index (object obj, int table, int count) {
|
2015-08-26 07:17:56 -04:00
|
|
|
#if !FULL_AOT_RUNTIME
|
|
|
|
if (this is MethodBuilder) {
|
|
|
|
MethodBuilder mb = (MethodBuilder)this;
|
2018-05-10 08:37:03 +00:00
|
|
|
return mb.get_next_table_index (obj, table, count);
|
2015-08-26 07:17:56 -04:00
|
|
|
}
|
|
|
|
if (this is ConstructorBuilder) {
|
|
|
|
ConstructorBuilder mb = (ConstructorBuilder)this;
|
2018-05-10 08:37:03 +00:00
|
|
|
return mb.get_next_table_index (obj, table, count);
|
2015-08-26 07:17:56 -04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
throw new Exception ("Method is not a builder method");
|
|
|
|
}
|
|
|
|
|
|
|
|
internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle)
|
|
|
|
{
|
2016-11-10 13:04:39 +00:00
|
|
|
return GetMethodFromHandleInternalType_native (handle.Value, IntPtr.Zero, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle, RuntimeTypeHandle reflectedType)
|
|
|
|
{
|
|
|
|
return GetMethodFromHandleInternalType_native (handle.Value, reflectedType.Value, false);
|
2015-08-26 07:17:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
|
|
|
internal extern static MethodBody GetMethodBodyInternal (IntPtr handle);
|
|
|
|
|
|
|
|
internal static MethodBody GetMethodBody (IntPtr handle)
|
|
|
|
{
|
|
|
|
return GetMethodBodyInternal (handle);
|
|
|
|
}
|
|
|
|
|
2016-11-10 13:04:39 +00:00
|
|
|
static MethodBase GetMethodFromHandleInternalType (IntPtr method_handle, IntPtr type_handle) {
|
|
|
|
return GetMethodFromHandleInternalType_native (method_handle, type_handle, true);
|
|
|
|
}
|
|
|
|
|
2015-08-26 07:17:56 -04:00
|
|
|
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
2016-11-10 13:04:39 +00:00
|
|
|
internal extern static MethodBase GetMethodFromHandleInternalType_native (IntPtr method_handle, IntPtr type_handle, bool genericCheck);
|
|
|
|
|
2015-08-26 07:17:56 -04:00
|
|
|
}
|
2016-11-10 13:04:39 +00:00
|
|
|
}
|