Some fixes and some implementation bits. More classes.
authorPaolo Molaro <lupus@oddwiz.org>
Fri, 28 Sep 2001 13:54:46 +0000 (13:54 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Fri, 28 Sep 2001 13:54:46 +0000 (13:54 -0000)
svn path=/trunk/mcs/; revision=1028

mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
mcs/class/corlib/System.Reflection.Emit/common.src [new file with mode: 0755]
mcs/class/corlib/System/AppDomain.cs
mcs/class/corlib/System/RuntimeFieldHandle.cs [new file with mode: 0755]
mcs/class/corlib/System/RuntimeMethodHandle.cs [new file with mode: 0755]
mcs/class/corlib/System/Type.cs

index 814746c557511a5fb6069857291d912ade57dd8b..56f62de9ea1727edd59b2f292c89f1708145e8f8 100755 (executable)
@@ -5,6 +5,7 @@ using System.IO;
 using System.Security.Policy;
 using System.Runtime.Serialization;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 
 namespace System.Reflection.Emit {
        public sealed class AssemblyBuilder : Assembly {
@@ -18,6 +19,9 @@ namespace System.Reflection.Emit {
                }
                public void AddResourceFile( string name, string fileName, ResourceAttributes attribute) {
                }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               private static extern ModuleBuilder defineModule (AssemblyBuilder ab, string name, string filename);
+               
                public ModuleBuilder DefineDynamicModule( string name) {
                        return null;
                }
@@ -25,7 +29,7 @@ namespace System.Reflection.Emit {
                        return null;
                }
                public ModuleBuilder DefineDynamicModule( string name, string fileName) {
-                       return null;
+                       return defineModule (this, name, fileName);
                }
                public ModuleBuilder DefineDynamicModule( string name, string fileName, bool emitSymbolInfo) {
                        return null;
@@ -163,8 +167,11 @@ namespace System.Reflection.Emit {
                public override string ToString() {
                        return "AssemblyBuilder";
                }
-
-
+               public void Save( string assemblyFileName) {
+               }
+               public void SetEntryPoint( MethodInfo entryMethod) {
+                       
+               }
 
        }
 }
index 0e0a0939086091d0939a6098cdfd3a9031341c48..9d06905f04b7730b9044c2cee7daa9dd911e9043 100644 (file)
@@ -1,12 +1,19 @@
 using System;
 using System.Reflection;
+using System.Runtime.CompilerServices;
 
 namespace System.Reflection.Emit {
        public class ModuleBuilder : Module {
        
        public override string FullyQualifiedName {get { return "FIXME: bah";}}
 
-       
+       [MethodImplAttribute(MethodImplOptions.InternalCall)]
+       private static extern TypeBuilder defineType (ModuleBuilder mb, string name, TypeAttributes attr);
+       public TypeBuilder DefineType( string name, TypeAttributes attr) {
+               return defineType (this, name, attr);
+       }
+
+
 
        }
 }
index ab01e7e34cc1dfc9f5f5e3ef605c86ca5de3db9c..620ea78136c6c661efec9798f8f921b70a5cc78b 100644 (file)
@@ -1,6 +1,7 @@
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
+using System.Runtime.CompilerServices;
 
 namespace System.Reflection.Emit {
        public sealed class TypeBuilder : Type {
@@ -30,6 +31,20 @@ namespace System.Reflection.Emit {
                        return null;
                }
 
+               public MethodBuilder DefineMethod( string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes) {
+                       return DefineMethod (name, attributes, CallingConventions.Standard, returnType, parameterTypes);
+               }
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               private static extern MethodBuilder defineMethod (TypeBuilder typeb, string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes);
+
+               public MethodBuilder DefineMethod( string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
+                       return defineMethod (this, name, attributes, callingConvention, returnType, parameterTypes);
+               }
+
+               public Type CreateType() {
+                       return null;
+               }
 
        }
 }
diff --git a/mcs/class/corlib/System.Reflection.Emit/common.src b/mcs/class/corlib/System.Reflection.Emit/common.src
new file mode 100755 (executable)
index 0000000..569a9d6
--- /dev/null
@@ -0,0 +1,23 @@
+AssemblyBuilder.cs
+AssemblyBuilderAccess.cs
+ConstructorBuilder.cs
+EventToken.cs
+FieldToken.cs
+FlowControl.cs
+ILGenerator.cs
+Label.cs
+MethodToken.cs
+ModuleBuilder.cs
+OpCode.cs
+OpCodes.cs
+OpCodeType.cs
+OperandType.cs
+PackingSize.cs
+ParameterToken.cs
+PEFileKinds.cs
+PropertyToken.cs
+SignatureToken.cs
+StackBehaviour.cs
+StringToken.cs
+TypeBuilder.cs
+TypeToken.cs
index c908801b49266eb29dc07bc15325c0550e7c5489..a4be108858b55f104ef030a0e9739b5d41559c91 100755 (executable)
@@ -14,8 +14,10 @@ namespace System {
                public static AppDomain CurrentDomain {
                        get { return getCurDomain ();}
                }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               private static extern AssemblyBuilder defineAssembly (AppDomain domain, AssemblyName name, AssemblyBuilderAccess access);
                public AssemblyBuilder DefineDynamicAssembly( AssemblyName name, AssemblyBuilderAccess access) {
-                       return null;
+                       return defineAssembly (this, name, access);
                }
 
 
diff --git a/mcs/class/corlib/System/RuntimeFieldHandle.cs b/mcs/class/corlib/System/RuntimeFieldHandle.cs
new file mode 100755 (executable)
index 0000000..dc25924
--- /dev/null
@@ -0,0 +1,31 @@
+//
+// System.RuntimeFieldHandle.cs
+//
+// Author:
+//   Miguel de Icaza (miguel@ximian.com)
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+using System.Runtime.Serialization;
+
+namespace System {
+
+       // FIXME: Implement me!
+       public struct RuntimeFieldHandle : ISerializable {
+               IntPtr value;
+               
+               public IntPtr Value {
+                       get {
+                               return (IntPtr) value;
+                       }
+               }
+               
+                // This is from ISerializable
+                public void GetObjectData (SerializationInfo info, StreamingContext context)
+                {
+                        // TODO: IMPLEMENT ME.
+                }
+
+       }
+}
diff --git a/mcs/class/corlib/System/RuntimeMethodHandle.cs b/mcs/class/corlib/System/RuntimeMethodHandle.cs
new file mode 100755 (executable)
index 0000000..af8d38a
--- /dev/null
@@ -0,0 +1,31 @@
+//
+// System.RuntimeMethodHandle.cs
+//
+// Author:
+//   Miguel de Icaza (miguel@ximian.com)
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+using System.Runtime.Serialization;
+
+namespace System {
+
+       // FIXME: Implement me!
+       public struct RuntimeMethodHandle : ISerializable {
+               IntPtr value;
+               
+               public IntPtr Value {
+                       get {
+                               return (IntPtr) value;
+                       }
+               }
+               
+                // This is from ISerializable
+                public void GetObjectData (SerializationInfo info, StreamingContext context)
+                {
+                        // TODO: IMPLEMENT ME.
+                }
+
+       }
+}
index 652a5255d69ecb9d9ca6c4685425feaaf8631d9f..240480fb35fb8c0d4757f32ff4008b3a97c80aa3 100644 (file)
@@ -10,6 +10,7 @@
 //
 
 using System.Reflection;
+using System.Runtime.CompilerServices;
 
 namespace System {
 
@@ -93,7 +94,8 @@ namespace System {
                }
 
 
-               public Type GetTypeFromHandle (RuntimeTypeHandle handle) { 
+               //[MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static Type GetTypeFromHandle (RuntimeTypeHandle handle) { 
                        
                        // FIXME: implement me