Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: src/weak-collection.js

Issue 1149863005: Move hash code from hidden string to a private symbol (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils.h ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/weak-collection.js
diff --git a/src/weak-collection.js b/src/weak-collection.js
index 0e71c7cc147494263ef0926a56e1de0ed335e065..75350931ed22fed9577e37ef1b56756c59c1d116 100644
--- a/src/weak-collection.js
+++ b/src/weak-collection.js
@@ -43,7 +43,9 @@ function WeakMapGet(key) {
'WeakMap.prototype.get', this);
}
if (!IS_SPEC_OBJECT(key)) return UNDEFINED;
- return %WeakCollectionGet(this, key);
+ var hash = $getExistingHash(key);
+ if (IS_UNDEFINED(hash)) return UNDEFINED;
+ return %WeakCollectionGet(this, key, hash);
}
@@ -53,7 +55,7 @@ function WeakMapSet(key, value) {
'WeakMap.prototype.set', this);
}
if (!IS_SPEC_OBJECT(key)) throw MakeTypeError(kInvalidWeakMapKey);
- return %WeakCollectionSet(this, key, value);
+ return %WeakCollectionSet(this, key, value, $getHash(key));
}
@@ -63,7 +65,9 @@ function WeakMapHas(key) {
'WeakMap.prototype.has', this);
}
if (!IS_SPEC_OBJECT(key)) return false;
- return %WeakCollectionHas(this, key);
+ var hash = $getExistingHash(key);
+ if (IS_UNDEFINED(hash)) return false;
+ return %WeakCollectionHas(this, key, hash);
}
@@ -73,7 +77,9 @@ function WeakMapDelete(key) {
'WeakMap.prototype.delete', this);
}
if (!IS_SPEC_OBJECT(key)) return false;
- return %WeakCollectionDelete(this, key);
+ var hash = $getExistingHash(key);
+ if (IS_UNDEFINED(hash)) return false;
+ return %WeakCollectionDelete(this, key, hash);
}
@@ -123,7 +129,7 @@ function WeakSetAdd(value) {
'WeakSet.prototype.add', this);
}
if (!IS_SPEC_OBJECT(value)) throw MakeTypeError(kInvalidWeakSetValue);
- return %WeakCollectionSet(this, value, true);
+ return %WeakCollectionSet(this, value, true, $getHash(value));
}
@@ -133,7 +139,9 @@ function WeakSetHas(value) {
'WeakSet.prototype.has', this);
}
if (!IS_SPEC_OBJECT(value)) return false;
- return %WeakCollectionHas(this, value);
+ var hash = $getExistingHash(value);
+ if (IS_UNDEFINED(hash)) return false;
+ return %WeakCollectionHas(this, value, hash);
}
@@ -143,7 +151,9 @@ function WeakSetDelete(value) {
'WeakSet.prototype.delete', this);
}
if (!IS_SPEC_OBJECT(value)) return false;
- return %WeakCollectionDelete(this, value);
+ var hash = $getExistingHash(value);
+ if (IS_UNDEFINED(hash)) return false;
+ return %WeakCollectionDelete(this, value, hash);
}
« no previous file with comments | « src/utils.h ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698