Thu Jan 10 21:07:54 CET 2002 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Thu, 10 Jan 2002 16:17:53 +0000 (16:17 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Thu, 10 Jan 2002 16:17:53 +0000 (16:17 -0000)
* ILGenerator.cs: handle type tokens (used for box opcode).

Thu Jan 10 21:05:23 CET 2002 Paolo Molaro <lupus@ximian.com>

* MonoType.cs: add rank to MonoTypeInfo and implement GetArrayRank.
* String.c: eliminate 64k+ method calls in search.
* Type.cs: handle byref and array types in ToString ().

svn path=/trunk/mcs/; revision=1951

mcs/class/corlib/System.Reflection.Emit/ChangeLog
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/MonoType.cs
mcs/class/corlib/System/String.cs
mcs/class/corlib/System/Type.cs

index bdc5e20c89c474e78331d5bbc5b5e631fba1cada..9037bc73bce642b14cae1e3adf50333441ab77b2 100644 (file)
@@ -1,4 +1,8 @@
 
+Thu Jan 10 21:07:54 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+       * ILGenerator.cs: handle type tokens (used for box opcode).
+
 Wed Jan 9 19:37:55 CET 2002 Paolo Molaro <lupus@ximian.com>
 
        * ILGenerator.cs: emit float and doubles.
index f1bada4a507316e09ee429734969c3ef46861b15..79423998648339bede7f74029a9fcd96f91b6ae9 100644 (file)
@@ -299,8 +299,7 @@ namespace System.Reflection.Emit {
                public virtual void Emit (OpCode opcode, Type type) {
                        make_room (6);
                        ll_emit (opcode);
-                       emit_int (0);
-                       Console.WriteLine ("Emit (opcode, type) not implemented");
+                       emit_int (abuilder.GetToken (type));
                }
 
                public void EmitCall (OpCode opcode, MethodInfo methodinfo, Type[] optionalParamTypes) {
index 2474c5a597ae25dd8be0368687af49bbf3b6d684..64777ef46391043196ae8c9e359c8ac876be0f5c 100644 (file)
@@ -1,3 +1,10 @@
+
+Thu Jan 10 21:05:23 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+       * MonoType.cs: add rank to MonoTypeInfo and implement GetArrayRank.
+       * String.c: eliminate 64k+ method calls in search.
+       * Type.cs: handle byref and array types in ToString ().
+
 2002-01-09  Duco Fijma <duco@lorentz.xs4all.nl>
 
        * Guid.cs: created first version
index 04f801c376bdd49d867170712a199feb97a5d7cd..071b2ea42ae90859143fab8ed4f0d5b2a2cf877c 100644 (file)
@@ -17,6 +17,7 @@ namespace System
                public Type[] interfaces;
                public Assembly assembly;
                public TypeAttributes attrs;
+               public int rank;
        }
 
        internal class MonoType : Type
@@ -140,5 +141,11 @@ namespace System
                                return _impl;
                        }
                }
+
+               public override int GetArrayRank () {
+                       MonoTypeInfo info;
+                       get_type_info (_impl, out info);
+                       return info.rank;
+               }
        }
 }
index f38fd8e1e12856f6c42b92367e730592865036a2..725ad23920bb6a2cd0e96081caac073595a2b52d 100644 (file)
@@ -214,20 +214,21 @@ namespace System {
                                throw new ArgumentNullException ();
 
                        /* if the search buffer is shorter than the pattern buffer, we can't match */
-                       if (count < needle.Length)
+                       if (count < needle.length)
                                return -1;
 
                        /* return an instant match if the pattern is 0-length */
-                       if (needle.Length == 0)
+                       if (needle.length == 0)
                                return startIndex;
 
                        /* set a pointer at the end of each string */
-                       ne = needle.Length - 1;      /* position of char before '\0' */
+                       ne = needle.length - 1;      /* position of char before '\0' */
                        he = startIndex + count;     /* position of last valid char */
 
                        /* init the skip table with the pattern length */
+                       nc = needle.length;
                        for (i = 0; i < 65536; i++)
-                               skiptable[i] = needle.Length;
+                               skiptable[i] = nc;
 
                        /* set the skip value for the chars that *do* appear in the
                         * pattern buffer (needle) to the distance from the index to
@@ -236,8 +237,8 @@ namespace System {
                                skiptable[(int) needle[nc]] = ne - nc;
 
                        h = startIndex;
-                       while (count >= needle.Length) {
-                               hc = h + needle.Length - 1;  /* set the haystack compare pointer */
+                       while (count >= needle.length) {
+                               hc = h + needle.length - 1;  /* set the haystack compare pointer */
                                nc = ne;                     /* set the needle compare pointer */
 
                                /* work our way backwards until they don't match */
index a74100678e855beeb19d4b247b267ead8da6f2df..cc9ec5aa9e062fd81284dd6ed916fb628fdaa4c1 100644 (file)
@@ -173,6 +173,13 @@ namespace System {
                        }
                }
 
+               public bool IsByRef {
+                       get {
+                               // FIXME
+                               return false;
+                       }
+               }
+
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private static extern bool type_is_subtype_of (Type a, Type b);
                
@@ -351,7 +358,12 @@ namespace System {
 
                public override string ToString()
                {
-                       return FullName;
+                       string res = FullName;
+                       if (IsArray)
+                               res = res + "[]";
+                       if (IsByRef)
+                               res = res + "&";
+                       return res;
                }
 
        }