diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Hashtable.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Hashtable.cs index 0b65c0469b4d7..f795b446f0cf1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Hashtable.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Hashtable.cs @@ -132,6 +132,10 @@ private struct bucket private bucket[] _buckets = null!; +#if TARGET_64BIT + // The FastMod Mulitplier + private ulong _fastModMultiplier; +#endif // The total number of entries in the hash table. private int _count; @@ -258,7 +262,7 @@ public Hashtable(int capacity) : this(capacity, 1.0f) public Hashtable(int capacity, float loadFactor) { if (capacity < 0) - throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NeedNonNegNum); + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.capacity, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum); if (!(loadFactor >= 0.1f && loadFactor <= 1.0f)) throw new ArgumentOutOfRangeException(nameof(loadFactor), SR.Format(SR.ArgumentOutOfRange_HashtableLoadFactor, .1, 1.0)); @@ -267,13 +271,16 @@ public Hashtable(int capacity, float loadFactor) double rawsize = capacity / _loadFactor; if (rawsize > int.MaxValue) - throw new ArgumentException(SR.Arg_HTCapacityOverflow, nameof(capacity)); + ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_HTCapacityOverflow, ExceptionArgument.capacity); // Avoid awfully small sizes int hashsize = (rawsize > InitialSize) ? HashHelpers.GetPrime((int)rawsize) : InitialSize; _buckets = new bucket[hashsize]; _loadsize = (int)(_loadFactor * hashsize); +#if TARGET_64BIT + _fastModMultiplier = HashHelpers.GetFastModMultiplier((uint)hashsize); +#endif _isWriterInProgress = false; // Based on the current algorithm, loadsize must be less than hashsize. Debug.Assert(_loadsize < hashsize, "Invalid hashtable loadsize!"); @@ -346,7 +353,7 @@ public Hashtable(IDictionary d, float loadFactor, IHashCodeProvider? hcp, ICompa : this(d != null ? d.Count : 0, loadFactor, hcp, comparer) { if (d == null) - throw new ArgumentNullException(nameof(d), SR.ArgumentNull_Dictionary); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.d, ExceptionResource.ArgumentNull_Dictionary); IDictionaryEnumerator e = d.GetEnumerator(); while (e.MoveNext()) @@ -357,7 +364,7 @@ public Hashtable(IDictionary d, float loadFactor, IEqualityComparer? equalityCom : this(d != null ? d.Count : 0, loadFactor, equalityComparer) { if (d == null) - throw new ArgumentNullException(nameof(d), SR.ArgumentNull_Dictionary); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.d, ExceptionResource.ArgumentNull_Dictionary); IDictionaryEnumerator e = d.GetEnumerator(); while (e.MoveNext()) @@ -403,7 +410,11 @@ private uint InitHash(object key, int hashsize, out uint seed, out uint incr) // visit every bucket in the table exactly once within hashsize // iterations. Violate this and it'll cause obscure bugs forever. // If you change this calculation for h2(key), update putEntry too! +#if TARGET_64BIT + incr = (uint)(1 + HashHelpers.FastMod(seed * HashHelpers.HashPrime, (uint)hashsize - 1, _fastModMultiplier)); +#else incr = (uint)(1 + ((seed * HashHelpers.HashPrime) % ((uint)hashsize - 1))); +#endif return hashcode; } @@ -476,7 +487,7 @@ public virtual bool ContainsKey(object key) { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key, ExceptionResource.ArgumentNull_Key); } // Take a snapshot of buckets, in case another thread resizes table @@ -485,7 +496,11 @@ public virtual bool ContainsKey(object key) int ntry = 0; bucket b; +#if TARGET_64BIT + int bucketNumber = (int)HashHelpers.FastMod(seed, (uint)lbuckets.Length, _fastModMultiplier); +#else int bucketNumber = (int)(seed % (uint)lbuckets.Length); +#endif do { b = lbuckets[bucketNumber]; @@ -496,7 +511,11 @@ public virtual bool ContainsKey(object key) if (((b.hash_coll & 0x7FFFFFFF) == hashcode) && KeyEquals(b.key, key)) return true; +#if TARGET_64BIT + bucketNumber = (int)HashHelpers.FastMod((uint)((long)bucketNumber + incr), (uint)lbuckets.Length, _fastModMultiplier); +#else bucketNumber = (int)(((long)bucketNumber + incr) % (uint)lbuckets.Length); +#endif } while (b.hash_coll < 0 && ++ntry < lbuckets.Length); return false; } @@ -573,13 +592,13 @@ private void CopyEntries(Array array, int arrayIndex) public virtual void CopyTo(Array array, int arrayIndex) { if (array == null) - throw new ArgumentNullException(nameof(array), SR.ArgumentNull_Array); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array, ExceptionResource.ArgumentNull_Array); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported, nameof(array)); + ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RankMultiDimNotSupported, ExceptionArgument.array); if (arrayIndex < 0) - throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum); + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.arrayIndex, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum); if (array.Length - arrayIndex < Count) - throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall); + ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall); CopyEntries(array, arrayIndex); } @@ -633,7 +652,7 @@ public virtual object? this[object key] { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key, ExceptionResource.ArgumentNull_Key); } @@ -643,7 +662,11 @@ public virtual object? this[object key] int ntry = 0; bucket b; +#if TARGET_64BIT + int bucketNumber = (int)HashHelpers.FastMod(seed, (uint)lbuckets.Length, _fastModMultiplier); +#else int bucketNumber = (int)(seed % (uint)lbuckets.Length); +#endif do { int currentversion; @@ -684,7 +707,11 @@ public virtual object? this[object key] if (((b.hash_coll & 0x7FFFFFFF) == hashcode) && KeyEquals(b.key, key)) return b.val; +#if TARGET_64BIT + bucketNumber = (int)HashHelpers.FastMod((uint)((long)bucketNumber + incr), (uint)lbuckets.Length, _fastModMultiplier); +#else bucketNumber = (int)(((long)bucketNumber + incr) % (uint)lbuckets.Length); +#endif } while (b.hash_coll < 0 && ++ntry < lbuckets.Length); return null; } @@ -747,6 +774,9 @@ private void rehash(int newsize) _isWriterInProgress = true; _buckets = newBuckets; _loadsize = (int)(_loadFactor * newsize); +#if TARGET_64BIT + _fastModMultiplier = HashHelpers.GetFastModMultiplier((uint)newsize); +#endif UpdateVersion(); _isWriterInProgress = false; // minimum size of hashtable is 3 now and maximum loadFactor is 0.72 now. @@ -841,7 +871,7 @@ private void Insert(object key, object? nvalue, bool add) { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key, ExceptionResource.ArgumentNull_Key); } if (_count >= _loadsize) @@ -858,8 +888,13 @@ private void Insert(object key, object? nvalue, bool add) uint hashcode = InitHash(key, _buckets.Length, out uint seed, out uint incr); int ntry = 0; int emptySlotNumber = -1; // We use the empty slot number to cache the first empty slot. We chose to reuse slots + // create by remove that have the collision bit set over using up new slots. +#if TARGET_64BIT + int bucketNumber = (int)HashHelpers.FastMod(seed, (uint)_buckets.Length, _fastModMultiplier); +#else int bucketNumber = (int)(seed % (uint)_buckets.Length); +#endif do { // Set emptySlot number to current bucket if it is the first available bucket that we have seen @@ -922,7 +957,11 @@ private void Insert(object key, object? nvalue, bool add) } } +#if TARGET_64BIT + bucketNumber = (int)HashHelpers.FastMod((uint)((long)bucketNumber + incr), (uint)_buckets.Length, _fastModMultiplier); +#else bucketNumber = (int)(((long)bucketNumber + incr) % (uint)_buckets.Length); +#endif } while (++ntry < _buckets.Length); // This code is here if and only if there were no buckets without a collision bit set in the entire table @@ -945,7 +984,7 @@ private void Insert(object key, object? nvalue, bool add) // Then verify that our double hash function (h2, described at top of file) // meets the requirements described above. You should never see this assert. Debug.Fail("hash table insert failed! Load factor too high, or our double hashing function is incorrect."); - throw new InvalidOperationException(SR.InvalidOperation_HashInsertFailed); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.InvalidOperation_HashInsertFailed); } private void putEntry(bucket[] newBuckets, object key, object? nvalue, int hashcode) @@ -953,8 +992,13 @@ private void putEntry(bucket[] newBuckets, object key, object? nvalue, int hashc Debug.Assert(hashcode >= 0, "hashcode >= 0"); // make sure collision bit (sign bit) wasn't set. uint seed = (uint)hashcode; +#if TARGET_64BIT + uint incr = unchecked((uint)(1 + HashHelpers.FastMod(seed * HashHelpers.HashPrime, (uint)newBuckets.Length - 1, _fastModMultiplier))); + int bucketNumber = (int)HashHelpers.FastMod(seed, (uint)newBuckets.Length, _fastModMultiplier); +#else uint incr = unchecked((uint)(1 + ((seed * HashHelpers.HashPrime) % ((uint)newBuckets.Length - 1)))); int bucketNumber = (int)(seed % (uint)newBuckets.Length); +#endif while (true) { if ((newBuckets[bucketNumber].key == null) || (newBuckets[bucketNumber].key == _buckets)) @@ -970,7 +1014,11 @@ private void putEntry(bucket[] newBuckets, object key, object? nvalue, int hashc newBuckets[bucketNumber].hash_coll |= unchecked((int)0x80000000); _occupancy++; } +#if TARGET_64BIT + bucketNumber = (int)HashHelpers.FastMod((uint)((long)bucketNumber + incr), (uint)newBuckets.Length, _fastModMultiplier); +#else bucketNumber = (int)(((long)bucketNumber + incr) % (uint)newBuckets.Length); +#endif } } @@ -982,7 +1030,7 @@ public virtual void Remove(object key) { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key, ExceptionResource.ArgumentNull_Key); } Debug.Assert(!_isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); @@ -992,31 +1040,39 @@ public virtual void Remove(object key) int ntry = 0; bucket b; - int bn = (int)(seed % (uint)_buckets.Length); // bucketNumber +#if TARGET_64BIT + int bucketNumber = (int)HashHelpers.FastMod(seed, (uint)_buckets.Length, _fastModMultiplier); +#else + int bucketNumber = (int)(seed % (uint)_buckets.Length); +#endif do { - b = _buckets[bn]; + b = _buckets[bucketNumber]; if (((b.hash_coll & 0x7FFFFFFF) == hashcode) && KeyEquals(b.key, key)) { _isWriterInProgress = true; // Clear hash_coll field, then key, then value - _buckets[bn].hash_coll &= unchecked((int)0x80000000); - if (_buckets[bn].hash_coll != 0) + _buckets[bucketNumber].hash_coll &= unchecked((int)0x80000000); + if (_buckets[bucketNumber].hash_coll != 0) { - _buckets[bn].key = _buckets; + _buckets[bucketNumber].key = _buckets; } else { - _buckets[bn].key = null; + _buckets[bucketNumber].key = null; } - _buckets[bn].val = null; // Free object references sooner & simplify ContainsValue. + _buckets[bucketNumber].val = null; // Free object references sooner & simplify ContainsValue. _count--; UpdateVersion(); _isWriterInProgress = false; return; } - bn = (int)(((long)bn + incr) % (uint)_buckets.Length); +#if TARGET_64BIT + bucketNumber = (int)HashHelpers.FastMod((uint)((long)bucketNumber + incr), (uint)_buckets.Length, _fastModMultiplier); +#else + bucketNumber = (int)(((long)bucketNumber + incr) % (uint)_buckets.Length); +#endif } while (b.hash_coll < 0 && ++ntry < _buckets.Length); } @@ -1032,7 +1088,10 @@ public virtual void Remove(object key) public static Hashtable Synchronized(Hashtable table) { if (table == null) - throw new ArgumentNullException(nameof(table)); + { + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.table); + } + return new SyncHashtable(table); } @@ -1040,7 +1099,7 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte { if (info == null) { - throw new ArgumentNullException(nameof(info)); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.info); } // This is imperfect - it only works well if all other writes are @@ -1091,7 +1150,7 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte // were serializing it. That's a race in their code. if (_version != oldVersion) { - throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion); + ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion(); } } } @@ -1111,7 +1170,7 @@ public virtual void OnDeserialization(object? sender) if (siInfo == null) { - throw new SerializationException(SR.Serialization_InvalidOnDeser); + ThrowHelper.ThrowSerializationException(ExceptionResource.Serialization_InvalidOnDeser); } int hashsize = 0; @@ -1168,21 +1227,21 @@ public virtual void OnDeserialization(object? sender) if (serKeys == null) { - throw new SerializationException(SR.Serialization_MissingKeys); + ThrowHelper.ThrowSerializationException(ExceptionResource.Serialization_MissingKeys); } if (serValues == null) { - throw new SerializationException(SR.Serialization_MissingValues); + ThrowHelper.ThrowSerializationException(ExceptionResource.Serialization_MissingValues); } if (serKeys.Length != serValues.Length) { - throw new SerializationException(SR.Serialization_KeyValueDifferentSizes); + ThrowHelper.ThrowSerializationException(ExceptionResource.Serialization_KeyValueDifferentSizes); } for (int i = 0; i < serKeys.Length; i++) { if (serKeys[i] == null) { - throw new SerializationException(SR.Serialization_NullKey); + ThrowHelper.ThrowSerializationException(ExceptionResource.Serialization_NullKey); ; } Insert(serKeys[i], serValues[i], true); } @@ -1206,13 +1265,13 @@ internal KeyCollection(Hashtable hashtable) public void CopyTo(Array array, int arrayIndex) { if (array == null) - throw new ArgumentNullException(nameof(array)); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported, nameof(array)); + ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RankMultiDimNotSupported, ExceptionArgument.array); if (arrayIndex < 0) - throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum); + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.arrayIndex, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum); if (array.Length - arrayIndex < _hashtable._count) - throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall); + ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall); _hashtable.CopyKeys(array, arrayIndex); } @@ -1242,13 +1301,13 @@ internal ValueCollection(Hashtable hashtable) public void CopyTo(Array array, int arrayIndex) { if (array == null) - throw new ArgumentNullException(nameof(array)); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported, nameof(array)); + ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RankMultiDimNotSupported, ExceptionArgument.array); if (arrayIndex < 0) - throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum); + ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.arrayIndex, ExceptionResource.ArgumentOutOfRange_NeedNonNegNum); if (array.Length - arrayIndex < _hashtable._count) - throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall); + ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall); _hashtable.CopyValues(array, arrayIndex); } @@ -1331,7 +1390,7 @@ public override bool ContainsKey(object key) { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key, ExceptionResource.ArgumentNull_Key); } return _table.ContainsKey(key); } @@ -1446,7 +1505,7 @@ public object Key get { if (!_current) - throw new InvalidOperationException(SR.InvalidOperation_EnumNotStarted); + ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumNotStarted(); return _currentKey!; } } @@ -1454,7 +1513,7 @@ public object Key public bool MoveNext() { if (_version != _hashtable._version) - throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion); + ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion(); while (_bucket > 0) { _bucket--; @@ -1476,7 +1535,7 @@ public DictionaryEntry Entry get { if (!_current) - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumOpCantHappen(); return new DictionaryEntry(_currentKey!, _currentValue); } } @@ -1486,7 +1545,7 @@ public object? Current get { if (!_current) - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumOpCantHappen(); if (_getObjectRetType == Keys) return _currentKey; @@ -1502,7 +1561,7 @@ public object? Value get { if (!_current) - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumOpCantHappen(); return _currentValue; } } @@ -1510,7 +1569,8 @@ public object? Value public void Reset() { if (_version != _hashtable._version) - throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion); + ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion(); + _current = false; _bucket = _hashtable._buckets.Length; _currentKey = null; @@ -1527,7 +1587,7 @@ public HashtableDebugView(Hashtable hashtable) { if (hashtable == null) { - throw new ArgumentNullException(nameof(hashtable)); + ThrowHelper.ThrowArgumentNullException(ExceptionArgument.hashtable); } _hashtable = hashtable; diff --git a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs index d061bddce9cab..b78a4f9a7996a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs @@ -629,6 +629,8 @@ private static string GetArgumentName(ExceptionArgument argument) return "charIndex"; case ExceptionArgument.charCount: return "charCount"; + case ExceptionArgument.d: + return "d"; case ExceptionArgument.s: return "s"; case ExceptionArgument.input: @@ -637,6 +639,10 @@ private static string GetArgumentName(ExceptionArgument argument) return "ownedMemory"; case ExceptionArgument.list: return "list"; + case ExceptionArgument.table: + return "table"; + case ExceptionArgument.hashtable: + return "hashtable"; case ExceptionArgument.index: return "index"; case ExceptionArgument.capacity: @@ -837,10 +843,18 @@ private static string GetResourceString(ExceptionResource resource) return SR.Argument_CannotExtractScalar; case ExceptionResource.ArgumentOutOfRange_BiggerThanCollection: return SR.ArgumentOutOfRange_BiggerThanCollection; + case ExceptionResource.Serialization_InvalidOnDeser: + return SR.Serialization_InvalidOnDeser; + case ExceptionResource.Serialization_KeyValueDifferentSizes: + return SR.Serialization_KeyValueDifferentSizes; case ExceptionResource.Serialization_MissingKeys: return SR.Serialization_MissingKeys; + case ExceptionResource.Serialization_MissingValues: + return SR.Serialization_MissingKeys; case ExceptionResource.Serialization_NullKey: return SR.Serialization_NullKey; + case ExceptionResource.Serialization_NullValues: + return SR.Serialization_NullKey; case ExceptionResource.NotSupported_KeyCollectionSet: return SR.NotSupported_KeyCollectionSet; case ExceptionResource.NotSupported_ValueCollectionSet: @@ -899,6 +913,10 @@ private static string GetResourceString(ExceptionResource resource) return SR.ArgumentException_OtherNotArrayOfCorrectLength; case ExceptionResource.ArgumentNull_Array: return SR.ArgumentNull_Array; + case ExceptionResource.ArgumentNull_Dictionary: + return SR.ArgumentNull_Dictionary; + case ExceptionResource.ArgumentNull_Key: + return SR.ArgumentNull_Key; case ExceptionResource.ArgumentNull_SafeHandle: return SR.ArgumentNull_SafeHandle; case ExceptionResource.ArgumentOutOfRange_EndIndexStartIndex: @@ -911,6 +929,8 @@ private static string GetResourceString(ExceptionResource resource) return SR.Argument_AddingDuplicate; case ExceptionResource.Argument_InvalidArgumentForComparison: return SR.Argument_InvalidArgumentForComparison; + case ExceptionResource.Arg_HTCapacityOverflow: + return SR.Arg_HTCapacityOverflow; case ExceptionResource.Arg_LowerBoundsMustMatch: return SR.Arg_LowerBoundsMustMatch; case ExceptionResource.Arg_MustBeType: @@ -929,6 +949,8 @@ private static string GetResourceString(ExceptionResource resource) return SR.Arg_RanksAndBounds; case ExceptionResource.InvalidOperation_IComparerFailed: return SR.InvalidOperation_IComparerFailed; + case ExceptionResource.InvalidOperation_HashInsertFailed: + return SR.InvalidOperation_HashInsertFailed; case ExceptionResource.NotSupported_FixedSizeCollection: return SR.NotSupported_FixedSizeCollection; case ExceptionResource.Rank_MultiDimNotSupported: @@ -970,10 +992,13 @@ internal enum ExceptionArgument chars, charIndex, charCount, + d, s, input, ownedMemory, list, + table, + hashtable, index, capacity, collection, @@ -1070,8 +1095,12 @@ internal enum ExceptionResource Argument_InvalidOffLen, Argument_CannotExtractScalar, ArgumentOutOfRange_BiggerThanCollection, + Serialization_InvalidOnDeser, + Serialization_KeyValueDifferentSizes, Serialization_MissingKeys, + Serialization_MissingValues, Serialization_NullKey, + Serialization_NullValues, NotSupported_KeyCollectionSet, NotSupported_ValueCollectionSet, InvalidOperation_NullArray, @@ -1079,6 +1108,7 @@ internal enum ExceptionResource TaskCompletionSourceT_TrySetException_NullException, TaskCompletionSourceT_TrySetException_NoExceptions, NotSupported_StringComparison, + Arg_HTCapacityOverflow, ConcurrentCollection_SyncRoot_NotSupported, Task_MultiTaskContinuation_NullTask, InvalidOperation_WrongAsyncResultOrEndCalledMultiple, @@ -1101,6 +1131,8 @@ internal enum ExceptionResource Task_WaitMulti_NullTask, ArgumentException_OtherNotArrayOfCorrectLength, ArgumentNull_Array, + ArgumentNull_Dictionary, + ArgumentNull_Key, ArgumentNull_SafeHandle, ArgumentOutOfRange_EndIndexStartIndex, ArgumentOutOfRange_Enum, @@ -1116,6 +1148,7 @@ internal enum ExceptionResource Arg_RankIndices, Arg_RanksAndBounds, InvalidOperation_IComparerFailed, + InvalidOperation_HashInsertFailed, NotSupported_FixedSizeCollection, Rank_MultiDimNotSupported, Arg_TypeNotSupported,