RFR (M) 8233913: Remove implicit conversion from Method* to methodHandle

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Mon Nov 11 19:59:55 UTC 2019

Summary: Fix call sites to use existing THREAD local or pass down THREAD 
local for shallower callsites. Make linkResolver methods return Method* 
for caller to handleize if needed.

There are a small number of changes to several files, mostly obvious.  
Some comments on a few of the specific changes:

The comment and the methodHandle don't make sense since there'a s NSV 
there.  Method* will not be reclaimed ever, and it doesn't move.  There 
might have been a safepoint here once.

If you have a methodHandle, you don't need to do mh()->max_stack().   
The -> operator will expose the underlying Method*.

The Method* in the vframeStream is safe here because the stack frame are 
followed in case of safepoint, and will mark the Method* as live, so 
this was unnecessary.

I changed several of the TieredThresholdPolicy functions to take const 
methodHandle as a parameter to avoid unhandleizing and rehandleizing, 
and avoid Thread::current() calls.

I changed LinkResolver methods to return Method* to avoid unnecessary 
handlizing.  The handle copy is elided by most compilers but it was 
still not needed by many callers.

Tested with tier1 on all Oracle platforms, and tier 2-3 on linux-x64.

I also performance tested this with slight avg 0.5% improvement, and 
fewer instructions:

eg: PerfStartup-Noop instructions on linux-x64 (before/after)

± 262156.46
± 281141.80
p = 0.000

open webrev at http://cr.openjdk.java.net/~coleenp/2019/8233913.01/webrev
bug link https://bugs.openjdk.java.net/browse/JDK-8233913


More information about the hotspot-dev mailing list