How to get rid of MethodHandle::linkTo* call when target method is known but not inlined?

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Feb 11 23:37:22 UTC 2015


Hi,

I'm looking at JDK-8072008 [1]. The idea is to get rid of linkTo* call 
when MemberName is a compile-time constant, but target method isn't 
inlined. Direct call to target method is issued instead. It should help 
recursive calls, for example.

The problem is that compiled call sites start in unlinked state and 
runtime lacks information to patch them with a correct method (what it 
sees during fixup is just a linkTo* call).

The only way I see how to get call site linking working is to attach 
pre-resolved target method (Method*) to the nmethod and make fixup logic 
aware of it, so it can skip bytecode inspection step (in 
SharedRuntime::find_callee_info()).

Do you see any problems with such approach?
Any other ideas how to fix original problem?

Thanks!

Best regards,
Vladimir Ivanov

[1] https://bugs.openjdk.java.net/browse/JDK-8072008


More information about the hotspot-compiler-dev mailing list