diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index 8eb2000359c..b90b5862ee5 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -1560,11 +1560,7 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass, } #ifndef PRODUCT - mov(rscratch2, (address)&SharedRuntime::_partial_subtype_ctr); - Address pst_counter_addr(rscratch2); - ldr(rscratch1, pst_counter_addr); - add(rscratch1, rscratch1, 1); - str(rscratch1, pst_counter_addr); + incrementw(ExternalAddress((address)&SharedRuntime::_partial_subtype_ctr)); #endif //PRODUCT // We will consult the secondary-super array. diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index 29b95fdb2dd..8d207b3f665 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -86,10 +86,7 @@ class StubGenerator: public StubCodeGenerator { #define inc_counter_np(counter) ((void)0) #else void inc_counter_np_(uint& counter) { - __ lea(rscratch2, ExternalAddress((address)&counter)); - __ ldrw(rscratch1, Address(rscratch2)); - __ addw(rscratch1, rscratch1, 1); - __ strw(rscratch1, Address(rscratch2)); + __ incrementw(ExternalAddress((address)&counter)); } #define inc_counter_np(counter) \ BLOCK_COMMENT("inc_counter " #counter); \