Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ int C2EntryBarrierStub::max_size() const {

void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) {
__ bind(entry());
RuntimeAddress target(StubRoutines::method_entry_barrier());
__ relocate(target.rspec(), [&] {
int32_t offset;
__ la_patchable(t0, target, offset);
__ jalr(ra, t0, offset);
});

int32_t offset = 0;
__ movptr(t0, StubRoutines::method_entry_barrier(), offset);
__ jalr(ra, t0, offset);
__ j(continuation());

// make guard value 4-byte aligned so that it can be accessed by atomic instructions on RISC-V
Expand Down
10 changes: 7 additions & 3 deletions src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,13 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Label* slo
Label skip_barrier;
__ beq(t0, t1, skip_barrier);

int32_t offset = 0;
__ movptr(t0, StubRoutines::method_entry_barrier(), offset);
__ jalr(ra, t0, offset);
RuntimeAddress target(StubRoutines::method_entry_barrier());
__ relocate(target.rspec(), [&] {
int32_t offset;
__ la_patchable(t0, target, offset);
__ jalr(ra, t0, offset);
});

__ j(skip_barrier);

__ bind(local_guard);
Expand Down