8330735: RISC-V: No need to move sp to tmp register in set_last_Java_frame

Reviewed-by: fyang
This commit is contained in:
Feilong Jiang 2024-04-23 08:00:18 +00:00
parent daa5a4bd12
commit 281f9bdeb9
3 changed files with 8 additions and 12 deletions

View File

@ -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;
}
@ -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,

View File

@ -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);

View File

@ -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);