Skip to content

Commit

Permalink
use incw
Browse files Browse the repository at this point in the history
  • Loading branch information
robehn committed Apr 30, 2024
1 parent 819f3d6 commit 568c0c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 1 addition & 4 deletions src/hotspot/cpu/riscv/stubGenerator_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down

0 comments on commit 568c0c0

Please sign in to comment.