RFR(S): 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support

Volker Simonis volker.simonis at gmail.com
Fri Mar 11 08:28:01 UTC 2016


On Thu, Mar 10, 2016 at 8:22 PM, Thomas Stüfe <thomas.stuefe at gmail.com> wrote:
> Hi Volker,
>
> nice work!
> Some remarks:
>
> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/src/share/vm/utilities/globalDefinitions_visCPP.hpp.udiff.html
>
> According to
> http://stackoverflow.com/questions/3329214/is-it-possible-to-force-a-function-not-to-be-inlined
> , declspec(noinline) may work for non-member functions too, albeit
> undocumented. Would be at least worth to try.
>

Good to know. As you correctly noticed, NOINLINE hasn't been used on
Windows until now and I tried not to change the behavior with my
change. But I've put the information into the comment if somebody
wants to use it eventually.

> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/src/share/vm/utilities/stack.inline.hpp.udiff.html
>
> So, if now a platform decides to specify NOINLINE, this will change
> compilation for Stack<> even though the issue is only described as a gcc
> problem?
>

Right, but this should only apply to functions which are not
performance critical anyway. So I think that should do no harm.

> Kind Regards, Thomas
>
>
>
>
>
>
>
>
>
> On Thu, Mar 10, 2016 at 6:10 PM, Volker Simonis <volker.simonis at gmail.com>
> wrote:
>>
>> Hi,
>>
>> can I please have a review and a sponsor for the following clean-up
>> change:
>>
>> http://cr.openjdk.java.net/~simonis/webrevs/2016/8151593/
>> https://bugs.openjdk.java.net/browse/JDK-8151593
>>
>> First I only wanted to implement the INLINE macro for xlC in
>> instanceKlass.inline.hpp. But then I realized that we also define
>> NOINLINE in various other files so I decided to do it "the right way"
>> and clean up the code a little bit.
>>
>> I've now moved the definition of the INLINE/NOINLINE macros to
>> globalDefinitions_<compiler>.hpp. In the case where there is no
>> compiler-specific definition, globalDefinitions.hpp defines empty
>> defaults for the macros.
>>
>> I've also renamed INLINE to ALWAYSINLINE to match its intention more
>> clearly.
>>
>> Currently NOINLINE is really only defined on Linux. This is the same
>> behavior we had before the change. Following some more details:
>>
>> os_linux.cpp
>>
>> - removed the handling for gcc < 3 (even we at SAP don't use this anymore
>> :)
>>
>> objectMonitor.cpp, synchronizer.cpp
>>
>> - completely removed the annotation with NOINLNE which is there since
>> pre-OpenJDK times already. The comment mentions that this was required
>> to prevent build-time failures with 'older' versions of GCC. But we
>> already build without 'NOINLINE' on Linux/ppc64 since years and I've
>> also tested that it still works on Linux/x86.
>>
>> I've Build and smoke-tested on Linux/amd64 and Linux/ppc64,
>> Solaris/SPARC, MacOS X, AIX and Windows.
>>
>> Regards,
>> Volker
>
>


More information about the hotspot-dev mailing list