From 8685219066d49995219328d39bbff9ea05f6a60c Mon Sep 17 00:00:00 2001 From: michael_dawson Date: Wed, 18 Mar 2015 01:43:21 -0700 Subject: [PATCH] PPC: Changes to allow AIX to compile with gcc 4.8.3 We were able to remove most of our changes needed to compile on AIX with an earlier compiler level. These changes are the remaining ones. The changes in heap/heap.cc are needed because otherwise the compiler complains that result is potentially used before it is initialized. The changes in heap/mark-compact.cc are required because AIX supports the full 64 bit address range so the check being guarded is invalid. The changes in build/toolchain.gypi and test/cctest/cctest/gyp are aix only and are adjust the compile/link options to allow the AIX build to succeed. modified: build/toolchain.gypi modified: src/heap/heap.cc modified: src/heap/mark-compact.cc modified: test/cctest/cctest.gyp R=danno@chromium.org, svenpanne@chromium.org BUG= Review URL: https://codereview.chromium.org/1013833002 Cr-Commit-Position: refs/heads/master@{#27255} --- build/toolchain.gypi | 5 +++++ src/heap/heap.cc | 6 +++--- src/heap/mark-compact.cc | 2 ++ test/cctest/cctest.gyp | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build/toolchain.gypi b/build/toolchain.gypi index b8c7317785..f1f46c89c7 100644 --- a/build/toolchain.gypi +++ b/build/toolchain.gypi @@ -1144,6 +1144,11 @@ }], ['OS=="aix"', { 'ldflags': [ '-Wl,-bbigtoc' ], + 'conditions': [ + ['v8_target_arch=="ppc64"', { + 'cflags': [ '-maix64 -mcmodel=large' ], + }], + ], }], ['OS=="android"', { 'variables': { diff --git a/src/heap/heap.cc b/src/heap/heap.cc index 1c11163c75..bb1bc43d1b 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc @@ -2899,7 +2899,7 @@ AllocationResult Heap::AllocatePropertyCell() { AllocationResult Heap::AllocateWeakCell(HeapObject* value) { int size = WeakCell::kSize; STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize); - HeapObject* result; + HeapObject* result = NULL; { AllocationResult allocation = AllocateRaw(size, OLD_POINTER_SPACE, OLD_POINTER_SPACE); @@ -4474,7 +4474,7 @@ AllocationResult Heap::AllocateExtendedConstantPoolArray( AllocationResult Heap::AllocateEmptyConstantPoolArray() { ConstantPoolArray::NumberOfEntries small(0, 0, 0, 0); int size = ConstantPoolArray::SizeFor(small); - HeapObject* result; + HeapObject* result = NULL; { AllocationResult allocation = AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE); @@ -4490,7 +4490,7 @@ AllocationResult Heap::AllocateSymbol() { // Statically ensure that it is safe to allocate symbols in paged spaces. STATIC_ASSERT(Symbol::kSize <= Page::kMaxRegularHeapObjectSize); - HeapObject* result; + HeapObject* result = NULL; AllocationResult allocation = AllocateRaw(Symbol::kSize, OLD_POINTER_SPACE, OLD_POINTER_SPACE); if (!allocation.To(&result)) return allocation; diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc index f0483c9561..c48a95429f 100644 --- a/src/heap/mark-compact.cc +++ b/src/heap/mark-compact.cc @@ -2877,11 +2877,13 @@ class PointersUpdatingVisitor : public ObjectVisitor { // TODO(ishell): remove, once crbug/454297 is caught. #if V8_TARGET_ARCH_64_BIT +#ifndef V8_OS_AIX // no point checking on AIX as full 64 range is supported const uintptr_t kBoundary = V8_UINT64_C(1) << 48; STATIC_ASSERT(kBoundary > 0); if (reinterpret_cast(heap_obj->address()) >= kBoundary) { CheckLayoutDescriptorAndDie(heap, slot); } +#endif #endif MapWord map_word = heap_obj->map_word(); if (map_word.IsForwardingAddress()) { diff --git a/test/cctest/cctest.gyp b/test/cctest/cctest.gyp index e78d0b70d5..3f7d56aa43 100644 --- a/test/cctest/cctest.gyp +++ b/test/cctest/cctest.gyp @@ -272,6 +272,9 @@ }, }, }], + ['OS=="aix"', { + 'ldflags': [ '-Wl,-bbigtoc' ], + }], ['component=="shared_library"', { # cctest can't be built against a shared library, so we need to # depend on the underlying static target in that case.