diff a/src/hotspot/cpu/riscv/nativeInst_riscv.cpp b/src/hotspot/cpu/riscv/nativeInst_riscv.cpp --- a/src/hotspot/cpu/riscv/nativeInst_riscv.cpp +++ b/src/hotspot/cpu/riscv/nativeInst_riscv.cpp @@ -277,10 +277,17 @@ //-------------------------------------------------------------------------------- void NativeJump::verify() { } +void NativeJump::insert(address code_pos, address entry) { + intptr_t disp = (intptr_t)entry - ((intptr_t)code_pos); + uint32_t new_jal = Assembler::encode_jal(ra, disp); + AtomicAccess::store((uint32_t *)code_pos, new_jal); + ICache::invalidate_range(code_pos, instruction_size); +} + address NativeJump::jump_destination() const { address dest = MacroAssembler::target_addr_for_insn(instruction_address()); // We use jump to self as the unresolved address which the inline // cache code (and relocs) know about