RFR: 8262726: AArch64: C1 StubAssembler::call_RT can corrupt stack

Nick Gasson ngasson at openjdk.java.net
Tue Mar 2 06:41:53 UTC 2021


StubAssembler::call_RT() has some code to shuffle arguments using the
stack as temporary storage. But there's a typo: the first pre(sp, 2 *
wordSize) should be pre(sp, -2 * wordSize) otherwise the pushes and pops
are unbalanced.

I think this was exposed by JDK-8259619 which fixed the conflict check
but AFAIK it only causes a problem on the Valhalla lworld branch and is
not used otherwise.

I would rather replace this code with an assert that the conflict never
occurs as we are in full control of the argument registers passed to
call_RT (the PPC port does this, for example).

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

Commit messages:
 - 8262726: AArch64: C1 StubAssembler::call_RT can corrupt stack

Changes: https://git.openjdk.java.net/jdk/pull/2787/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2787&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8262726
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2787.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2787/head:pull/2787

PR: https://git.openjdk.java.net/jdk/pull/2787


More information about the hotspot-compiler-dev mailing list