JDK-8158576 : SPARC: reduce JNI overhead for natives that don't require a safepoint
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2016-06-02
  • Updated: 2019-04-18
  • Resolved: 2017-07-17
Related Reports
Relates :  
Description
After JDK-6182113, JNI overhead is significant on Sparc, because of the register window flush in particular.  We need to investigate ways to reduce or eliminate that overhead.
Comments
This is not on our list of current priorities. If this changes please re-open this issue. Closing as WNF.
17-07-2017

Are talking general Java specified native methods, or specifically things like Unsafe than could be intrinsified? For general JNI calls the notion of "leaf" methods is far too risky.
03-06-2016

Possible software solutions I can think of: 1. Convert the native method to an intrinsic. For example, see JDK-8154122. 2. Don't use register windows. Instead, spill registers explicitly. 3. Don't use JNI. Use an alternative native interface that can distinguish between non-leaf calls requiring a safepoint and leaf calls that don't. 4. Find ways to remove register window flush from JNI path, perhaps by recognizing well-known/trusted native methods (like we recognize methods for intrinsicification), or going back to the old method of suspending threads. 5. Extend JNI (and the spec) to support leaf methods, similar to how JNI already has "critical" calls. This could be indicated with a function name prefix other than Java_, such as LEAF_.
02-06-2016