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

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: addressed comments 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-alloc.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | 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 c9e5d50add4e63269f675adcb7acfe404754b5b4..dfc1ab5c4f7ee3b162607e4ea6dd48134b28a367 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -595,13 +595,20 @@ static const char* not_so_random_string_table[] = {
static void CheckInternalizedStrings(const char** strings) {
- Factory* factory = CcTest::i_isolate()->factory();
+ Isolate* isolate = CcTest::i_isolate();
+ Factory* factory = isolate->factory();
for (const char* string = *strings; *strings != 0; string = *strings++) {
- Handle<String> a = factory->InternalizeUtf8String(string);
+ HandleScope scope(isolate);
+ Handle<String> a =
+ isolate->factory()->InternalizeUtf8String(CStrVector(string));
+ // InternalizeUtf8String may return a failure if a GC is needed.
CHECK(a->IsInternalizedString());
Handle<String> b = factory->InternalizeUtf8String(string);
CHECK_EQ(*b, *a);
- CHECK(String::cast(*b)->IsUtf8EqualTo(CStrVector(string)));
+ CHECK(b->IsUtf8EqualTo(CStrVector(string)));
+ b = isolate->factory()->InternalizeUtf8String(CStrVector(string));
+ CHECK_EQ(*b, *a);
+ CHECK(b->IsUtf8EqualTo(CStrVector(string)));
}
}
@@ -977,7 +984,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);
« no previous file with comments | « test/cctest/test-alloc.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698