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

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

Issue 247263003: Hide heap methods where possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index c0cc7e654285804514c05a706cf6208284929e12..13287617414d6a94bd01539a6a0a929b808356e1 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -596,17 +596,17 @@ static const char* not_so_random_string_table[] = {
static void CheckInternalizedStrings(const char** strings) {
+ Isolate* isolate = CcTest::i_isolate();
for (const char* string = *strings; *strings != 0; string = *strings++) {
- Object* a;
- MaybeObject* maybe_a = CcTest::heap()->InternalizeUtf8String(string);
+ HandleScope scope(isolate);
+ Handle<String> a =
+ isolate->factory()->InternalizeUtf8String(CStrVector(string));
// InternalizeUtf8String may return a failure if a GC is needed.
- if (!maybe_a->ToObject(&a)) continue;
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 =
+ isolate->factory()->InternalizeUtf8String(CStrVector(string));
+ CHECK_EQ(*b, *a);
+ CHECK(String::cast(*b)->IsUtf8EqualTo(CStrVector(string)));
Michael Starzinger 2014/04/29 13:15:09 nit: The "String::cast" here is obsolete, "b" is a
}
}
@@ -981,7 +981,7 @@ TEST(Regression39128) {
// Test case for crbug.com/39128.
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
- Heap* heap = isolate->heap();
+ TestHeap* heap = CcTest::test_heap();
// Increase the chance of 'bump-the-pointer' allocation in old space.
heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);

Powered by Google App Engine
This is Rietveld 408576698