Are Java native methods inlined ?

John Rose john.r.rose at
Wed Apr 27 21:13:15 UTC 2016

On Apr 27, 2016, at 3:33 AM, Andrew Haley <aph at> wrote:
> 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.

In Project Panama we are experimenting with inlining wrapper logic
for native calls.  But the 20-year practice in HotSpot is (as you say)
to roll a separate, non-inlined wrapper for each JNI method.  The JIT
per se does not create this wrapper, but rather this logic:

— John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the hotspot-compiler-dev mailing list