| Index: test/cctest/test-dictionary.cc
|
| diff --git a/test/cctest/test-dictionary.cc b/test/cctest/test-dictionary.cc
|
| index 32fff606174423cc4e15c73d002331f6dafb7fe9..27c4fe4690960ed5d5b99965187623733fcbfd91 100644
|
| --- a/test/cctest/test-dictionary.cc
|
| +++ b/test/cctest/test-dictionary.cc
|
| @@ -41,10 +41,12 @@ using namespace v8::internal;
|
|
|
| TEST(ObjectHashTable) {
|
| LocalContext context;
|
| + Isolate* isolate = Isolate::Current();
|
| + Factory* factory = isolate->factory();
|
| v8::HandleScope scope(context->GetIsolate());
|
| - Handle<ObjectHashTable> table = FACTORY->NewObjectHashTable(23);
|
| - Handle<JSObject> a = FACTORY->NewJSArray(7);
|
| - Handle<JSObject> b = FACTORY->NewJSArray(11);
|
| + Handle<ObjectHashTable> table = factory->NewObjectHashTable(23);
|
| + Handle<JSObject> a = factory->NewJSArray(7);
|
| + Handle<JSObject> b = factory->NewJSArray(11);
|
| table = PutIntoObjectHashTable(table, a, b);
|
| CHECK_EQ(table->NumberOfElements(), 1);
|
| CHECK_EQ(table->Lookup(*a), *b);
|
| @@ -57,12 +59,12 @@ TEST(ObjectHashTable) {
|
| CHECK_EQ(table->Lookup(*b), HEAP->the_hole_value());
|
|
|
| // Keys that are overwritten should not change number of elements.
|
| - table = PutIntoObjectHashTable(table, a, FACTORY->NewJSArray(13));
|
| + table = PutIntoObjectHashTable(table, a, factory->NewJSArray(13));
|
| CHECK_EQ(table->NumberOfElements(), 1);
|
| CHECK_NE(table->Lookup(*a), *b);
|
|
|
| // Keys mapped to the hole should be removed permanently.
|
| - table = PutIntoObjectHashTable(table, a, FACTORY->the_hole_value());
|
| + table = PutIntoObjectHashTable(table, a, factory->the_hole_value());
|
| CHECK_EQ(table->NumberOfElements(), 0);
|
| CHECK_EQ(table->NumberOfDeletedElements(), 1);
|
| CHECK_EQ(table->Lookup(*a), HEAP->the_hole_value());
|
| @@ -70,8 +72,8 @@ TEST(ObjectHashTable) {
|
| // Keys should map back to their respective values and also should get
|
| // an identity hash code generated.
|
| for (int i = 0; i < 100; i++) {
|
| - Handle<JSObject> key = FACTORY->NewJSArray(7);
|
| - Handle<JSObject> value = FACTORY->NewJSArray(11);
|
| + Handle<JSObject> key = factory->NewJSArray(7);
|
| + Handle<JSObject> value = factory->NewJSArray(11);
|
| table = PutIntoObjectHashTable(table, key, value);
|
| CHECK_EQ(table->NumberOfElements(), i + 1);
|
| CHECK_NE(table->FindEntry(*key), ObjectHashTable::kNotFound);
|
| @@ -82,7 +84,7 @@ TEST(ObjectHashTable) {
|
| // Keys never added to the map which already have an identity hash
|
| // code should not be found.
|
| for (int i = 0; i < 100; i++) {
|
| - Handle<JSObject> key = FACTORY->NewJSArray(7);
|
| + Handle<JSObject> key = factory->NewJSArray(7);
|
| CHECK(key->GetIdentityHash(ALLOW_CREATION)->ToObjectChecked()->IsSmi());
|
| CHECK_EQ(table->FindEntry(*key), ObjectHashTable::kNotFound);
|
| CHECK_EQ(table->Lookup(*key), HEAP->the_hole_value());
|
| @@ -92,7 +94,7 @@ TEST(ObjectHashTable) {
|
| // Keys that don't have an identity hash should not be found and also
|
| // should not get an identity hash code generated.
|
| for (int i = 0; i < 100; i++) {
|
| - Handle<JSObject> key = FACTORY->NewJSArray(7);
|
| + Handle<JSObject> key = factory->NewJSArray(7);
|
| CHECK_EQ(table->Lookup(*key), HEAP->the_hole_value());
|
| CHECK_EQ(key->GetIdentityHash(OMIT_CREATION), HEAP->undefined_value());
|
| }
|
| @@ -102,9 +104,11 @@ TEST(ObjectHashTable) {
|
| #ifdef DEBUG
|
| TEST(ObjectHashSetCausesGC) {
|
| LocalContext context;
|
| + Isolate* isolate = Isolate::Current();
|
| + Factory* factory = isolate->factory();
|
| v8::HandleScope scope(context->GetIsolate());
|
| - Handle<ObjectHashSet> table = FACTORY->NewObjectHashSet(1);
|
| - Handle<JSObject> key = FACTORY->NewJSArray(0);
|
| + Handle<ObjectHashSet> table = factory->NewObjectHashSet(1);
|
| + Handle<JSObject> key = factory->NewJSArray(0);
|
| v8::Handle<v8::Object> key_obj = v8::Utils::ToLocal(key);
|
|
|
| // Force allocation of hash table backing store for hidden properties.
|
| @@ -132,9 +136,11 @@ TEST(ObjectHashSetCausesGC) {
|
| #ifdef DEBUG
|
| TEST(ObjectHashTableCausesGC) {
|
| LocalContext context;
|
| + Isolate* isolate = Isolate::Current();
|
| + Factory* factory = isolate->factory();
|
| v8::HandleScope scope(context->GetIsolate());
|
| - Handle<ObjectHashTable> table = FACTORY->NewObjectHashTable(1);
|
| - Handle<JSObject> key = FACTORY->NewJSArray(0);
|
| + Handle<ObjectHashTable> table = factory->NewObjectHashTable(1);
|
| + Handle<JSObject> key = factory->NewJSArray(0);
|
| v8::Handle<v8::Object> key_obj = v8::Utils::ToLocal(key);
|
|
|
| // Force allocation of hash table backing store for hidden properties.
|
|
|