Skip to content

Commit

Permalink
unnecessary mv from sp to tmp register
Browse files Browse the repository at this point in the history
  • Loading branch information
feilongjiang committed Apr 20, 2024
1 parent 6d56996 commit f31d8ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
16 changes: 6 additions & 10 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,16 @@ void MacroAssembler::check_and_handle_popframe(Register java_thread) {}
// has to be reset to 0. This is required to allow proper stack traversal.
void MacroAssembler::set_last_Java_frame(Register last_java_sp,
Register last_java_fp,
Register last_java_pc,
Register tmp) {
Register last_java_pc) {

if (last_java_pc->is_valid()) {
sd(last_java_pc, Address(xthread,
JavaThread::frame_anchor_offset() +
JavaFrameAnchor::last_Java_pc_offset()));
sd(last_java_pc, Address(xthread,
JavaThread::frame_anchor_offset() +
JavaFrameAnchor::last_Java_pc_offset()));
}

// determine last_java_sp register
if (last_java_sp == sp) {
mv(tmp, sp);
last_java_sp = tmp;
} else if (!last_java_sp->is_valid()) {
if (!last_java_sp->is_valid()) {
last_java_sp = esp;
}

Expand All @@ -262,7 +258,7 @@ void MacroAssembler::set_last_Java_frame(Register last_java_sp,
la(tmp, last_java_pc);
sd(tmp, Address(xthread, JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset()));

set_last_Java_frame(last_java_sp, last_java_fp, noreg, tmp);
set_last_Java_frame(last_java_sp, last_java_fp, noreg);
}

void MacroAssembler::set_last_Java_frame(Register last_java_sp,
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/macroAssembler_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class MacroAssembler: public Assembler {
// last Java Frame (fills frame anchor)
void set_last_Java_frame(Register last_java_sp, Register last_java_fp, address last_java_pc, Register tmp);
void set_last_Java_frame(Register last_java_sp, Register last_java_fp, Label &last_java_pc, Register tmp);
void set_last_Java_frame(Register last_java_sp, Register last_java_fp, Register last_java_pc, Register tmp);
void set_last_Java_frame(Register last_java_sp, Register last_java_fp, Register last_java_pc);

// thread in the default location (xthread)
void reset_last_Java_frame(bool clear_fp);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/stubGenerator_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2434,7 +2434,7 @@ class StubGenerator: public StubCodeGenerator {
__ membar(__ LoadLoad);
}

__ set_last_Java_frame(sp, fp, ra, t0);
__ set_last_Java_frame(sp, fp, ra);

__ enter();
__ add(t1, sp, wordSize);
Expand Down

0 comments on commit f31d8ad

Please sign in to comment.