[lworld] RFR: 8272566: [lworld] [AArch64] G1 write barrier slow path needs to save more registers

Tobias Hartmann thartmann at openjdk.java.net
Wed Aug 18 08:38:39 UTC 2021


On Wed, 18 Aug 2021 06:39:34 GMT, Nick Gasson <ngasson at openjdk.org> wrote:

> We call MacroAssembler::store_heap_oop() when packing inline type
> arguments in C1's scalarised entry point and that in turn uses the
> interpreter's barrier set assembler for the write barrier.  With G1GC
> this can call into the runtime on the slow path, but it doesn't preserve
> the call-clobbered registers, which include the Java argument registers.
> 
> This was fixed on x86 in JDK-8242210 and JDK-8251398 but I missed that
> when I updated the AArch64 port earlier in the year.  I haven't actually
> seen any failures caused by this, but from looking at the generated
> assembly it's certainly possible.
> 
> This patch saves only the argument registers, and only if Valhalla is
> enabled (unlike x86 which saves all registers unconditionally).  There
> are 32 caller-saved registers on AArch64 so I wanted to avoid generating
> many additional store/load instructions.

Looks good to me.

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

Marked as reviewed by thartmann (Committer).

PR: https://git.openjdk.java.net/valhalla/pull/534



More information about the valhalla-dev mailing list