Commit bf3691ae authored by michael_dawson's avatar michael_dawson Committed by Commit bot

Contribution of PowerPC port (continuation of 422063005) - PPC opt 2

Contribution of PowerPC port (continuation of 422063005, 817143002,
866843003, and 901083004. The bulk of the changes are to remove some
hard coded assumptions about heap page size within existing tests.
The remaining change is to use a larger heap page size for PPC linux
as this provides a performance benefit due to the larger memory page size.

	modified:   src/base/build_config.h
	modified:   src/heap/heap.cc
	modified:   test/cctest/test-alloc.cc
	modified:   test/cctest/test-constantpool.cc
	modified:   test/cctest/test-heap.cc
	modified:   test/cctest/test-spaces.cc
	modified:   test/cctest/test-weakmaps.cc
	modified:   test/cctest/test-weaksets.cc

R=danno@chromium.org, svenpanne@chromium.org

BUG=

Review URL: https://codereview.chromium.org/910333004

Cr-Commit-Position: refs/heads/master@{#26833}
parent fbb26b21
......@@ -63,7 +63,7 @@ static AllocationResult AllocateAfterFailures() {
heap->AllocateFixedArray(10000, TENURED).ToObjectChecked();
// Large object space.
static const int kLargeObjectSpaceFillerLength = 300000;
static const int kLargeObjectSpaceFillerLength = 3 * (Page::kPageSize / 10);
static const int kLargeObjectSpaceFillerSize = FixedArray::SizeFor(
kLargeObjectSpaceFillerLength);
DCHECK(kLargeObjectSpaceFillerSize > heap->old_pointer_space()->AreaSize());
......@@ -210,7 +210,7 @@ TEST(CodeRange) {
// Geometrically distributed sizes, greater than
// Page::kMaxRegularHeapObjectSize (which is greater than code page area).
// TODO(gc): instead of using 3 use some contant based on code_range_size
// kMaxHeapObjectSize.
// kMaxRegularHeapObjectSize.
size_t requested =
(Page::kMaxRegularHeapObjectSize << (Pseudorandom() % 3)) +
Pseudorandom() % 5000 + 1;
......
......@@ -284,8 +284,9 @@ TEST(ConstantPoolCompacting) {
Page* first_page = heap->old_data_space()->anchor()->next_page();
{
HandleScope scope(isolate);
int dummy_array_size = Page::kMaxRegularHeapObjectSize - 92 * KB;
Handle<HeapObject> temp =
factory->NewFixedDoubleArray(900 * KB / kDoubleSize, TENURED);
factory->NewFixedDoubleArray(dummy_array_size / kDoubleSize, TENURED);
CHECK(heap->InOldDataSpace(temp->address()));
Handle<HeapObject> heap_ptr =
factory->NewHeapNumber(5.0, IMMUTABLE, TENURED);
......
......@@ -4878,7 +4878,7 @@ TEST(ArrayShiftSweeping) {
UNINITIALIZED_TEST(PromotionQueue) {
i::FLAG_expose_gc = true;
i::FLAG_max_semi_space_size = 2;
i::FLAG_max_semi_space_size = 2 * (Page::kPageSize / MB);
v8::Isolate* isolate = v8::Isolate::New();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
{
......
......@@ -207,12 +207,13 @@ static void VerifyMemoryChunk(Isolate* isolate,
TEST(Regress3540) {
Isolate* isolate = CcTest::i_isolate();
Heap* heap = isolate->heap();
const int pageSize = Page::kPageSize;
MemoryAllocator* memory_allocator = new MemoryAllocator(isolate);
CHECK(
memory_allocator->SetUp(heap->MaxReserved(), heap->MaxExecutableSize()));
TestMemoryAllocatorScope test_allocator_scope(isolate, memory_allocator);
CodeRange* code_range = new CodeRange(isolate);
const size_t code_range_size = 4 * MB;
const size_t code_range_size = 4 * pageSize;
if (!code_range->SetUp(
code_range_size +
RoundUp(v8::base::OS::CommitPageSize() * kReservedCodeRangePages,
......@@ -222,13 +223,13 @@ TEST(Regress3540) {
}
Address address;
size_t size;
address = code_range->AllocateRawMemory(code_range_size - 2 * MB,
code_range_size - 2 * MB, &size);
address = code_range->AllocateRawMemory(
code_range_size - 2 * pageSize, code_range_size - 2 * pageSize, &size);
CHECK(address != NULL);
Address null_address;
size_t null_size;
null_address = code_range->AllocateRawMemory(
code_range_size - MB, code_range_size - MB, &null_size);
code_range_size - pageSize, code_range_size - pageSize, &null_size);
CHECK(null_address == NULL);
code_range->FreeRawMemory(address, size);
delete code_range;
......@@ -422,7 +423,9 @@ TEST(LargeObjectSpace) {
{ AllocationResult allocation = lo->AllocateRaw(lo_size, NOT_EXECUTABLE);
if (allocation.IsRetry()) break;
}
CHECK(lo->Available() < available);
// The available value is conservative such that it may report
// zero prior to heap exhaustion.
CHECK(lo->Available() < available || available == 0);
}
CHECK(!lo->IsEmpty());
......@@ -460,7 +463,7 @@ TEST(SizeOfFirstPageIsLargeEnough) {
UNINITIALIZED_TEST(NewSpaceGrowsToTargetCapacity) {
FLAG_target_semi_space_size = 2;
FLAG_target_semi_space_size = 2 * (Page::kPageSize / MB);
if (FLAG_optimize_for_size) return;
v8::Isolate* isolate = v8::Isolate::New();
......
......@@ -184,7 +184,8 @@ TEST(Regress2060a) {
// Start second old-space page so that values land on evacuation candidate.
Page* first_page = heap->old_pointer_space()->anchor()->next_page();
factory->NewFixedArray(900 * KB / kPointerSize, TENURED);
int dummy_array_size = Page::kMaxRegularHeapObjectSize - 92 * KB;
factory->NewFixedArray(dummy_array_size / kPointerSize, TENURED);
// Fill up weak map with values on an evacuation candidate.
{
......@@ -222,7 +223,8 @@ TEST(Regress2060b) {
// Start second old-space page so that keys land on evacuation candidate.
Page* first_page = heap->old_pointer_space()->anchor()->next_page();
factory->NewFixedArray(900 * KB / kPointerSize, TENURED);
int dummy_array_size = Page::kMaxRegularHeapObjectSize - 92 * KB;
factory->NewFixedArray(dummy_array_size / kPointerSize, TENURED);
// Fill up weak map with keys on an evacuation candidate.
Handle<JSObject> keys[32];
......
......@@ -184,7 +184,8 @@ TEST(WeakSet_Regress2060a) {
// Start second old-space page so that values land on evacuation candidate.
Page* first_page = heap->old_pointer_space()->anchor()->next_page();
factory->NewFixedArray(900 * KB / kPointerSize, TENURED);
int dummy_array_size = Page::kMaxRegularHeapObjectSize - 92 * KB;
factory->NewFixedArray(dummy_array_size / kPointerSize, TENURED);
// Fill up weak set with values on an evacuation candidate.
{
......@@ -222,7 +223,8 @@ TEST(WeakSet_Regress2060b) {
// Start second old-space page so that keys land on evacuation candidate.
Page* first_page = heap->old_pointer_space()->anchor()->next_page();
factory->NewFixedArray(900 * KB / kPointerSize, TENURED);
int dummy_array_size = Page::kMaxRegularHeapObjectSize - 92 * KB;
factory->NewFixedArray(dummy_array_size / kPointerSize, TENURED);
// Fill up weak set with keys on an evacuation candidate.
Handle<JSObject> keys[32];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment