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

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

Issue 1027463002: Revert "Merge old data and pointer space." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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-dictionary.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 ca3ec7b07ab416f3385702ed480b4f08add3de0f..cd012f6bfa91b942771008077c02715ef8535ea7 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_SPACE);
+ heap->CollectGarbage(OLD_POINTER_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_SPACE);
+ heap->CollectGarbage(OLD_POINTER_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_SPACE and NEW_SPACE
+ // Allocate a JS array to OLD_POINTER_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_space_top = heap->old_space()->top();
+ Address old_pointer_space_top = heap->old_pointer_space()->top();
AlwaysAllocateScope aa_scope(isolate);
Object* clone_obj = heap->CopyJSObject(jsobject).ToObjectChecked();
JSObject* clone = JSObject::cast(clone_obj);
- if (clone->address() != old_space_top) {
+ if (clone->address() != old_pointer_space_top) {
// Alas, got allocated from free list, we cannot do checks.
return;
}
- CHECK(heap->old_space()->Contains(clone->address()));
+ CHECK(heap->old_pointer_space()->Contains(clone->address()));
}
@@ -2138,7 +2138,7 @@ TEST(InstanceOfStubWriteBarrier) {
}
CcTest::heap()->incremental_marking()->set_should_hurry(true);
- CcTest::heap()->CollectGarbage(OLD_SPACE);
+ CcTest::heap()->CollectGarbage(OLD_POINTER_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_space();
+ PagedSpace* space = CcTest::heap()->old_pointer_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_space());
+ SimulateFullSpace(CcTest::heap()->old_pointer_space());
IncrementalMarking* marking = CcTest::heap()->incremental_marking();
marking->Abort();
marking->Start();
@@ -2422,11 +2422,11 @@ TEST(OptimizedPretenuringAllocationFolding) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- 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()));
+ 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()));
}
@@ -2465,8 +2465,8 @@ TEST(OptimizedPretenuringObjectArrayLiterals) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- CHECK(CcTest::heap()->InOldSpace(o->elements()));
- CHECK(CcTest::heap()->InOldSpace(*o));
+ CHECK(CcTest::heap()->InOldPointerSpace(o->elements()));
+ CHECK(CcTest::heap()->InOldPointerSpace(*o));
}
@@ -2506,25 +2506,27 @@ TEST(OptimizedPretenuringMixedInObjectProperties) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- CHECK(CcTest::heap()->InOldSpace(*o));
+ CHECK(CcTest::heap()->InOldPointerSpace(*o));
FieldIndex idx1 = FieldIndex::ForPropertyIndex(o->map(), 0);
FieldIndex idx2 = FieldIndex::ForPropertyIndex(o->map(), 1);
- CHECK(CcTest::heap()->InOldSpace(o->RawFastPropertyAt(idx1)));
+ CHECK(CcTest::heap()->InOldPointerSpace(o->RawFastPropertyAt(idx1)));
if (!o->IsUnboxedDoubleField(idx2)) {
- CHECK(CcTest::heap()->InOldSpace(o->RawFastPropertyAt(idx2)));
+ CHECK(CcTest::heap()->InOldDataSpace(o->RawFastPropertyAt(idx2)));
} else {
CHECK_EQ(1.1, o->RawFastDoublePropertyAt(idx2));
}
JSObject* inner_object =
reinterpret_cast<JSObject*>(o->RawFastPropertyAt(idx1));
- CHECK(CcTest::heap()->InOldSpace(inner_object));
+ CHECK(CcTest::heap()->InOldPointerSpace(inner_object));
if (!inner_object->IsUnboxedDoubleField(idx1)) {
- CHECK(CcTest::heap()->InOldSpace(inner_object->RawFastPropertyAt(idx1)));
+ CHECK(
+ CcTest::heap()->InOldDataSpace(inner_object->RawFastPropertyAt(idx1)));
} else {
CHECK_EQ(2.2, inner_object->RawFastDoublePropertyAt(idx1));
}
- CHECK(CcTest::heap()->InOldSpace(inner_object->RawFastPropertyAt(idx2)));
+ CHECK(
+ CcTest::heap()->InOldPointerSpace(inner_object->RawFastPropertyAt(idx2)));
}
@@ -2563,8 +2565,8 @@ TEST(OptimizedPretenuringDoubleArrayProperties) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- CHECK(CcTest::heap()->InOldSpace(*o));
- CHECK(CcTest::heap()->InOldSpace(o->properties()));
+ CHECK(CcTest::heap()->InOldPointerSpace(*o));
+ CHECK(CcTest::heap()->InOldDataSpace(o->properties()));
}
@@ -2603,8 +2605,8 @@ TEST(OptimizedPretenuringdoubleArrayLiterals) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- CHECK(CcTest::heap()->InOldSpace(o->elements()));
- CHECK(CcTest::heap()->InOldSpace(*o));
+ CHECK(CcTest::heap()->InOldDataSpace(o->elements()));
+ CHECK(CcTest::heap()->InOldPointerSpace(*o));
}
@@ -2648,11 +2650,11 @@ TEST(OptimizedPretenuringNestedMixedArrayLiterals) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- 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()));
+ 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()));
}
@@ -2697,11 +2699,11 @@ TEST(OptimizedPretenuringNestedObjectLiterals) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- 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()));
+ 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()));
}
@@ -2748,11 +2750,11 @@ TEST(OptimizedPretenuringNestedDoubleLiterals) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- 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()));
+ 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()));
}
@@ -2805,7 +2807,7 @@ TEST(OptimizedPretenuringConstructorCalls) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- CHECK(CcTest::heap()->InOldSpace(*o));
+ CHECK(CcTest::heap()->InOldPointerSpace(*o));
}
@@ -2852,7 +2854,7 @@ TEST(OptimizedPretenuringCallNew) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
- CHECK(CcTest::heap()->InOldSpace(*o));
+ CHECK(CcTest::heap()->InOldPointerSpace(*o));
}
@@ -3037,7 +3039,7 @@ TEST(TransitionArrayShrinksDuringAllocToOnePropertyFound) {
root = GetByName("root");
AddPropertyTo(0, root, "prop9");
- CcTest::i_isolate()->heap()->CollectGarbage(OLD_SPACE);
+ CcTest::i_isolate()->heap()->CollectGarbage(OLD_POINTER_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 +3177,27 @@ TEST(ReleaseOverReservedPages) {
static const int number_of_test_pages = 20;
// Prepare many pages with low live-bytes count.
- PagedSpace* old_space = heap->old_space();
- CHECK_EQ(1, old_space->CountTotalPages());
+ PagedSpace* old_pointer_space = heap->old_pointer_space();
+ CHECK_EQ(1, old_pointer_space->CountTotalPages());
for (int i = 0; i < number_of_test_pages; i++) {
AlwaysAllocateScope always_allocate(isolate);
- SimulateFullSpace(old_space);
+ SimulateFullSpace(old_pointer_space);
factory->NewFixedArray(1, TENURED);
}
- CHECK_EQ(number_of_test_pages + 1, old_space->CountTotalPages());
+ CHECK_EQ(number_of_test_pages + 1, old_pointer_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_space->CountTotalPages());
+ CHECK_GE(number_of_test_pages + 1, old_pointer_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_space->CountTotalPages());
+ CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages());
heap->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 2");
- CHECK_GE(number_of_test_pages + 1, old_space->CountTotalPages() * 2);
+ CHECK_GE(number_of_test_pages + 1, old_pointer_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 +3207,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_space->CountTotalPages());
+ CHECK_EQ(1, old_pointer_space->CountTotalPages());
}
@@ -4845,8 +4847,8 @@ TEST(ArrayShiftSweeping) {
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result));
- CHECK(heap->InOldSpace(o->elements()));
- CHECK(heap->InOldSpace(*o));
+ CHECK(heap->InOldPointerSpace(o->elements()));
+ CHECK(heap->InOldPointerSpace(*o));
Page* page = Page::FromAddress(o->elements()->address());
CHECK(page->parallel_sweeping() <= MemoryChunk::SWEEPING_FINALIZE ||
Marking::IsBlack(Marking::MarkBitFrom(o->elements())));
@@ -4959,7 +4961,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_space());
+ SimulateFullSpace(heap->old_pointer_space());
int padding_size = desired_offset - Page::kObjectStartOffset;
int padding_array_length =
(padding_size - FixedArray::kHeaderSize) / kPointerSize;
@@ -5028,7 +5030,7 @@ TEST(Regress3631) {
" weak_map.set(future_keys[i], i);"
"}");
heap->incremental_marking()->set_should_hurry(true);
- heap->CollectGarbage(OLD_SPACE);
+ heap->CollectGarbage(OLD_POINTER_SPACE);
}
@@ -5045,7 +5047,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_SPACE);
+ heap->CollectGarbage(OLD_POINTER_SPACE);
}
@@ -5078,10 +5080,10 @@ void CheckMapRetainingFor(int n) {
}
CHECK(!weak_cell->cleared());
for (int i = 0; i < n; i++) {
- heap->CollectGarbage(OLD_SPACE);
+ heap->CollectGarbage(OLD_POINTER_SPACE);
}
CHECK(!weak_cell->cleared());
- heap->CollectGarbage(OLD_SPACE);
+ heap->CollectGarbage(OLD_POINTER_SPACE);
CHECK(weak_cell->cleared());
}
« no previous file with comments | « test/cctest/test-dictionary.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698