edit: $/Dev10/feature/vs_langs01/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/shared/object_id.rb;C840659
File: object_id.rb
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/shared/object_id.rb;C840659  (server)    6/24/2009 2:07 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/shared/object_id.rb;HashIdPerf
@@ -4,6 +4,9 @@
   it "returns an integer" do
     mock('fixnum').send(@method).class.should == Fixnum
     nil.send(@method).class.should == Fixnum
+    
+    # this can return Finxum or Bignum depending on the platform
+    900_000_000.send(@method).kind_of?(Integer).should be_true
   end
 
   it "returns the same value on all calls to id for a given object" do
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C959237
File: Initializers.Generated.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C959237  (server)    6/23/2009 2:00 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;HashIdPerf
@@ -2518,7 +2518,7 @@
         
         private static void LoadKernel_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
             module.DefineLibraryMethod("__id__", 0x51, 
-                new System.Func<IronRuby.Runtime.RubyContext, System.Object, System.Int32>(IronRuby.Builtins.KernelOps.GetObjectId)
+                new System.Func<IronRuby.Runtime.RubyContext, System.Object, System.Object>(IronRuby.Builtins.KernelOps.GetObjectId)
             );
             
             module.DefineLibraryMethod("__send__", 0x51, 
@@ -2690,7 +2690,7 @@
             );
             
             module.DefineLibraryMethod("id", 0x51, 
-                new System.Func<IronRuby.Runtime.RubyContext, System.Object, System.Int32>(IronRuby.Builtins.KernelOps.GetId)
+                new System.Func<IronRuby.Runtime.RubyContext, System.Object, System.Object>(IronRuby.Builtins.KernelOps.GetId)
             );
             
             module.DefineLibraryMethod("initialize_copy", 0x52, 
@@ -2780,7 +2780,7 @@
             );
             
             module.DefineLibraryMethod("object_id", 0x51, 
-                new System.Func<IronRuby.Runtime.RubyContext, System.Object, System.Int32>(IronRuby.Builtins.KernelOps.GetObjectId)
+                new System.Func<IronRuby.Runtime.RubyContext, System.Object, System.Object>(IronRuby.Builtins.KernelOps.GetObjectId)
             );
             
             module.DefineLibraryMethod("open", 0x52, 
@@ -4247,7 +4247,7 @@
             );
             
             module.DefineLibraryMethod("hash", 0x51, 
-                new System.Func<IronRuby.Builtins.Range, System.Int32>(IronRuby.Builtins.RangeOps.GetHashCode)
+                new System.Func<IronRuby.Runtime.UnaryOpStorage, IronRuby.Builtins.Range, System.Int32>(IronRuby.Builtins.RangeOps.GetHashCode)
             );
             
             module.DefineLibraryMethod("include?", 0x51, 
@@ -4828,11 +4828,11 @@
             );
             
             module.DefineLibraryMethod("eql?", 0x51, 
-                new System.Func<IronRuby.Builtins.RubyStruct, System.Object, System.Boolean>(IronRuby.Builtins.RubyStructOps.Equal)
+                new System.Func<IronRuby.Runtime.BinaryOpStorage, IronRuby.Builtins.RubyStruct, System.Object, System.Boolean>(IronRuby.Builtins.RubyStructOps.Equal)
             );
             
             module.DefineLibraryMethod("hash", 0x51, 
-                new System.Func<IronRuby.Builtins.RubyStruct, System.Int32>(IronRuby.Builtins.RubyStructOps.Hash)
+                new System.Func<IronRuby.Runtime.UnaryOpStorage, IronRuby.Runtime.ConversionStorage<System.Int32>, IronRuby.Builtins.RubyStruct, System.Int32>(IronRuby.Builtins.RubyStructOps.Hash)
             );
             
             module.DefineLibraryMethod("initialize", 0x52, 
@@ -5405,6 +5405,7 @@
             );
             
             module.DefineLibraryMethod("unshift", 0x51, 
+                new System.Func<System.Collections.IList, System.Object, System.Collections.IList>(IronRuby.Builtins.IListOps.Unshift), 
                 new System.Func<System.Collections.IList, System.Object[], System.Collections.IList>(IronRuby.Builtins.IListOps.Unshift)
             );
             
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C955994
File: KernelOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C955994  (server)    6/24/2009 1:59 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;HashIdPerf
@@ -1049,15 +1049,15 @@
         #region __id__, id, object_id, class
 
         [RubyMethod("id")]
