From 568c0c04f56acd383c1c1e8e85fde9a2b4836cff Mon Sep 17 00:00:00 2001 From: Robbin Ehn Date: Tue, 30 Apr 2024 08:52:53 +0200 Subject: [PATCH] use incw --- src/hotspot/cpu/riscv/macroAssembler_riscv.cpp | 6 +----- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 1cd7ac98b3490..234d85ed2469a 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -3344,11 +3344,7 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass, mv(x10, super_klass); #ifndef PRODUCT - mv(t1, (address)&SharedRuntime::_partial_subtype_ctr); - Address pst_counter_addr(t1); - ld(t0, pst_counter_addr); - add(t0, t0, 1); - sd(t0, 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/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index 9712f8c326c02..582538a18b496 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -77,10 +77,7 @@ class StubGenerator: public StubCodeGenerator { #define inc_counter_np(counter) ((void)0) #else void inc_counter_np_(uint& counter) { - __ la(t1, ExternalAddress((address)&counter)); - __ lwu(t0, Address(t1, 0)); - __ addiw(t0, t0, 1); - __ sw(t0, Address(t1, 0)); + __ incrementw(ExternalAddress((address)&counter)); } #define inc_counter_np(counter) \ BLOCK_COMMENT("inc_counter " #counter); \