From f31d8ad01b81dc26e2a02f08b8622a654f31dfc5 Mon Sep 17 00:00:00 2001 From: FreedomLy Date: Sat, 20 Apr 2024 19:02:56 +0800 Subject: [PATCH] unnecessary mv from sp to tmp register --- src/hotspot/cpu/riscv/macroAssembler_riscv.cpp | 16 ++++++---------- src/hotspot/cpu/riscv/macroAssembler_riscv.hpp | 2 +- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 1b5a3cf571f96..1cd7ac98b3490 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -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, diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp index 1abf156070786..a46f3d5779e09 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp @@ -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); diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index 7ee17438b284e..37b45a57694c5 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -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);