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

Unified Diff: test/cctest/test-weakmaps.cc

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 | « test/cctest/test-heap.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-weakmaps.cc
diff --git a/test/cctest/test-weakmaps.cc b/test/cctest/test-weakmaps.cc
index 64d2876887bcc779044d766e9c66594478e2edb6..125557850d6391551059d4bc296b7dff676b5be8 100644
--- a/test/cctest/test-weakmaps.cc
+++ b/test/cctest/test-weakmaps.cc
@@ -89,8 +89,10 @@ TEST(Weakness) {
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
Handle<JSObject> object = factory->NewJSObjectFromMap(map);
Handle<Smi> smi(Smi::FromInt(23), isolate);
- Runtime::WeakCollectionSet(weakmap, key, object);
- Runtime::WeakCollectionSet(weakmap, object, smi);
+ int32_t hash = Object::GetOrCreateHash(isolate, key)->value();
+ Runtime::WeakCollectionSet(weakmap, key, object, hash);
+ int32_t object_hash = Object::GetOrCreateHash(isolate, object)->value();
+ Runtime::WeakCollectionSet(weakmap, object, smi, object_hash);
}
CHECK_EQ(2, ObjectHashTable::cast(weakmap->table())->NumberOfElements());
@@ -145,7 +147,8 @@ TEST(Shrinking) {
for (int i = 0; i < 32; i++) {
Handle<JSObject> object = factory->NewJSObjectFromMap(map);
Handle<Smi> smi(Smi::FromInt(i), isolate);
- Runtime::WeakCollectionSet(weakmap, object, smi);
+ int32_t object_hash = Object::GetOrCreateHash(isolate, object)->value();
+ Runtime::WeakCollectionSet(weakmap, object, smi, object_hash);
}
}
@@ -193,7 +196,8 @@ TEST(Regress2060a) {
Handle<JSObject> object = factory->NewJSObject(function, TENURED);
CHECK(!heap->InNewSpace(object->address()));
CHECK(!first_page->Contains(object->address()));
- Runtime::WeakCollectionSet(weakmap, key, object);
+ int32_t hash = Object::GetOrCreateHash(isolate, key)->value();
+ Runtime::WeakCollectionSet(weakmap, key, object, hash);
}
}
@@ -235,7 +239,8 @@ TEST(Regress2060b) {
Handle<JSWeakMap> weakmap = AllocateJSWeakMap(isolate);
for (int i = 0; i < 32; i++) {
Handle<Smi> smi(Smi::FromInt(i), isolate);
- Runtime::WeakCollectionSet(weakmap, keys[i], smi);
+ int32_t hash = Object::GetOrCreateHash(isolate, keys[i])->value();
+ Runtime::WeakCollectionSet(weakmap, keys[i], smi, hash);
}
// Force compacting garbage collection. The subsequent collections are used
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698