# HG changeset patch # User aph # Date 1443546097 0 # Node ID c8f3d95c66bc44ba3108bbdb64a7fdd1481ec764 # Parent 8409d7fe20cc15519aa3a4c3eaac9a32ada7a300 8138575: Improve generated code for profile counters Reviewed-by: kvn diff -r 8409d7fe20cc -r c8f3d95c66bc hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Wed Sep 30 13:23:46 2015 +0000 +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Tue Sep 29 17:01:37 2015 +0000 @@ -3039,6 +3039,24 @@ _masm->bind(_label); } +void MacroAssembler::addptr(const Address &dst, int32_t src) { + Address adr; + switch(dst.getMode()) { + case Address::base_plus_offset: + // This is the expected mode, although we allow all the other + // forms below. + adr = form_address(rscratch2, dst.base(), dst.offset(), LogBytesPerWord); + break; + default: + lea(rscratch2, dst); + adr = Address(rscratch2); + break; + } + ldr(rscratch1, adr); + add(rscratch1, rscratch1, src); + str(rscratch1, adr); +} + void MacroAssembler::cmpptr(Register src1, Address src2) { unsigned long offset; adrp(rscratch1, src2, offset); diff -r 8409d7fe20cc -r c8f3d95c66bc hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp Wed Sep 30 13:23:46 2015 +0000 +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp Tue Sep 29 17:01:37 2015 +0000 @@ -908,13 +908,7 @@ // Arithmetics - void addptr(Address dst, int32_t src) { - lea(rscratch2, dst); - ldr(rscratch1, Address(rscratch2)); - add(rscratch1, rscratch1, src); - str(rscratch1, Address(rscratch2)); - } - + void addptr(const Address &dst, int32_t src); void cmpptr(Register src1, Address src2); // Various forms of CAS