diff --git a/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp b/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp index 320093ee0e3..682a8622096 100644 --- a/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp +++ b/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp @@ -55,7 +55,7 @@ void C2SafepointPollStub::emit(C2_MacroAssembler& masm) { int C2EntryBarrierStub::max_size() const { // 4 bytes for alignment - return 3 * NativeInstruction::instruction_size + 4 + 4; + return 4 * NativeInstruction::instruction_size + 4 + 4; } void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) { @@ -63,6 +63,7 @@ void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) { // emits auipc + jalr for address inside code cache __ far_call(StubRoutines::method_entry_barrier()); + // emits auipc + jr assuming continuation is not near __ j(continuation()); // make guard value 4-byte aligned so that it can be accessed atomically