-        public static int GetId(RubyContext/*!*/ context, object self) {
+        public static object GetId(RubyContext/*!*/ context, object self) {
             context.ReportWarning("Object#id will be deprecated; use Object#object_id");
             return GetObjectId(context, self);
         }
 
         [RubyMethod("__id__")]
         [RubyMethod("object_id")]
-        public static int GetObjectId(RubyContext/*!*/ context, object self) {
-            return RubyUtils.GetObjectId(context, self);
+        public static object GetObjectId(RubyContext/*!*/ context, object self) {
+            return ClrInteger.Narrow(RubyUtils.GetObjectId(context, self));
         }
 
         [RubyMethod("type")]
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RangeOps.cs;C870448
File: RangeOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RangeOps.cs;C870448  (server)    6/23/2009 1:46 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RangeOps.cs;HashIdPerf
@@ -76,7 +76,8 @@
 
         #endregion
 
-        #region begin, first
+        #region begin, first, end, last, exclude_end?
+
         /// <summary>
         /// Returns the first object in self
         /// </summary>
@@ -84,9 +85,7 @@
         public static object Begin([NotNull]Range/*!*/ self) {
             return self.Begin;
         }
-        #endregion
 
-        #region end, last
         /// <summary>
         /// Returns the object that defines the end of self
         /// </summary>
@@ -94,9 +93,7 @@
         public static object End([NotNull]Range/*!*/ self) {
             return self.End;
         }
-        #endregion
 
-        #region exclude_end?
         /// <summary>
         /// Returns true if self excludes its end value. 
         /// </summary>
@@ -104,6 +101,7 @@
         public static bool ExcludeEnd([NotNull]Range/*!*/ self) {
             return self.ExcludeEnd;
         }
+
         #endregion
 
         #region inspect, to_s
@@ -168,7 +166,6 @@
         /// </example>
         [RubyMethod("eql?")]
         public static bool Eql(BinaryOpStorage/*!*/ equalsStorage, Range/*!*/ self, [NotNull]Range/*!*/ other) {
-
             if (self == other) {
                 return true;
             }
@@ -221,17 +218,23 @@
         #endregion
 
         #region hash
+
         /// <summary>
         /// Generate a hash value such that two ranges with the same start and end points,
         /// and the same value for the "exclude end" flag, generate the same hash value. 
         /// </summary>
         [RubyMethod("hash")]
-        public static int GetHashCode(Range/*!*/ self) {
-            int hash = RubyUtils.GetHashCode(self.Begin);
-            hash ^= RubyUtils.GetHashCode(self.End);
-            hash ^= RubyUtils.GetHashCode(self.ExcludeEnd);
-            return hash;
+        public static int GetHashCode(UnaryOpStorage/*!*/ hashStorage, Range/*!*/ self) {
+            // MRI: Ruby treatment of hash return value is inconsistent. 
+            // No conversions happen here (unlike e.g. Array.hash).
+            var hashSite = hashStorage.GetCallSite("hash");
+            return unchecked(
+                Protocols.ToHashCode(hashSite.Target(hashSite, self.Begin)) ^
+                Protocols.ToHashCode(hashSite.Target(hashSite, self.End)) ^ 
+                (self.ExcludeEnd ? 179425693 : 1794210891)
+            );
         }
+
         #endregion
 
         #region each
@@ -252,7 +255,7 @@
             UnaryOpStorage/*!*/ succStorage,
             BlockParam block, Range/*!*/ self) {
 
-            // We check that self.begin responds to "succ" even though some of the implementations don't use it.
+            // MRI: Checks that self.begin responds to "succ" even though it might not be used.
             CheckBegin(respondToStorage, self.Begin);
 
             if (self.Begin is int && self.End is int) {
@@ -301,7 +304,7 @@
                 // self.begin is Fixnum; directly call item = item + 1 instead of succ
                 int intStep = Protocols.CastToFixnum(fixnumCast, step);
                 return StepFixnum(block, self, (int)self.Begin, (int)self.End, intStep);
-            } else if (self.Begin is MutableString ) {
+            } else if (self.Begin is MutableString) {
                 // self.begin is String; use item.succ and item <=> self.end but make sure you check the length of the strings
                 int intStep = Protocols.CastToFixnum(fixnumCast, step);
                 return StepString(stringCast, comparisonStorage, lessThanStorage, greaterThanStorage, succStorage, 
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/StructOps.cs;C942557
File: StructOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/StructOps.cs;C942557  (server)    6/23/2009 3:10 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/StructOps.cs;HashIdPerf
@@ -200,13 +200,13 @@
         }
 
         [RubyMethod("hash")]
-        public static int Hash(RubyStruct/*!*/ self) {
-            return self.GetHashCode();
+        public static int Hash(UnaryOpStorage/*!*/ hashStorage, ConversionStorage<int>/*!*/ fixnumCast, RubyStruct/*!*/ self) {
+            return self.GetHashCode(hashStorage, fixnumCast);
         }
 
         [RubyMethod("eql?")]
-        public static bool Equal(RubyStruct/*!*/ self, object other) {
-            return self.Equals(other);
+        public static bool Equal(BinaryOpStorage/*!*/ eqlStorage, RubyStruct/*!*/ self, object other) {
+            return self.Equals(eqlStorage, other);
         }
 
         // same pattern as RubyStruct.Equals, but we need to call == instead of eql?
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/MutableString.cs;C940713
File: MutableString.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/MutableString.cs;C940713  (server)    6/24/2009 10:14 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/MutableString.cs;HashIdPerf
@@ -153,13 +153,13 @@
 
         public static MutableString/*!*/ CreateMutable(string/*!*/ str, RubyEncoding/*!*/ encoding) {
             ContractUtils.RequiresNotNull(encoding, "encoding");
-            return new MutableString(str.ToCharArray(), encoding);
+            return new MutableString(str, encoding);
         }
 
         public static MutableString/*!*/ Create(string/*!*/ str, RubyEncoding/*!*/ encoding) {
             ContractUtils.RequiresNotNull(str, "str");
             ContractUtils.RequiresNotNull(encoding, "encoding");
-            return new MutableString(str.ToCharArray(), encoding);
+            return new MutableString(str, encoding);
         }
 
         public static MutableString/*!*/ CreateBinary() {
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyArray.cs;C959237
File: RubyArray.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyArray.cs;C959237  (server)    6/24/2009 10:14 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyArray.cs;HashIdPerf
@@ -354,6 +354,7 @@
 
         public RubyArray/*!*/ AddMultiple(int count, object value) {
             Mutate();
+            _content.Capacity += count;
             for (int i = 0; i < count; i++) {
                 _content.Add(value);
             }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyStruct.cs;C934738
File: RubyStruct.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyStruct.cs;C934738  (server)    6/23/2009 2:55 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyStruct.cs;HashIdPerf
@@ -205,29 +205,18 @@
             throw RubyExceptions.CreateNameError(String.Format("no member `{0}' in struct", name));
         }
 
-        public override int GetHashCode() {
+        public int GetHashCode(UnaryOpStorage/*!*/ hashStorage, ConversionStorage<int>/*!*/ fixnumCast) {
             // hash is: struct's hash, plus data hashes
-            int hash = StructInfo.GetHashCode();
-            foreach (object obj in _data) {
-                hash ^= RubyUtils.GetHashCode(obj);
-            }
-            return hash;
+            return StructInfo.GetHashCode() ^ RubyArray.GetHashCode(hashStorage, fixnumCast, _data);
         }
 
-        public override bool Equals(object obj) {
+        public bool Equals(BinaryOpStorage/*!*/ eqlStorage, object obj) {
             var other = obj as RubyStruct;
             if (!StructReferenceEquals(other)) {
                 return false;
             }
             
-            Debug.Assert(_data.Length == other._data.Length);
-            for (int i = 0; i < _data.Length; i++) {
-                if (!RubyUtils.ValueEquals(_data[i], other._data[i])) {
-                    return false;
-                }
-            }
-
-            return true;
+            return RubyArray.Equals(eqlStorage, _data, other._data);
         }
 
         public bool StructReferenceEquals(RubyStruct other) {
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;C955994
File: RubyOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;C955994  (server)    6/24/2009 10:14 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;HashIdPerf
@@ -733,13 +733,10 @@
 
         [Emitted]
         public static IList/*!*/ SplatAppend(IList/*!*/ array, object splattee) {
-            IEnumerable<object> objList;
-            IEnumerable iList;
+            IList list;
 
-            if ((objList = splattee as IEnumerable<object>) != null) {
-                array.AddRange(objList);
-            } else if ((iList = splattee as IEnumerable) != null) {
-                array.AddRange(iList);
+            if ((list = splattee as IList) != null) {
+                Utils.AddRange(array, list);
             } else {
                 array.Add(splattee);
             }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;C949767
File: RubyUtils.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;C949767  (server)    6/23/2009 1:59 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;HashIdPerf
@@ -41,16 +41,6 @@
         public static readonly int TrueObjectId = 2;
         public static readonly int NilObjectId = 4;
 
-        // TODO: this is not correct, because it won't call singleton "eql?" methods
-        public static bool ValueEquals(object self, object other) {
-            return object.Equals(self, other);
-        }
-
-        // TODO: this is not correct, because it won't call singleton "hash" methods
-        public static int GetHashCode(object self) {
-            return self != null ? self.GetHashCode() : RubyUtils.NilObjectId;
-        }
-
         /// <summary>
         /// Determines whether the given object is a value type in Ruby (i.e. they have value equality)
         /// 
@@ -121,7 +111,7 @@
             }
         }
 
-        public static MutableString/*!*/ FormatObjectPrefix(string/*!*/ className, int objectId, bool isTainted) {
+        public static MutableString/*!*/ FormatObjectPrefix(string/*!*/ className, long objectId, bool isTainted) {
             MutableString str = MutableString.CreateMutable();
             str.Append("#<");
             str.Append(className);
@@ -134,7 +124,7 @@
             return str;
         }
 
-        public static MutableString/*!*/ FormatObject(string/*!*/ className, int objectId, bool isTainted) {
+        public static MutableString/*!*/ FormatObject(string/*!*/ className, long objectId, bool isTainted) {
             return FormatObjectPrefix(className, objectId, isTainted).Append(">");
         }
 
@@ -146,7 +136,7 @@
             return FormatObjectPrefix(context.GetClassDisplayName(obj), GetObjectId(context, obj), context.IsObjectTainted(obj));
         }
 
-        public static MutableString/*!*/ AppendFormatHexObjectId(MutableString/*!*/ str, int objectId) {
+        public static MutableString/*!*/ AppendFormatHexObjectId(MutableString/*!*/ str, long objectId) {
             return str.AppendFormat("0x{0:x7}", 2 * objectId);
         }
 
@@ -183,11 +173,11 @@
             return true;
         }        
 
-        public static int GetFixnumId(int number) {
-            return number * 2 + 1;
+        public static long GetFixnumId(int number) {
+            return ((long)number << 1) + 1;
         }
 
-        public static int GetObjectId(RubyContext/*!*/ context, object obj) {
+        public static long GetObjectId(RubyContext/*!*/ context, object obj) {
             if (obj == null) return NilObjectId;
             if (obj is bool) return (bool)obj ? TrueObjectId : FalseObjectId;
             if (obj is int) return GetFixnumId((int)obj);
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Utils.cs;C959237
File: Utils.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Utils.cs;C959237  (server)    6/24/2009 10:14 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Utils.cs;HashIdPerf
@@ -133,12 +133,6 @@
             }
         }
 
-        private static void Copy(string/*!*/ src, int srcOffset, char[]/*!*/ dst, int dstOffset, int count) {
-            for (int i = 0; i < count; i++) {
-                dst[dstOffset + i] = src[srcOffset + i];
-            }
-        }
-
         internal static int Append<T>(ref T[]/*!*/ array, int itemCount, T item, int repeatCount) {
             Resize(ref array, itemCount + repeatCount);
             Fill(array, itemCount, item, repeatCount);
@@ -148,7 +142,7 @@
         internal static int Append(ref char[]/*!*/ array, int itemCount, string/*!*/ other, int start, int count) {
             int newCount = itemCount + count;
             Resize(ref array, newCount);
-            Copy(other, start, array, itemCount, count);
+            other.CopyTo(start, array, itemCount, count);
             return newCount;
         }
 
@@ -167,7 +161,7 @@
 
         internal static int InsertAt(ref char[]/*!*/ array, int itemCount, int index, string/*!*/ other, int start, int count) {
             ResizeForInsertion(ref array, itemCount, index, count);
-            Copy(other, start, array, index, count);
+            other.CopyTo(start, array, index, count);
             return itemCount + count;
         }
 
@@ -345,33 +339,16 @@
             return result;
         }
 
-
-
-        internal static void AddRange(this IList/*!*/ collection, IEnumerable<object>/*!*/ range) {
-            Assert.NotNull(collection, range);
-
-            List<object> objList;
-            RubyArray array;
-            if ((array = collection as RubyArray) != null) {
-                array.AddRange(range);
-            } else if ((objList = collection as List<object>) != null) {
-                objList.AddRange(range);
-            } else {
-                foreach (var item in range) {
-                    collection.Add(item);
-                }
-            }
-        }
-
-        internal static void AddRange(this IList/*!*/ list, IEnumerable/*!*/ range) {
+        internal static void AddRange(IList/*!*/ list, IList/*!*/ range) {
             Assert.NotNull(list, range);
 
             List<object> objList;
+            IEnumerable<object> enumerableRange;
             RubyArray array;
             if ((array = list as RubyArray) != null) {
                 array.AddRange(range);
-            } else if ((objList = list as List<object>) != null) {
-                objList.AddRange(range);
+            } else if ((objList = list as List<object>) != null && (enumerableRange = range as IEnumerable<object>) != null) {
+                objList.AddRange(enumerableRange);
             } else {
                 foreach (var item in range) {
                     list.Add(item);
===================================================================
