RFR: 8302780: Add support for vectorized arraycopy GC barriers [v6]

Erik Österlund eosterlund at openjdk.org
Wed Mar 1 10:56:33 UTC 2023


On Tue, 28 Feb 2023 12:28:02 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> Erik Österlund has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add comment
>
> src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp line 1270:
> 
>> 1268:     Label copy4, copy8, copy16, copy32, copy80, copy_big, finish;
>> 1269:     const Register t2 = r5, t3 = r6, t4 = r7, t5 = r11;
>> 1270:     const Register t6 = r12, t7 = r13, t8 = r14, t9 = r15;
> 
> I find the usage of r15 in `copy_memory` a bit confusing. If I get it right, it is used
> 1. as a temporary register (aliased as `t9`) for 16-bytes copying (L1407-1437),
> 2. as a temporary register (in its raw form, i.e. not via `t9`) passed explicitly to `copy_memory_small` (L1518-1548), and
> 3. as a "special" register passed implicitly to the generated `copy_longs` stubs (L1557-1574).
> 
> I think it would be clearer if `t9` was used instead of `r15` for case 2) and then perhaps a comment was added before calling the generated `copy_longs` stubs mentioning that `t9` cannot be used from then on because it aliases with `r15`.

Since r15 is part of the ABI contract across different generated stubs, I'd prefer to not change it to t9 as when you scroll through the different functions, it isn't clear that t9 isn't just used locally as a temporary register, but is used across stubs, even though it isn't passed as parameter with the name "t9" said stubs. I did however add a comment explaining when we start using r15 is count and that we can't use t9 any more after that point. I hope that's okay.

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

PR: https://git.openjdk.org/jdk/pull/12670


More information about the hotspot-dev mailing list