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

Andrew Haley aph at openjdk.org
Tue Feb 28 13:48:20 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 726:

> 724:     assert_different_registers(rscratch1, rscratch2, t0, t1, t2, t3, t4, t5, t6, t7);
> 725:     assert_different_registers(s, d, count, rscratch1, rscratch2);
> 726: 

Suggestion:

    static const FloatRegister vt[] = {v0, v1, v2, v3};
    static const Register t[] = {t0, t1, t2, t3, t4, t5, t6, t7};

src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp line 812:

> 810:       bs_asm->copy_load_at(_masm, decorators, type, 32,
> 811:                            v2, v3, Address(__ pre(s, 8 * unit)),
> 812:                            gct1, gct2, gcvt1);

Suggestion:

      for (int i = 0; i < 4; i+= 2) {
        bs_asm->copy_store_at(_masm, decorators, type, 32,
                              Address(d, i * 4 * unit), vt[i], vt[i+1],
                              gct1, gct2, gct3, gcvt1, gcvt2, gcvt3);
        bs_asm->copy_load_at(_masm, decorators, type, 32,
                             vt[i], vt[i+1], Address(s, i * 4 * unit),
                             gct1, gct2, gcvt1);
      }
      ```

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

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


More information about the hotspot-dev mailing list