Reviewers: danno, Sven Panne,

Message:
Some minor changes to support compiling on AIX with gcc 4.8.3

Description:
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

[email protected], [email protected]

BUG=

Please review this at https://codereview.chromium.org/1013833002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+13, -3 lines):
  M build/toolchain.gypi
  M src/heap/heap.cc
  M src/heap/mark-compact.cc
  M test/cctest/cctest.gyp


Index: build/toolchain.gypi
diff --git a/build/toolchain.gypi b/build/toolchain.gypi
index b8c73177853fa4ac988b8394dbfc633b272d557f..f1f46c89c71830a0d27e8c72bc80db26b849269e 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': {
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 6ce23da02908f33323bd8ce6a7b6b1ee4c7e319f..6f2be66b411e20cf324d5ec590168e468e234414 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -2902,7 +2902,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);
@@ -4478,7 +4478,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);
@@ -4494,7 +4494,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;
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index cbdfadc2b5341161e2617021fb38b7ccb68b8276..cdfd6503e78f07b0cdc3a6103497fe48d6a79fba 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2868,12 +2868,14 @@ 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<uintptr_t>(heap_obj->address()) >= kBoundary) {
       CheckLayoutDescriptorAndDie(heap, slot);
     }
 #endif
+#endif
     MapWord map_word = heap_obj->map_word();
     if (map_word.IsForwardingAddress()) {
       DCHECK(heap->InFromSpace(heap_obj) ||
Index: test/cctest/cctest.gyp
diff --git a/test/cctest/cctest.gyp b/test/cctest/cctest.gyp
index e78d0b70d5ff44b38813334ca72e0c2be96d5640..3f7d56aa431a8f1d998cd568b61d91e3903d6da7 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.


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to