# HG changeset patch # User goetz # Date 1373055467 -7200 # Node ID 6850aed093cd15516c1d3ef49401261b85c57611 # Parent 48b178ff07b689a761363189db7faea207132084 8019973: PPC64 (part 11): Fix IA64 preprocessor conditionals on AIX. Summary: On AIX 7.1 systemcfg.h defines IA64 unconditionally, so test for !AIX where IA64 is used. Clean up old gcc bug workaround (ATTR) and includes in forte.cpp. diff --git a/src/share/vm/opto/generateOptoStub.cpp b/src/share/vm/opto/generateOptoStub.cpp --- a/src/share/vm/opto/generateOptoStub.cpp +++ b/src/share/vm/opto/generateOptoStub.cpp @@ -214,7 +214,7 @@ #if defined(SPARC) store_to_memory(NULL, adr_flags, intcon(0), T_INT, NoAlias); #endif /* defined(SPARC) */ -#ifdef IA64 +#if (defined(IA64) && !defined(AIX)) Node* adr_last_Java_fp = basic_plus_adr(top(), thread, in_bytes(JavaThread::last_Java_fp_offset())); if( os::is_MP() ) insert_mem_bar(Op_MemBarRelease); store_to_memory(NULL, adr_last_Java_fp, null(), T_ADDRESS, NoAlias); diff --git a/src/share/vm/opto/output.cpp b/src/share/vm/opto/output.cpp --- a/src/share/vm/opto/output.cpp +++ b/src/share/vm/opto/output.cpp @@ -1065,7 +1065,7 @@ // Compute prolog code size _method_size = 0; _frame_slots = OptoReg::reg2stack(_matcher->_old_SP)+_regalloc->_framesize; -#ifdef IA64 +#if defined(IA64) && !defined(AIX) if (save_argument_registers()) { // 4815101: this is a stub with implicit and unknown precision fp args. // The usual spill mechanism can only generate stfd's in this case, which diff --git a/src/share/vm/prims/forte.cpp b/src/share/vm/prims/forte.cpp --- a/src/share/vm/prims/forte.cpp +++ b/src/share/vm/prims/forte.cpp @@ -22,6 +22,10 @@ * */ +#include "utilities/macros.hpp" + +#if defined(SOLARIS) || (defined(LINUX) && defined(X86)) + #include "precompiled.hpp" #include "code/debugInfoRec.hpp" #include "code/pcDesc.hpp" @@ -69,9 +73,6 @@ // Native interfaces for use by Forte tools. - -#ifndef IA64 - class vframeStreamForte : public vframeStreamCommon { public: // constructor that starts with sender of frame fr (top_frame) @@ -595,8 +596,6 @@ } } - -#ifndef _WINDOWS // Support for the Forte(TM) Peformance Tools collector. // // The method prototype is derived from libcollector.h. For more @@ -605,11 +604,6 @@ // Method to let libcollector know about a dynamically loaded function. // Because it is weakly bound, the calls become NOP's when the library // isn't present. -#ifdef __APPLE__ -// XXXDARWIN: Link errors occur even when __attribute__((weak_import)) -// is added -#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0) -#else void collector_func_load(char* name, void* null_argument_1, void* null_argument_2, @@ -620,20 +614,15 @@ #pragma weak collector_func_load #define collector_func_load(x0,x1,x2,x3,x4,x5,x6) \ ( collector_func_load ? collector_func_load(x0,x1,x2,x3,x4,x5,x6),(void)0 : (void)0 ) -#endif // __APPLE__ -#endif // !_WINDOWS } // end extern "C" -#endif // !IA64 void Forte::register_stub(const char* name, address start, address end) { -#if !defined(_WINDOWS) && !defined(IA64) assert(pointer_delta(end, start, sizeof(jbyte)) < INT_MAX, "Code size exceeds maximum range"); collector_func_load((char*)name, NULL, NULL, start, pointer_delta(end, start, sizeof(jbyte)), 0, NULL); -#endif // !_WINDOWS && !IA64 } #else // INCLUDE_JVMTI @@ -644,3 +633,5 @@ } } #endif // INCLUDE_JVMTI + +#endif // SOLARIS || (LINUX && X86) diff --git a/src/share/vm/prims/forte.hpp b/src/share/vm/prims/forte.hpp --- a/src/share/vm/prims/forte.hpp +++ b/src/share/vm/prims/forte.hpp @@ -25,13 +25,19 @@ #ifndef SHARE_VM_PRIMS_FORTE_HPP #define SHARE_VM_PRIMS_FORTE_HPP +#include "utilities/macros.hpp" + // Interface to Forte support. class Forte : AllStatic { public: - static void register_stub(const char* name, address start, address end) +#if defined(SOLARIS) || (defined(LINUX) && defined(X86)) + static void register_stub(const char* name, address start, address end) NOT_JVMTI_RETURN; // register internal VM stub +#else + static void register_stub(const char* name, address start, address end) {} +#endif }; #endif // SHARE_VM_PRIMS_FORTE_HPP diff --git a/src/share/vm/runtime/objectMonitor.cpp b/src/share/vm/runtime/objectMonitor.cpp --- a/src/share/vm/runtime/objectMonitor.cpp +++ b/src/share/vm/runtime/objectMonitor.cpp @@ -54,14 +54,6 @@ # include "os_bsd.inline.hpp" #endif -#if defined(__GNUC__) && !defined(IA64) - // Need to inhibit inlining for older versions of GCC to avoid build-time failures - #define ATTR __attribute__((noinline)) -#else - #define ATTR -#endif - - #ifdef DTRACE_ENABLED // Only bother with this argument setup if dtrace is available @@ -313,7 +305,7 @@ } } -void ATTR ObjectMonitor::enter(TRAPS) { +void ObjectMonitor::enter(TRAPS) { // The following code is ordered to check the most common cases first // and to reduce RTS->RTO cache line upgrades on SPARC and IA32 processors. Thread * const Self = THREAD ; @@ -476,7 +468,7 @@ } } -void ATTR ObjectMonitor::EnterI (TRAPS) { +void ObjectMonitor::EnterI (TRAPS) { Thread * Self = THREAD ; assert (Self->is_Java_thread(), "invariant") ; assert (((JavaThread *) Self)->thread_state() == _thread_blocked , "invariant") ; @@ -725,7 +717,7 @@ // Knob_Reset and Knob_SpinAfterFutile support and restructuring the // loop accordingly. -void ATTR ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) { +void ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) { assert (Self != NULL , "invariant") ; assert (SelfNode != NULL , "invariant") ; assert (SelfNode->_thread == Self , "invariant") ; @@ -930,7 +922,7 @@ // Both impinge on OS scalability. Given that, at most one thread parked on // a monitor will use a timer. -void ATTR ObjectMonitor::exit(bool not_suspended, TRAPS) { +void ObjectMonitor::exit(bool not_suspended, TRAPS) { Thread * Self = THREAD ; if (THREAD != _owner) { if (THREAD->is_lock_owned((address) _owner)) { diff --git a/src/share/vm/runtime/os.cpp b/src/share/vm/runtime/os.cpp --- a/src/share/vm/runtime/os.cpp +++ b/src/share/vm/runtime/os.cpp @@ -1020,7 +1020,7 @@ // if C stack is walkable beyond current frame. The check for fp() is not // necessary on Sparc, but it's harmless. bool os::is_first_C_frame(frame* fr) { -#if defined(IA64) && !defined(_WIN32) +#if (defined(IA64) && !defined(AIX)) && !defined(_WIN32) // On IA64 we have to check if the callers bsp is still valid // (i.e. within the register stack bounds). // Notice: this only works for threads created by the VM and only if diff --git a/src/share/vm/runtime/synchronizer.cpp b/src/share/vm/runtime/synchronizer.cpp --- a/src/share/vm/runtime/synchronizer.cpp +++ b/src/share/vm/runtime/synchronizer.cpp @@ -53,13 +53,6 @@ # include "os_bsd.inline.hpp" #endif -#if defined(__GNUC__) - // Need to inhibit inlining for older versions of GCC to avoid build-time failures - #define ATTR __attribute__((noinline)) -#else - #define ATTR -#endif - // The "core" versions of monitor enter and exit reside in this file. // The interpreter and compilers contain specialized transliterated // variants of the enter-exit fast-path operations. See i486.ad fast_lock(), @@ -941,7 +934,7 @@ assert(freetally == Self->omFreeCount, "free count off"); } */ -ObjectMonitor * ATTR ObjectSynchronizer::omAlloc (Thread * Self) { +ObjectMonitor * ObjectSynchronizer::omAlloc (Thread * Self) { // A large MAXPRIVATE value reduces both list lock contention // and list coherency traffic, but also tends to increase the // number of objectMonitors in circulation as well as the STW @@ -1189,7 +1182,7 @@ // multiple locks occupy the same $ line. Padding might be appropriate. -ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) { +ObjectMonitor * ObjectSynchronizer::inflate (Thread * Self, oop object) { // Inflate mutates the heap ... // Relaxing assertion for bug 6320749. assert (Universe::verify_in_progress() || diff --git a/src/share/vm/utilities/macros.hpp b/src/share/vm/utilities/macros.hpp --- a/src/share/vm/utilities/macros.hpp +++ b/src/share/vm/utilities/macros.hpp @@ -320,7 +320,11 @@ #define NOT_IA32(code) code #endif -#ifdef IA64 +// This is a REALLY BIG HACK, but on AIX unconditionally defines IA64. +// At least on AIX 7.1 this is a real problem because 'systemcfg.h' is indirectly included +// by 'pthread.h' and other common system headers. + +#if defined(IA64) && !defined(AIX) #define IA64_ONLY(code) code #define NOT_IA64(code) #else