Index: test/cctest/test-weaksets.cc |
diff --git a/test/cctest/test-weaksets.cc b/test/cctest/test-weaksets.cc |
index f08a99bcbfa250f8f4c1584379c3bdf101bf17ab..60f2d45dc358d8c186bc139a943763db21e39f38 100644 |
--- a/test/cctest/test-weaksets.cc |
+++ b/test/cctest/test-weaksets.cc |
@@ -55,6 +55,12 @@ |
return weakset; |
} |
+static void PutIntoWeakSet(Handle<JSWeakSet> weakset, |
+ Handle<JSObject> key, |
+ Handle<Object> value) { |
+ Runtime::WeakCollectionSet(weakset, key, value); |
+} |
+ |
static int NumberOfWeakCalls = 0; |
static void WeakPointerCallback( |
const v8::WeakCallbackData<v8::Value, void>& data) { |
@@ -90,8 +96,9 @@ |
// Put entry into weak set. |
{ |
HandleScope scope(isolate); |
- Handle<Smi> smi(Smi::FromInt(23), isolate); |
- Runtime::WeakCollectionSet(weakset, key, smi); |
+ PutIntoWeakSet(weakset, |
+ Handle<JSObject>(JSObject::cast(*key)), |
+ Handle<Smi>(Smi::FromInt(23), isolate)); |
} |
CHECK_EQ(1, ObjectHashTable::cast(weakset->table())->NumberOfElements()); |
@@ -145,8 +152,7 @@ |
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
for (int i = 0; i < 32; i++) { |
Handle<JSObject> object = factory->NewJSObjectFromMap(map); |
- Handle<Smi> smi(Smi::FromInt(i), isolate); |
- Runtime::WeakCollectionSet(weakset, object, smi); |
+ PutIntoWeakSet(weakset, object, Handle<Smi>(Smi::FromInt(i), isolate)); |
} |
} |
@@ -193,7 +199,7 @@ |
Handle<JSObject> object = factory->NewJSObject(function, TENURED); |
CHECK(!heap->InNewSpace(object->address())); |
CHECK(!first_page->Contains(object->address())); |
- Runtime::WeakCollectionSet(weakset, key, object); |
+ PutIntoWeakSet(weakset, key, object); |
} |
} |
@@ -233,8 +239,9 @@ |
} |
Handle<JSWeakSet> weakset = AllocateJSWeakSet(isolate); |
for (int i = 0; i < 32; i++) { |
- Handle<Smi> smi(Smi::FromInt(i), isolate); |
- Runtime::WeakCollectionSet(weakset, keys[i], smi); |
+ PutIntoWeakSet(weakset, |
+ keys[i], |
+ Handle<Smi>(Smi::FromInt(i), isolate)); |
} |
// Force compacting garbage collection. The subsequent collections are used |