RFR: 8310844: [AArch64] C1 compilation fails because monitor offset in OSR buffer is too large for immediate

Tobias Hartmann thartmann at openjdk.org
Thu Jan 4 12:44:36 UTC 2024


[JDK-8287349](https://bugs.openjdk.org/browse/JDK-8287349) changed the code in `LIR_Assembler::osr_entry()` to use a single `ldp` instruction instead of two `ldr` instructions to load the monitor lock and object from the OSR state. This is not correct because the `ldp` instruction only supports a [7-bit signed immediate value](https://developer.arm.com/documentation/den0024/a/The-A64-instruction-set/Memory-access-instructions/Accessing-multiple-memory-locations). If the offset is larger, for example due to a large number of locals as in `TestLargeMonitorOffset::test`, we hit the `Field too big for insn` guarantee.

I suggest to revert [JDK-8287349](https://bugs.openjdk.org/browse/JDK-8287349). 

I also found two unrelated bugs when working on the reproducer: [JDK-8322992](https://bugs.openjdk.org/browse/JDK-8322992) (javac) and [JDK-8322996](https://bugs.openjdk.org/browse/JDK-8322996) (C2).

Thanks,
Tobias

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

Commit messages:
 - 8310844: [AArch64] C1 compilation fails because monitor offset in OSR buffer is too large for immediate

Changes: https://git.openjdk.org/jdk/pull/17266/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17266&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8310844
  Stats: 150 lines in 2 files changed: 147 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/17266.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17266/head:pull/17266

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


More information about the hotspot-compiler-dev mailing list