RFR: 8329331: Intrinsify Unsafe::setMemory [v7]

Scott Gibbons sgibbons at openjdk.org
Thu Apr 11 14:38:45 UTC 2024


On Thu, 11 Apr 2024 00:38:11 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> Scott Gibbons has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add movq to locate_operand
>
> src/hotspot/cpu/x86/macroAssembler_x86.cpp line 5988:
> 
>> 5986:     movw(Address(to, 0), value);
>> 5987:     addptr(to, 2);
>> 5988:     subptr(count, 1<<(shift-1));
> 
> At line 5968 also we need the change from cmpl to cmpptr.
> cmpl(count, 2<<shift); // Short arrays (< 8 bytes) fill by element

Will do.

> src/hotspot/cpu/x86/macroAssembler_x86.cpp line 6050:
> 
>> 6048:           vpbroadcastd(xtmp, xtmp, Assembler::AVX_512bit);
>> 6049: 
>> 6050:           subptr(count, 16 << shift);
> 
> At line 6045 also the cmpl should change to cmpptr:
> cmpl(count, VM_Version::avx3_threshold());

Will do.

> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2497:
> 
>> 2495: //
>> 2496: address StubGenerator::generate_unsafe_setmemory(const char *name,
>> 2497:                                                  address byte_fill_entry) {
> 
> Need to add UnsafeSetMemoryMark on similar lines as UnsafeCopyMemoryMark to handle page error.

Will do.

> src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp line 2522:
> 
>> 2520: #define rScratch3 r8
>> 2521: #undef rScratch4
>> 2522: #define rScratch4 r11
> 
> We could do this setup using const Register declaration instead of using #undef/#define pair.

We discussed this and the #define option was your preferred method since the registers are being re-used.  Do you want this changed back again?

> src/hotspot/share/opto/library_call.cpp line 4950:
> 
>> 4948: 
>> 4949: bool LibraryCallKit::inline_unsafe_setMemory() {
>> 4950:   if (callee()->is_static())  return false;  // caller must have the capability!
> 
> Also need to return false if StubRoutines::unsafe_setmemory() == nullptr.

Will do.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18555#discussion_r1561128613
PR Review Comment: https://git.openjdk.org/jdk/pull/18555#discussion_r1561128862
PR Review Comment: https://git.openjdk.org/jdk/pull/18555#discussion_r1561129186
PR Review Comment: https://git.openjdk.org/jdk/pull/18555#discussion_r1561128151
PR Review Comment: https://git.openjdk.org/jdk/pull/18555#discussion_r1561130102


More information about the core-libs-dev mailing list