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

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


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 

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


Best regards,
Vladimir Ivanov


More information about the hotspot-compiler-dev mailing list