Are Java native methods inlined ?

Nassim HALLI nassim.halli at aselta.com
Wed Apr 27 17:17:41 UTC 2016


Hi Andrew,

Thanks for the clarification.

Nassim.

Le 27/04/2016 12:33, Andrew Haley a écrit :
> On 27/04/16 10:12, Nassim Halli wrote:
>
>> Just a simple question : are Java native methods inlined ?
> Not exactly.
>
>> By "native methods" I mean the interface between the Java caller and
>> the targeted native JNI function in the dl (for which the
>> JIT-compiled code can be observed using *+PrintNativeNMethods)*.
>>
>> I ask this question since I don't observe inlining with Java 8 and I
>> heard it was. Although I understand that it could not necessarily
>> lead to great improvements it's just for a clarification.
> The glue code between Java and native code is not inlined into its
> caller but it is generated by the JIT compiler.  Like every
> optimization in HotSpot, this is only done for hot code.  If you run
> something like Netbeans you'll see a lot of native nmethods generated.
>
> Andrew.



More information about the hotspot-compiler-dev mailing list