RFR: 8329331: Intrinsify Unsafe::setMemory [v12]
Sandhya Viswanathan
sviswanathan at openjdk.org
Fri Apr 12 00:28:51 UTC 2024
On Fri, 12 Apr 2024 00:00:38 GMT, Scott Gibbons <sgibbons at openjdk.org> wrote:
>> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2751:
>>
>>> 2749: UnsafeSetMemoryMark usmm(this, true, true);
>>> 2750:
>>> 2751: __ generate_fill(T_BYTE, false, c_rarg0, c_rarg1, r11, rax, xmm0);
>>
>> We will be duplicating the code gen for generate_fill here? Could we not do a tail call to _jbyte_fill here and add UnsafeSetMemoryMark inside _jbyte_fill?
>
> It would not be appropriate to add set memory marks to the existing _jbyte_fill as it is being used by other routines, and the effect of the mark will be very hard to track down (if any).
>
> Are you *sure* we want to do that?
Yes we want to do that. It is all guarded by thread->doing_unsafe_access() which is only true when we are getting to this code from unsafe. Similar technique is used in copyMemory as well.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18555#discussion_r1561877858
More information about the core-libs-dev
mailing list