critical native wrapper inefficiencies

Robert Engels rengels at
Mon Jun 26 17:56:30 UTC 2017

In the sharedRuntime_x86_64.cpp the generate_native_wrapper is somewhat
inefficient for a very important case. (I assume this is also the case for
other platforms).

The 'critical native' allows for much more efficient JNI calls, but often
these don't need to pass any java arrays - that is, all parameters and
return values use handles (simple ints?) in the native code, or pointers to
a 'direct buffer'.

The generate_native_wrapper() ALWAYS adds to the code to ask the GC_Locker
if a gc is needed when calling a native critical method.

It should only be adding this check if the number of 'java array arguments'
is greater than 0. Similarly, it should be the same after the JNI method

This will make many JNI calls much more efficient.


*Robert Engels*

OptionsCity Software
150 S. Wacker Dr., Suite 2300
Chicago, IL 60606

O. +1 (312) 605-4500 | F. +1 (312) 635-1751

*Connect with OptionsCity at *  | LinkedIn
<>  |  Twitter
<>  |  YouTube
<>  |  Facebook
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list