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