Index: test/cctest/test-heap.cc |
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
index d46d59a9128553f96d0c709cd22cd8c5c237d9e8..e86900897e88d7e40074081219875bc0c5482070 100644 |
--- a/test/cctest/test-heap.cc |
+++ b/test/cctest/test-heap.cc |
@@ -441,7 +441,7 @@ TEST(WeakGlobalHandlesMark) { |
} |
// Make sure the objects are promoted. |
- heap->CollectGarbage(OLD_POINTER_SPACE); |
+ heap->CollectGarbage(OLD_SPACE); |
heap->CollectGarbage(NEW_SPACE); |
CHECK(!heap->InNewSpace(*h1) && !heap->InNewSpace(*h2)); |
@@ -494,7 +494,7 @@ TEST(DeleteWeakGlobalHandle) { |
CHECK(!WeakPointerCleared); |
// Mark-compact treats weak reference properly. |
- heap->CollectGarbage(OLD_POINTER_SPACE); |
+ heap->CollectGarbage(OLD_SPACE); |
CHECK(WeakPointerCleared); |
} |
@@ -893,7 +893,7 @@ TEST(Iteration) { |
Handle<Object> objs[objs_count]; |
int next_objs_index = 0; |
- // Allocate a JS array to OLD_POINTER_SPACE and NEW_SPACE |
+ // Allocate a JS array to OLD_SPACE and NEW_SPACE |
objs[next_objs_index++] = factory->NewJSArray(10); |
objs[next_objs_index++] = factory->NewJSArray(10, |
FAST_HOLEY_ELEMENTS, |
@@ -1002,15 +1002,15 @@ TEST(Regression39128) { |
// Step 4: clone jsobject, but force always allocate first to create a clone |
// in old pointer space. |
- Address old_pointer_space_top = heap->old_pointer_space()->top(); |
+ Address old_space_top = heap->old_space()->top(); |
AlwaysAllocateScope aa_scope(isolate); |
Object* clone_obj = heap->CopyJSObject(jsobject).ToObjectChecked(); |
JSObject* clone = JSObject::cast(clone_obj); |
- if (clone->address() != old_pointer_space_top) { |
+ if (clone->address() != old_space_top) { |
// Alas, got allocated from free list, we cannot do checks. |
return; |
} |
- CHECK(heap->old_pointer_space()->Contains(clone->address())); |
+ CHECK(heap->old_space()->Contains(clone->address())); |
} |
@@ -2138,7 +2138,7 @@ TEST(InstanceOfStubWriteBarrier) { |
} |
CcTest::heap()->incremental_marking()->set_should_hurry(true); |
- CcTest::heap()->CollectGarbage(OLD_POINTER_SPACE); |
+ CcTest::heap()->CollectGarbage(OLD_SPACE); |
} |
@@ -2189,7 +2189,7 @@ TEST(PrototypeTransitionClearing) { |
// Make sure next prototype is placed on an old-space evacuation candidate. |
Handle<JSObject> prototype; |
- PagedSpace* space = CcTest::heap()->old_pointer_space(); |
+ PagedSpace* space = CcTest::heap()->old_space(); |
{ |
AlwaysAllocateScope always_allocate(isolate); |
SimulateFullSpace(space); |
@@ -2309,7 +2309,7 @@ TEST(ResetSharedFunctionInfoCountersDuringMarkSweep) { |
TEST(IdleNotificationFinishMarking) { |
i::FLAG_allow_natives_syntax = true; |
CcTest::InitializeVM(); |
- SimulateFullSpace(CcTest::heap()->old_pointer_space()); |
+ SimulateFullSpace(CcTest::heap()->old_space()); |
IncrementalMarking* marking = CcTest::heap()->incremental_marking(); |
marking->Abort(); |
marking->Start(); |
@@ -2420,11 +2420,11 @@ TEST(OptimizedPretenuringAllocationFolding) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*int_array_handle)); |
- CHECK(CcTest::heap()->InOldPointerSpace(int_array_handle->elements())); |
- CHECK(CcTest::heap()->InOldPointerSpace(*double_array_handle)); |
- CHECK(CcTest::heap()->InOldDataSpace(double_array_handle->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(*int_array_handle)); |
+ CHECK(CcTest::heap()->InOldSpace(int_array_handle->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*double_array_handle)); |
+ CHECK(CcTest::heap()->InOldSpace(double_array_handle->elements())); |
} |
@@ -2463,8 +2463,8 @@ TEST(OptimizedPretenuringObjectArrayLiterals) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldPointerSpace(o->elements())); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(o->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
} |
@@ -2504,27 +2504,25 @@ TEST(OptimizedPretenuringMixedInObjectProperties) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
FieldIndex idx1 = FieldIndex::ForPropertyIndex(o->map(), 0); |
FieldIndex idx2 = FieldIndex::ForPropertyIndex(o->map(), 1); |
- CHECK(CcTest::heap()->InOldPointerSpace(o->RawFastPropertyAt(idx1))); |
+ CHECK(CcTest::heap()->InOldSpace(o->RawFastPropertyAt(idx1))); |
if (!o->IsUnboxedDoubleField(idx2)) { |
- CHECK(CcTest::heap()->InOldDataSpace(o->RawFastPropertyAt(idx2))); |
+ CHECK(CcTest::heap()->InOldSpace(o->RawFastPropertyAt(idx2))); |
} else { |
CHECK_EQ(1.1, o->RawFastDoublePropertyAt(idx2)); |
} |
JSObject* inner_object = |
reinterpret_cast<JSObject*>(o->RawFastPropertyAt(idx1)); |
- CHECK(CcTest::heap()->InOldPointerSpace(inner_object)); |
+ CHECK(CcTest::heap()->InOldSpace(inner_object)); |
if (!inner_object->IsUnboxedDoubleField(idx1)) { |
- CHECK( |
- CcTest::heap()->InOldDataSpace(inner_object->RawFastPropertyAt(idx1))); |
+ CHECK(CcTest::heap()->InOldSpace(inner_object->RawFastPropertyAt(idx1))); |
} else { |
CHECK_EQ(2.2, inner_object->RawFastDoublePropertyAt(idx1)); |
} |
- CHECK(CcTest::heap()->InOldPointerSpace( |
- inner_object->RawFastPropertyAt(idx2))); |
+ CHECK(CcTest::heap()->InOldSpace(inner_object->RawFastPropertyAt(idx2))); |
} |
@@ -2563,8 +2561,8 @@ TEST(OptimizedPretenuringDoubleArrayProperties) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
- CHECK(CcTest::heap()->InOldDataSpace(o->properties())); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(o->properties())); |
} |
@@ -2603,8 +2601,8 @@ TEST(OptimizedPretenuringdoubleArrayLiterals) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldDataSpace(o->elements())); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(o->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
} |
@@ -2648,11 +2646,11 @@ TEST(OptimizedPretenuringNestedMixedArrayLiterals) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*int_array_handle)); |
- CHECK(CcTest::heap()->InOldPointerSpace(int_array_handle->elements())); |
- CHECK(CcTest::heap()->InOldPointerSpace(*double_array_handle)); |
- CHECK(CcTest::heap()->InOldDataSpace(double_array_handle->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(*int_array_handle)); |
+ CHECK(CcTest::heap()->InOldSpace(int_array_handle->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*double_array_handle)); |
+ CHECK(CcTest::heap()->InOldSpace(double_array_handle->elements())); |
} |
@@ -2697,11 +2695,11 @@ TEST(OptimizedPretenuringNestedObjectLiterals) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*int_array_handle_1)); |
- CHECK(CcTest::heap()->InOldPointerSpace(int_array_handle_1->elements())); |
- CHECK(CcTest::heap()->InOldPointerSpace(*int_array_handle_2)); |
- CHECK(CcTest::heap()->InOldPointerSpace(int_array_handle_2->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(*int_array_handle_1)); |
+ CHECK(CcTest::heap()->InOldSpace(int_array_handle_1->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*int_array_handle_2)); |
+ CHECK(CcTest::heap()->InOldSpace(int_array_handle_2->elements())); |
} |
@@ -2748,11 +2746,11 @@ TEST(OptimizedPretenuringNestedDoubleLiterals) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*double_array_handle_1)); |
- CHECK(CcTest::heap()->InOldDataSpace(double_array_handle_1->elements())); |
- CHECK(CcTest::heap()->InOldPointerSpace(*double_array_handle_2)); |
- CHECK(CcTest::heap()->InOldDataSpace(double_array_handle_2->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(*double_array_handle_1)); |
+ CHECK(CcTest::heap()->InOldSpace(double_array_handle_1->elements())); |
+ CHECK(CcTest::heap()->InOldSpace(*double_array_handle_2)); |
+ CHECK(CcTest::heap()->InOldSpace(double_array_handle_2->elements())); |
} |
@@ -2805,7 +2803,7 @@ TEST(OptimizedPretenuringConstructorCalls) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
} |
@@ -2852,7 +2850,7 @@ TEST(OptimizedPretenuringCallNew) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldPointerSpace(*o)); |
+ CHECK(CcTest::heap()->InOldSpace(*o)); |
} |
@@ -3037,7 +3035,7 @@ TEST(TransitionArrayShrinksDuringAllocToOnePropertyFound) { |
root = GetByName("root"); |
AddPropertyTo(0, root, "prop9"); |
- CcTest::i_isolate()->heap()->CollectGarbage(OLD_POINTER_SPACE); |
+ CcTest::i_isolate()->heap()->CollectGarbage(OLD_SPACE); |
// Count number of live transitions after marking. Note that one transition |
// is left, because 'o' still holds an instance of one transition target. |
@@ -3175,27 +3173,27 @@ TEST(ReleaseOverReservedPages) { |
static const int number_of_test_pages = 20; |
// Prepare many pages with low live-bytes count. |
- PagedSpace* old_pointer_space = heap->old_pointer_space(); |
- CHECK_EQ(1, old_pointer_space->CountTotalPages()); |
+ PagedSpace* old_space = heap->old_space(); |
+ CHECK_EQ(1, old_space->CountTotalPages()); |
for (int i = 0; i < number_of_test_pages; i++) { |
AlwaysAllocateScope always_allocate(isolate); |
- SimulateFullSpace(old_pointer_space); |
+ SimulateFullSpace(old_space); |
factory->NewFixedArray(1, TENURED); |
} |
- CHECK_EQ(number_of_test_pages + 1, old_pointer_space->CountTotalPages()); |
+ CHECK_EQ(number_of_test_pages + 1, old_space->CountTotalPages()); |
// Triggering one GC will cause a lot of garbage to be discovered but |
// even spread across all allocated pages. |
heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask, |
"triggered for preparation"); |
- CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages()); |
+ CHECK_GE(number_of_test_pages + 1, old_space->CountTotalPages()); |
// Triggering subsequent GCs should cause at least half of the pages |
// to be released to the OS after at most two cycles. |
heap->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 1"); |
- CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages()); |
+ CHECK_GE(number_of_test_pages + 1, old_space->CountTotalPages()); |
heap->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 2"); |
- CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages() * 2); |
+ CHECK_GE(number_of_test_pages + 1, old_space->CountTotalPages() * 2); |
// Triggering a last-resort GC should cause all pages to be released to the |
// OS so that other processes can seize the memory. If we get a failure here |
@@ -3205,7 +3203,7 @@ TEST(ReleaseOverReservedPages) { |
// boots, but if the 20 small arrays don't fit on the first page then that's |
// an indication that it is too small. |
heap->CollectAllAvailableGarbage("triggered really hard"); |
- CHECK_EQ(1, old_pointer_space->CountTotalPages()); |
+ CHECK_EQ(1, old_space->CountTotalPages()); |
} |
@@ -4844,8 +4842,8 @@ TEST(ArrayShiftSweeping) { |
Handle<JSObject> o = |
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result)); |
- CHECK(heap->InOldPointerSpace(o->elements())); |
- CHECK(heap->InOldPointerSpace(*o)); |
+ CHECK(heap->InOldSpace(o->elements())); |
+ CHECK(heap->InOldSpace(*o)); |
Page* page = Page::FromAddress(o->elements()->address()); |
CHECK(page->parallel_sweeping() <= MemoryChunk::SWEEPING_FINALIZE || |
Marking::IsBlack(Marking::MarkBitFrom(o->elements()))); |
@@ -4958,7 +4956,7 @@ TEST(Regress388880) { |
// Allocate fixed array in old pointer space so, that object allocated |
// afterwards would end at the end of the page. |
{ |
- SimulateFullSpace(heap->old_pointer_space()); |
+ SimulateFullSpace(heap->old_space()); |
int padding_size = desired_offset - Page::kObjectStartOffset; |
int padding_array_length = |
(padding_size - FixedArray::kHeaderSize) / kPointerSize; |
@@ -5027,7 +5025,7 @@ TEST(Regress3631) { |
" weak_map.set(future_keys[i], i);" |
"}"); |
heap->incremental_marking()->set_should_hurry(true); |
- heap->CollectGarbage(OLD_POINTER_SPACE); |
+ heap->CollectGarbage(OLD_SPACE); |
} |
@@ -5044,7 +5042,7 @@ TEST(Regress442710) { |
Handle<String> name = factory->InternalizeUtf8String("testArray"); |
JSReceiver::SetProperty(global, name, array, SLOPPY).Check(); |
CompileRun("testArray[0] = 1; testArray[1] = 2; testArray.shift();"); |
- heap->CollectGarbage(OLD_POINTER_SPACE); |
+ heap->CollectGarbage(OLD_SPACE); |
} |
@@ -5106,10 +5104,10 @@ void CheckMapRetainingFor(int n) { |
} |
CHECK(!weak_cell->cleared()); |
for (int i = 0; i < n; i++) { |
- heap->CollectGarbage(OLD_POINTER_SPACE); |
+ heap->CollectGarbage(OLD_SPACE); |
} |
CHECK(!weak_cell->cleared()); |
- heap->CollectGarbage(OLD_POINTER_SPACE); |
+ heap->CollectGarbage(OLD_SPACE); |
CHECK(weak_cell->cleared()); |
} |