RFR(S): 8236992: AArch64: remove redundant load_klass in itable stub

Nick Gasson nick.gasson at arm.com
Thu Jan 16 09:00:17 UTC 2020


Bug: https://bugs.openjdk.java.net/browse/JDK-8236992
Webrev: http://cr.openjdk.java.net/~ngasson/8236992/webrev.01/index.html

The X86 implementation of VtableStubs::create_itable_stub calls
load_klass() twice on the same oop because the destination register
needs to be reused as a temporary in the intervening
lookup_interface_method(). But on AArch64 we have more registers and no
callee-saves so we can just allocate an additional temporary register
and keep the result of load_klass live across the whole function.

Also the estimate of the stub size needs to be recalculated as it was
too low before the fix for JDK-8234794 and now it's too high. The worst
case instruction size should be 12 for load_klass, 44 for
lookup_interface method with return_method=false, and 60 with
return_method=true, for a total of 116 bytes. Previously the worst case
for load_klass was 28 bytes and it was called twice, so the estimate
should have been 160. Added eight bytes headroom as per the comment.


More information about the hotspot-runtime-dev mailing list