Skip to content

Commit a385d3d

Browse files
committed
Polish nmethod_entry_barrier and RISC-V CAS related comments
1 parent a63003c commit a385d3d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) {
238238
return;
239239
}
240240

241-
// RVC: RISCV's amoswap instructions need an alignment for the memory address it swaps
242-
// when we reach here we may get a 2-byte alignment so need to align it
241+
// RISCV's amoswap instructions need a 4-byte alignment for the 4-byte word it swaps in memory
243242
__ align(4);
244243

245244
Label skip, guard;
@@ -260,7 +259,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) {
260259

261260
__ bind(guard);
262261

263-
assert(__ offset() % 4 == 0, "RISCV CAS needs an alignment for memory");
262+
assert(__ offset() % 4 == 0, "RISCV CAS needs a 4-byte alignment for the 4-byte word it swaps in memory");
264263
__ emit_int32(0); // nmethod guard value. Skipped over in common case.
265264

266265
__ bind(skip);

0 commit comments

Comments
 (0)