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

Erik Österlund eosterlund at openjdk.org
Mon Feb 27 11:22:09 UTC 2023


On Mon, 27 Feb 2023 10:18:22 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> We used to only have setup_arg_regs which saved windows callee saved registers in r10, which turned out to be horribly fragile (cf. https://bugs.openjdk.org/browse/JDK-8203466). The setup_arg_regs_using_thread() function was introduced specifically so that the windows callee save registers are *not* stored in r10, because it is a register you really don't want to rely on not getting scratched, when it is chosen as the rscratch1 register. Instead, callee save registers are saved in the thread memory area, which is much less fragile. That's why I can use r10.
>
> Thanks for the explanation, Erik! If I got it right, in this patch, implementations of `copy_[load|store]_at()` can only use `r10` safely (`Register tmp`, or `Register tmp2` for vector `copy_store_at()`) if `BasicType type == T_OBJECT`, because only in this context they will be called between `setup_arg_regs_using_thread()` and `restore_arg_regs_using_thread()` (as opposed to regular `setup_arg_regs()`/`restore_arg_regs()`). If this is correct and expected, I suggest to document it somewhere, e.g. as a comment in the declaration of `copy_[load|store]_at()`, to avoid misinterpretations.

Good point. I'll add a comment.

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

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


More information about the hotspot-dev mailing list