critical native wrapper inefficiencies

Robert Engels rengels at optionscity.com
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
return.

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 *www.optionscity.com  | LinkedIn
<https://www.linkedin.com/company/optionscity-software-inc->  |  Twitter
<https://twitter.com/optionscity>  |  YouTube
<https://www.youtube.com/user/optionscity>  |  Facebook
<https://www.facebook.com/optionscity>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20170626/83bf70a7/attachment.html>


More information about the compiler-dev mailing list