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

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

Issue 249103002: StringTable::LookupKey() and all callers handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review notes Created 6 years, 8 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-api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index c0cc7e654285804514c05a706cf6208284929e12..517a2e27491ddd18b7b7d40ed3e53cbb758e1773 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -596,17 +596,13 @@ static const char* not_so_random_string_table[] = {
static void CheckInternalizedStrings(const char** strings) {
+ Factory* factory = CcTest::i_isolate()->factory();
for (const char* string = *strings; *strings != 0; string = *strings++) {
- Object* a;
- MaybeObject* maybe_a = CcTest::heap()->InternalizeUtf8String(string);
- // InternalizeUtf8String may return a failure if a GC is needed.
- if (!maybe_a->ToObject(&a)) continue;
+ Handle<String> a = factory->InternalizeUtf8String(string);
CHECK(a->IsInternalizedString());
- Object* b;
- MaybeObject* maybe_b = CcTest::heap()->InternalizeUtf8String(string);
- if (!maybe_b->ToObject(&b)) continue;
- CHECK_EQ(b, a);
- CHECK(String::cast(b)->IsUtf8EqualTo(CStrVector(string)));
+ Handle<String> b = factory->InternalizeUtf8String(string);
+ CHECK_EQ(*b, *a);
+ CHECK(String::cast(*b)->IsUtf8EqualTo(CStrVector(string)));
}
}
@@ -614,6 +610,7 @@ static void CheckInternalizedStrings(const char** strings) {
TEST(StringTable) {
CcTest::InitializeVM();
+ v8::HandleScope sc(CcTest::isolate());
CheckInternalizedStrings(not_so_random_string_table);
CheckInternalizedStrings(not_so_random_string_table);
}
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698