diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index c3c4f93296539..f3e7d8b658216 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -931,7 +931,12 @@ void MacroAssembler::jump_codecache(const address dest, Register temp) { void MacroAssembler::jump_label(Label &lab, Register temp) { assert_different_registers(x0, temp); - wrap_label(x0, lab, temp, &MacroAssembler::jump_link_wrap_label); + if (lab.is_bound()) { + MacroAssembler::jump_codecache(target(lab), temp); + } else { + lab.add_patch_at(code(), locator()); + MacroAssembler::jump_codecache(pc(), temp); + } } void MacroAssembler::wrap_label(Register Rt, Label &L, Register tmp, load_insn_by_temp insn) {