// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
namespace System.Reflection.Emit {
[ComVisible (true)]
+ [StructLayout (LayoutKind.Sequential)]
public sealed class DynamicMethod : MethodInfo {
-#pragma warning disable 169, 414
+#pragma warning disable 169, 414, 649
#region Sync with reflection.h
private RuntimeMethodHandle mhandle;
private string name;
private IntPtr referenced_by;
private Type owner;
#endregion
-#pragma warning restore 169, 414
+#pragma warning restore 169, 414, 649
private Delegate deleg;
private MonoMethod method;
private ParameterBuilder[] pinfo;
internal bool creating;
+ private DynamicILInfo il_info;
public DynamicMethod (string name, Type returnType, Type[] parameterTypes, Module m) : this (name, returnType, parameterTypes, m, false) {
}
if (parameterTypes [i] == null)
throw new ArgumentException ("Parameter " + i + " is null", "parameterTypes");
}
+ if (owner != null && (owner.IsArray || owner.IsInterface)) {
+ throw new ArgumentException ("Owner can't be an array or an interface.");
+ }
if (m == null)
- m = AnonHostModuleHolder.anon_host_module;
+ m = AnonHostModuleHolder.AnonHostModule;
this.name = name;
this.attributes = attributes | MethodAttributes.Static;
throw new NotImplementedException ();
}
- [MonoTODO("Not implemented")]
public DynamicILInfo GetDynamicILInfo () {
- throw new NotImplementedException ();
+ if (il_info == null)
+ il_info = new DynamicILInfo (this);
+ return il_info;
}
public ILGenerator GetILGenerator () {
return parameters == null ? 0 : parameters.Length;
}
+ internal override Type GetParameterType (int pos) {
+ return parameters [pos];
+ }
+
/*
public override object Invoke (object obj, object[] parameters) {
CreateDynMethod ();
anon_host_module = ab.GetManifestModule ();
}
+
+ public static Module AnonHostModule {
+ get {
+ return anon_host_module;
+ }
+ }
}
}
}
}
+#endif