8153172: aarch64: hotspot crashes after the 8.1 LSE patch is merged
Summary: Fix scratch register usage in C1 atomic_op to avoid unpredictable instruction
Reviewed-by: aph
Contributed-by: felix.yang@linaro.org
--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp Thu Mar 31 09:26:13 2016 +0200
+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp Thu Mar 31 12:00:32 2016 +0000
@@ -3134,10 +3134,10 @@
Register obj = as_reg(data);
Register dst = as_reg(dest);
if (is_oop && UseCompressedOops) {
- __ encode_heap_oop(rscratch1, obj);
- obj = rscratch1;
+ __ encode_heap_oop(rscratch2, obj);
+ obj = rscratch2;
}
- assert_different_registers(obj, addr.base(), tmp, rscratch2, dst);
+ assert_different_registers(obj, addr.base(), tmp, rscratch1, dst);
__ lea(tmp, addr);
(_masm->*xchg)(dst, obj, tmp);
if (is_oop && UseCompressedOops) {