6992685b86
Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
63 lines
1.7 KiB
C#
63 lines
1.7 KiB
C#
#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 ();
|
|
}
|
|
|
|
internal virtual int get_next_table_index (object obj, int table, bool inc) {
|
|
#if !FULL_AOT_RUNTIME
|
|
if (this is MethodBuilder) {
|
|
MethodBuilder mb = (MethodBuilder)this;
|
|
return mb.get_next_table_index (obj, table, inc);
|
|
}
|
|
if (this is ConstructorBuilder) {
|
|
ConstructorBuilder mb = (ConstructorBuilder)this;
|
|
return mb.get_next_table_index (obj, table, inc);
|
|
}
|
|
#endif
|
|
throw new Exception ("Method is not a builder method");
|
|
}
|
|
|
|
internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle)
|
|
{
|
|
return GetMethodFromHandleInternalType (handle.Value, IntPtr.Zero);
|
|
}
|
|
|
|
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
|
internal extern static MethodBody GetMethodBodyInternal (IntPtr handle);
|
|
|
|
internal static MethodBody GetMethodBody (IntPtr handle)
|
|
{
|
|
return GetMethodBodyInternal (handle);
|
|
}
|
|
|
|
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
|
extern static MethodBase GetMethodFromHandleInternalType (IntPtr method_handle, IntPtr type_handle);
|
|
}
|
|
} |