Chromium Code Reviews| Index: src/collection.js |
| diff --git a/src/collection.js b/src/collection.js |
| index db30546165119e53f0c4e03a1b5e856259927f10..97669d9161ba65a145f93e6cf01facd400d35a61 100644 |
| --- a/src/collection.js |
| +++ b/src/collection.js |
| @@ -70,6 +70,7 @@ function ComputeIntegerHash(key, seed) { |
| } |
| %SetInlineBuiltinFlag(ComputeIntegerHash); |
| +var hash_code_symbol = GLOBAL_PRIVATE("hash_code_symbol"); |
| function GetHash(key) { |
| if (%_IsSmi(key)) { |
| @@ -81,6 +82,14 @@ function GetHash(key) { |
| return field >>> 2 /* Name::kHashShift */; |
| } |
| } |
| + if (IS_SPEC_OBJECT(key)) { |
|
adamk
2015/05/14 15:01:27
You might need a TODO here for handling proxies ap
Erik Corry
2015/05/14 15:42:19
Probably. What's the deal with the JSGlobalProxy?
Toon Verwaest
2015/05/15 12:24:10
Due to split-object the global proxy points to the
|
| + var hash = key[hash_code_symbol]; |
|
adamk
2015/05/14 15:01:27
We've been using a GET_PRIVATE() for this as a mat
|
| + if (hash == void 0) { |
|
adamk
2015/05/14 15:01:27
IS_UNDEFINED(hash)
|
| + hash = $intrandom() | 0; |
| + key[hash_code_symbol] = hash; |
|
adamk
2015/05/14 15:01:27
SET_PRIVATE()
|
| + } |
| + return hash; |
| + } |
| return %GenericHash(key); |
| } |
| %SetInlineBuiltinFlag(GetHash); |