Index: test/cctest/test-weakmaps.cc |
diff --git a/test/cctest/test-weakmaps.cc b/test/cctest/test-weakmaps.cc |
index 6c19cb8e47d5caa1c92b96d9704e23653424b9e5..c3b0c2efd1b3596cff4fefb3500b3762fcd3c20d 100644 |
--- a/test/cctest/test-weakmaps.cc |
+++ b/test/cctest/test-weakmaps.cc |
@@ -42,10 +42,7 @@ static Isolate* GetIsolateFrom(LocalContext* context) { |
static Handle<JSWeakMap> AllocateJSWeakMap(Isolate* isolate) { |
- Factory* factory = isolate->factory(); |
- Handle<Map> map = factory->NewMap(JS_WEAK_MAP_TYPE, JSWeakMap::kSize); |
- Handle<JSObject> weakmap_obj = factory->NewJSObjectFromMap(map); |
- Handle<JSWeakMap> weakmap(JSWeakMap::cast(*weakmap_obj)); |
+ Handle<JSWeakMap> weakmap = isolate->factory()->NewJSWeakMap(); |
// Do not leak handles for the hash table, it would make entries strong. |
{ |
HandleScope scope(isolate); |
@@ -58,11 +55,7 @@ static Handle<JSWeakMap> AllocateJSWeakMap(Isolate* isolate) { |
static void PutIntoWeakMap(Handle<JSWeakMap> weakmap, |
Handle<JSObject> key, |
Handle<Object> value) { |
- Handle<ObjectHashTable> table = ObjectHashTable::Put( |
- Handle<ObjectHashTable>(ObjectHashTable::cast(weakmap->table())), |
- Handle<JSObject>(JSObject::cast(*key)), |
- value); |
- weakmap->set_table(*table); |
+ Runtime::WeakCollectionSet(weakmap, key, value); |
} |
static int NumberOfWeakCalls = 0; |