JDK-8151593 : Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-03-10
  • Updated: 2016-04-21
  • Resolved: 2016-03-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b115Fixed
Related Reports
Relates :  
Relates :  
Description
CR 8075955: "Replace the macro based implementation of oop_oop_iterate with a template based solution" changed src/share/vm/oops/instanceKlass.inline.hpp and replaced macro based oop iteration by templates.

For performance reason, the change (and a follow up change for Oracle Studio) introduced forcing of inlining for some places in src/share/vm/oops/instanceKlass.inline.hpp, see:

http://hg.openjdk.java.net/jdk9/dev/hotspot/file/797e6aac6d53/src/share/vm/oops/instanceKlass.inline.hpp

....
// The iteration over the oops in objects is a hot path in the GC code.
// By force inlining the following functions, we get similar GC performance
// as the previous macro based implementation.
#ifdef TARGET_COMPILER_visCPP
#define INLINE __forceinline
#elif defined(TARGET_COMPILER_sparcWorks)
#define INLINE __attribute__((always_inline))
#else
#define INLINE inline
#endif
....

We can do this on AIX as well, as xlC also supports the 'always_inline' compiler attribute. See:

http://www.ibm.com/support/knowledgecenter/SSGH2K_12.1.0/com.ibm.xlc121.aix.doc/language_ref/function_attributes.html?lang=en
Comments
While working on this I noticed that there also is a NOINLINE macro which is defined and used in several different places. I think the right solution is to move the defintion of both INLINE/NOINLINe macros to the corresponding globalDefinitions_<compiler>.hpp files. Also some of the usages which predate GCC 3 can be removed.
10-03-2016