Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 10 additions & 28 deletions src/hotspot/cpu/riscv/interp_masm_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,47 +955,29 @@ void InterpreterMacroAssembler::set_mdp_data_at(Register mdp_in,


void InterpreterMacroAssembler::increment_mdp_data_at(Register mdp_in,
int constant,
bool decrement) {
increment_mdp_data_at(mdp_in, noreg, constant, decrement);
int constant) {
increment_mdp_data_at(mdp_in, noreg, constant);
}

void InterpreterMacroAssembler::increment_mdp_data_at(Register mdp_in,
Register reg,
int constant,
bool decrement) {
Register index,
int constant) {
assert(ProfileInterpreter, "must be profiling interpreter");
// %%% this does 64bit counters at best it is wasting space
// at worst it is a rare bug when counters overflow

assert_different_registers(t1, t0, mdp_in, reg);
assert_different_registers(t1, t0, mdp_in, index);

Address addr1(mdp_in, constant);
Address addr2(t1, 0);
Address &addr = addr1;
if (reg != noreg) {
if (index != noreg) {
la(t1, addr1);
add(t1, t1, reg);
add(t1, t1, index);
addr = addr2;
}

if (decrement) {
ld(t0, addr);
subi(t0, t0, DataLayout::counter_increment);
Label L;
bltz(t0, L); // skip store if counter underflow
sd(t0, addr);
bind(L);
} else {
assert(DataLayout::counter_increment == 1,
"flow-free idiom only works with 1");
ld(t0, addr);
addi(t0, t0, DataLayout::counter_increment);
Label L;
blez(t0, L); // skip store if counter overflow
sd(t0, addr);
bind(L);
}
ld(t0, addr);
addi(t0, t0, DataLayout::counter_increment);
sd(t0, addr);
}

void InterpreterMacroAssembler::set_mdp_flag_at(Register mdp_in,
Expand Down
7 changes: 2 additions & 5 deletions src/hotspot/cpu/riscv/interp_masm_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,8 @@ class InterpreterMacroAssembler: public MacroAssembler {
void verify_method_data_pointer();

void set_mdp_data_at(Register mdp_in, int constant, Register value);
void increment_mdp_data_at(Address data, bool decrement = false);
void increment_mdp_data_at(Register mdp_in, int constant,
bool decrement = false);
void increment_mdp_data_at(Register mdp_in, Register reg, int constant,
bool decrement = false);
void increment_mdp_data_at(Register mdp_in, int constant);
void increment_mdp_data_at(Register mdp_in, Register index, int constant);
void increment_mask_and_jump(Address counter_addr,
int increment, Address mask,
Register tmp1, Register tmp2,
Expand Down