RFR: 8302780: Add support for vectorized arraycopy GC barriers [v6]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Tue Feb 28 12:31:09 UTC 2023
On Mon, 27 Feb 2023 11:28:40 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:
>> So far, the arraycopy stubs have performed some kind of bulk pre/post barriers for arraycopy, which have been good enough, and allowed the copying itself to be done with plain loads and stores. For generational ZGC, this approach is not good enough, and we need barriers for the actual copying, but instead don't need the pre/post barriers. To prepare the JVM for generational ZGC, we need to add an API for arraycopy barriers.
>
> 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`.
-------------
PR: https://git.openjdk.org/jdk/pull/12670
More information about the hotspot-dev
mailing list