JDK-8049103 : investigate whether inlining still needs to be inhibited in objectMonitor.cpp and synchronizer.cpp
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Not an Issue
  • OS: linux
  • CPU: generic
  • Submitted: 2014-07-02
  • Updated: 2019-06-20
  • Resolved: 2018-02-05
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 11
11Resolved
Related Reports
Relates :  
Relates :  
Description
The following issue came up during the code review cycle for the following:

JDK-8047104 cleanup misc issues prior to Contended Locking
                reorder and cache line bucket

Both objectMonitor.cpp and synchronizer.cpp contain:

#if defined(__GNUC__) && !defined(IA64) && !defined(PPC64)
  // Need to inhibit inlining for older versions of GCC to avoid build-time failures
  #define NOINLINE __attribute__((noinline))
#else
  #define NOINLINE
#endif

and it would be good to determine if this is still needed.


>> src/share/vm/runtime/objectMonitor.cpp
>>
>> Wondering if "Need to inhibit inlining for older versions of GCC to avoid build-time failures" is actually still relevant? Something for a later set of changes.
>
> Good question. I'll chase down the history on that one and try
> to narrow down the GCC era/version where this used to happen.
> Will probably result in a new follow up bug to propose removal
> of the inhibit inlining stuff.

Had to chase this back into the TeamWare history:

$ sgv src/share/vm/runtime/synchronizer.cpp | grep noinline
1.119
1.69.1.6          #define ATTR __attribute__((noinline))
4716 lines
No id keywords (cm7)

$ sp -r1.69.1.6 src/share/vm/runtime/synchronizer.cpp
src/share/vm/runtime/SCCS/s.synchronizer.cpp:

D 1.69.1.6 05/08/16 17:22:05 dice 150 149       00267/00163/03862
MRs:
COMMENTS:

$ sccs sccsdiff -r1.69.1.{5,6} src/share/vm/runtime/synchronizer.cpp | head
11a12,18
> #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
>

so the noinline stuff was committed (sccs delget) back on
August 16, 2005 in a delta without any bug ID. Sigh.

The first release that contains that delta is JDK1.6.0 so
here's the Linux compilers in use back then:

$ strings linux-i586/jre/lib/i386/client/libjvm.so | grep 'with gcc'
Java HotSpot(TM) Client VM (1.6.0-b105) for linux-x86, built on Nov 29 2006 01:24:38 by "java_re" with gcc 3.2.1-7a (J2SE release)

$ strings linux-amd64/jre/lib/amd64/server/libjvm.so | grep 'with gcc'
Java HotSpot(TM) 64-Bit Server VM (1.6.0-b105) for linux-amd64, built on Nov 29 2006 01:44:03 by "uucp" with gcc 3.2.2 (SuSE Linux)


In contrast, for JDK8 we used the following on Linux:

$ strings linux-i586/jre/lib/i386/client/libjvm.so | grep 'with gcc'
Java HotSpot(TM) Client VM (25.0-b70) for linux-x86 JRE (1.8.0-b132), built on Mar  4 2014 03:27:19 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)

$ strings linux-x64/jre/lib/amd64/server/libjvm.so | grep 'with gcc'
Java HotSpot(TM) 64-Bit Server VM (25.0-b70) for linux-amd64 JRE (1.8.0-b132), built on Mar  4 2014 03:07:25 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)


And in JDK9, we're using the following on Linux:

$ strings linux-i586/jre/lib/i386/client/libjvm.so | grep 'with gcc'
Java HotSpot(TM) Client VM (1.9.0-ea-b19) for linux-x86 JRE (1.9.0-ea-b19), built on Jun 19 2014 00:08:12 by "java_re" with gcc 4.8.2

$ strings linux-x64/jre/lib/amd64/server/libjvm.so | grep 'with gcc'
Java HotSpot(TM) 64-Bit Server VM (1.9.0-ea-b19) for linux-amd64 JRE (1.9.0-ea-b19), built on Jun 18 2014 23:57:36 by "java_re" with gcc 4.8.2

So I'm thinking that I need to roll this historical info into a
new bug for someone to investigate whether to remove the noinline
stuff. Agreed?

Dan

Comments
changeset: 37092:0e56e3c9d545 parent: 37074:20b25dd44cb8 user: simonis date: Fri Mar 11 16:39:38 2016 +0100 summary: 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support They went away with this changeset. Closing as NAI.
05-02-2018

These are gone. The only NOINLINE/noinline left are in allocation for NMT to get the call stacks shallower. runtime/handles.cpp:#define DEF_METADATA_HANDLE_FN_NOINLINE(name, type) \ runtime/handles.cpp:DEF_METADATA_HANDLE_FN_NOINLINE(method, Method) runtime/handles.cpp:DEF_METADATA_HANDLE_FN_NOINLINE(constantPool, ConstantPool) utilities/globalDefinitions_sparcWorks.hpp:#define NOINLINE utilities/globalDefinitions_xlc.hpp:#define NOINLINE utilities/globalDefinitions.hpp:#ifndef NOINLINE utilities/globalDefinitions.hpp:#define NOINLINE utilities/stack.inline.hpp:NOINLINE void Stack<E, F>::push_segment() utilities/globalDefinitions_gcc.hpp:#define NOINLINE __attribute__ ((noinline)) utilities/nativeCallStack.cpp: // to call os::get_native_stack. A tail call is used if _NMT_NOINLINE_ is not defined utilities/nativeCallStack.cpp:#define TAIL_CALL (!defined(_NMT_NOINLINE_) && !defined(WINDOWS) && defined(_LP64)) utilities/nativeCallStack.cpp:#if (defined(_NMT_NOINLINE_) && defined(BSD) && defined(_LP64)) utilities/globalDefinitions_visCPP.hpp:#define NOINLINE __declspec(noinline) memory/allocation.hpp: NOINLINE void* operator new(size_t size, const NativeCallStack& stack) throw(); memory/allocation.hpp: NOINLINE void* operator new(size_t size) throw(); memory/allocation.hpp: NOINLINE void* operator new (size_t size, const std::nothrow_t& nothrow_constant, memory/allocation.hpp: NOINLINE void* operator new (size_t size, const std::nothrow_t& nothrow_constant) memory/allocation.hpp: NOINLINE void* operator new [](size_t size, const NativeCallStack& stack) throw(); memory/allocation.hpp: NOINLINE void* operator new [](size_t size) throw(); memory/allocation.hpp: NOINLINE void* operator new [](size_t size, const std::nothrow_t& nothrow_constant, memory/allocation.hpp: NOINLINE void* operator new [](size_t size, const std::nothrow_t& nothrow_constant) memory/arena.cpp: NOINLINE void* allocate(size_t bytes, AllocFailType alloc_failmode) {
05-02-2018

Should be looked at in 11 if we are going to allocate resources for more "monitors" work; definitely don't need this for 10.
05-04-2017