RFR: 8219006:AArch64: Register corruption in slow subtype check

Andrew Haley aph at redhat.com
Thu Feb 14 18:36:48 UTC 2019


Thanks to Martin Doerr for finding and analaysing this one.

StubRoutines::generic_arraycopy (debug build) incorrectly uses
rscratch2.

The convention in AArch64 HotSpot is that rscratch1 and rscratch2 are
scratch in all assembler macros. Any caller must therefore not expect
these scratch registers to be preserved across macros. In this case,
the caller is the generic_arraycopy stub, and this stub is called
using the native calling convention, so we don't need to use
rscratch2. We have many spare registers to choose from, and I have
chosen to use the first free argument register.

Although the bug is present in all AArch64 versions of HotSpot, it
only affects debug builds because rscratch2 is only used inside code
guarded by #ifndef PRODUCT. So, I'm not thinking there's any need for
a backport.

http://cr.openjdk.java.net/~aph/8219006/

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-dev mailing list