8202186: AArch64: Debug build VM crashes with PrintC1Statistics option
Reviewed-by: aph
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp Wed May 02 16:43:56 2018 -0700
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp Sat Apr 28 17:33:44 2018 +0800
@@ -1951,6 +1951,11 @@
void MacroAssembler::decrementw(Address dst, int value)
{
assert(!dst.uses(rscratch1), "invalid dst for address decrement");
+ if (dst.getMode() == Address::literal) {
+ assert(abs(value) < (1 << 12), "invalid value and address mode combination");
+ lea(rscratch2, dst);
+ dst = Address(rscratch2);
+ }
ldrw(rscratch1, dst);
decrementw(rscratch1, value);
strw(rscratch1, dst);
@@ -1959,6 +1964,11 @@
void MacroAssembler::decrement(Address dst, int value)
{
assert(!dst.uses(rscratch1), "invalid address for decrement");
+ if (dst.getMode() == Address::literal) {
+ assert(abs(value) < (1 << 12), "invalid value and address mode combination");
+ lea(rscratch2, dst);
+ dst = Address(rscratch2);
+ }
ldr(rscratch1, dst);
decrement(rscratch1, value);
str(rscratch1, dst);
@@ -1991,6 +2001,11 @@
void MacroAssembler::incrementw(Address dst, int value)
{
assert(!dst.uses(rscratch1), "invalid dst for address increment");
+ if (dst.getMode() == Address::literal) {
+ assert(abs(value) < (1 << 12), "invalid value and address mode combination");
+ lea(rscratch2, dst);
+ dst = Address(rscratch2);
+ }
ldrw(rscratch1, dst);
incrementw(rscratch1, value);
strw(rscratch1, dst);
@@ -1999,6 +2014,11 @@
void MacroAssembler::increment(Address dst, int value)
{
assert(!dst.uses(rscratch1), "invalid dst for address increment");
+ if (dst.getMode() == Address::literal) {
+ assert(abs(value) < (1 << 12), "invalid value and address mode combination");
+ lea(rscratch2, dst);
+ dst = Address(rscratch2);
+ }
ldr(rscratch1, dst);
increment(rscratch1, value);
str(rscratch1, dst);