2003-04-18 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Fri, 18 Apr 2003 17:44:49 +0000 (17:44 -0000)
committerZoltan Varga <vargaz@gmail.com>
Fri, 18 Apr 2003 17:44:49 +0000 (17:44 -0000)
* Object.cs ValueType.cs: Make the Object::GetHashCode() and
ValueType::Equals() icalls static non-virtual, so they can be called
by the code in RuntimeHelpers.

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

mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/Object.cs
mcs/class/corlib/System/ValueType.cs

index 82639a6d6ff999b79825fcdc1bc6c3bf46348749..0cc48691e74adc9be336de8629e68c34247fc1be 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
+
+       * Object.cs ValueType.cs: Make the Object::GetHashCode() and 
+       ValueType::Equals() icalls static non-virtual, so they can be called
+       by the code in RuntimeHelpers.
+
 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
 
        * Delegate.cs (operator ==): Do not crash if the second argument
index 54850461227703b4bfb5dbb8504adf3c6b8b2c17..7da35f64ae77f2402c36b28208b042ed59152bb4 100644 (file)
@@ -56,8 +56,9 @@ namespace System {
                //   class should return a hash code that makes sense
                //   for that particular implementation of the object.
                // </summary>
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public extern virtual int GetHashCode ();
+               public virtual int GetHashCode () {
+                       return InternalGetHashCode (this);
+               }
 
                // <summary>
                //   Returns the Type associated with the object.
@@ -92,6 +93,9 @@ namespace System {
                        return (a == b);
                }
 
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern int InternalGetHashCode (object o);
+
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                internal extern IntPtr obj_address ();
  
index 733491f38b0a6bb7626bc8d05b5b003cbe79dca4..77b485bf0c0b7f771c0703cce926c4ab6bad9299 100644 (file)
@@ -25,8 +25,9 @@ namespace System {
                //   True if this instance and o represent the same type
                //   and have the same value.
                // </summary>
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public extern override bool Equals (object o);
+               public override bool Equals (object o) {
+                       return InternalEquals (this, o);
+               }
 
                // <summary>
                //   Gets a hashcode for this value type using the
@@ -44,5 +45,8 @@ namespace System {
                {
                        return GetType().FullName;
                }
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static bool InternalEquals (object o1, object o2);
        }
 }