diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 1cd7ac98b3490..d8f31c7ca71a6 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 a46f3d5779e09..7c77edd8711ce 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp @@ -763,13 +763,6 @@ class MacroAssembler: public Assembler { 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());