RFR: 8351140: RISC-V: Intrinsify Unsafe::setMemory

Anjian-Wen duke at openjdk.org
Fri Mar 28 02:06:19 UTC 2025


On Thu, 27 Mar 2025 10:21:03 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> You may want to use `UnsafeMemoryAccessMark` as on x86.
>
>> @TheRealMDoerr Thanks for your kindly reply. I found that the main logic on the x86 is in 'generate_unsafe_setmemory' function, while the main logic on the riscv and aarch64 is in generate_fill. I have not found 'UnsafeMemoryAccess' on aarch64 in generate_fill, I will check whether we need to add it and where to insert it if needed on riscv.
> 
> Note that generate_fill is normally not used for Unsafe accesses and hence doesn't need 'UnsafeMemoryAccessMark'. I'm using it a bit differently here: https://github.com/openjdk/jdk/pull/24254

> > @TheRealMDoerr Thanks for your kindly reply. I found that the main logic on the x86 is in 'generate_unsafe_setmemory' function, while the main logic on the riscv and aarch64 is in generate_fill. I have not found 'UnsafeMemoryAccess' on aarch64 in generate_fill, I will check whether we need to add it and where to insert it if needed on riscv.
> 
> Note that generate_fill is normally not used for Unsafe accesses and hence doesn't need 'UnsafeMemoryAccessMark'. I'm using it a bit differently here: #24254

That makes sense, I'll try learn from your way of adding 'UnsafeMemoryAccessMark' and then test it

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23890#issuecomment-2759975260


More information about the hotspot-compiler-dev mailing list