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

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

Issue 16337005: Deprecate FACTORY helper macro. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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-debug.cc ('k') | test/cctest/test-disasm-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698