From dd906ffdcb7d965cd4798cb7eebd9c1b71b3c136 Mon Sep 17 00:00:00 2001 From: Robbin Ehn Date: Thu, 2 May 2024 08:10:59 +0000 Subject: [PATCH] 8331399: RISC-V: Don't us mv instead of la Reviewed-by: fyang, mli, tonyp --- src/hotspot/cpu/riscv/macroAssembler_riscv.cpp | 4 ++-- src/hotspot/cpu/riscv/macroAssembler_riscv.hpp | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 234d85ed246..b450d93680f 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -2098,7 +2098,7 @@ void MacroAssembler::movoop(Register dst, jobject obj) { RelocationHolder rspec = oop_Relocation::spec(oop_index); if (BarrierSet::barrier_set()->barrier_set_assembler()->supports_instruction_patching()) { - mv(dst, Address((address)obj, rspec)); + la(dst, Address((address)obj, rspec)); } else { address dummy = address(uintptr_t(pc()) & -wordSize); // A nearby aligned address ld_constant(dst, Address(dummy, rspec)); @@ -2114,7 +2114,7 @@ void MacroAssembler::mov_metadata(Register dst, Metadata* obj) { oop_index = oop_recorder()->find_index(obj); } RelocationHolder rspec = metadata_Relocation::spec(oop_index); - mv(dst, Address((address)obj, rspec)); + la(dst, Address((address)obj, rspec)); } // Writes to stack successive pages until offset reached to check for diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp index a46f3d5779e..7c77edd8711 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp @@ -763,13 +763,6 @@ public: template::value)> inline void mv(Register Rd, T o) { li(Rd, (int64_t)o); } - void mv(Register Rd, Address dest) { - assert(dest.getMode() == Address::literal, "Address mode should be Address::literal"); - relocate(dest.rspec(), [&] { - movptr(Rd, dest.target()); - }); - } - void mv(Register Rd, RegisterOrConstant src) { if (src.is_register()) { mv(Rd, src.as_register());