| Index: src/collection.js
|
| diff --git a/src/collection.js b/src/collection.js
|
| index 6b468f5fc0ee8b2de8cd61ca1a27e4c78c8dcfb5..1cc6857b3c4330c2782b6856c8bb9e471e9be8f7 100644
|
| --- a/src/collection.js
|
| +++ b/src/collection.js
|
| @@ -16,11 +16,6 @@ var $getExistingHash;
|
| var GlobalMap = global.Map;
|
| var GlobalObject = global.Object;
|
| var GlobalSet = global.Set;
|
| -var IntRandom;
|
| -
|
| -utils.Import(function(from) {
|
| - IntRandom = from.IntRandom;
|
| -});
|
|
|
| var NumberIsNaN;
|
|
|
| @@ -110,11 +105,16 @@ function GetExistingHash(key) {
|
| %SetForceInlineFlag(GetExistingHash);
|
|
|
|
|
| +var hashCounter = 1;
|
| +
|
| +
|
| function GetHash(key) {
|
| var hash = GetExistingHash(key);
|
| if (IS_UNDEFINED(hash)) {
|
| - hash = IntRandom() | 0;
|
| - if (hash === 0) hash = 1;
|
| + hash = hashCounter;
|
| + // Avoid a hash of zero, reserved for the hidden string. Also avoid
|
| + // non-Smi hashes.
|
| + hashCounter = hash == 0x3fffffff ? 1 : hash + 1;
|
| SET_PRIVATE(key, hashCodeSymbol, hash);
|
| }
|
| return hash;
|
|
|