[lworld] RFR: 8367156: [lworld] MacroAssembler::remove_frame hits "Field too big for insn"
Marc Chevalier
mchevalier at openjdk.org
Thu Sep 11 14:37:42 UTC 2025
As suspected, it's just a too big offset. We used to have a
https://github.com/openjdk/valhalla/blob/c8d4a247861052aa6ed43125bcbe49995326938f/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp#L6133
I changed it into
https://github.com/openjdk/valhalla/blob/880ae47831ed7262a0d3b30b92c3645bc67e5df2/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp#L6136
But [`ldp`](https://developer.arm.com/documentation/ddi0602/2025-06/Base-Instructions/LDP--Load-pair-of-registers-) has only a 7-bit offset. It's big, but not big enough. In some cases I've looked at, the offset can be as big as `536` which fits on 9 bits. [`ldr`](https://developer.arm.com/documentation/ddi0602/2025-06/Base-Instructions/LDR--immediate---Load-register--immediate--) supports a 9-bit offset. Let's change the `ldp` into
ldr(rscratch1, Address(sp, sp_inc_offset))
ldr(rfp, Address(sp, sp_inc_offset + wordSize))
which will be merged into one `ldp` if the offset fits.
But what if the offset is bigger than what fits on 9 bits? Well, us used to have the `ldr(rscratch1, Address(sp, sp_inc_offset))` so either we have a big problem (too big frames?) or `sp_inc_offset` was just bordeline and `sp_inc_offset + wordSize` is too big. But we still have `sp_inc_offset + wordSize == initial_framesize - 2 * wordSize` which would mean that `initial_framesize` doesn't fit on 9 bits either. Once again, that sounds like a bigger (and unlikely) problem.
Thanks,
Marc
-------------
Commit messages:
- Split ldp into two ldr
Changes: https://git.openjdk.org/valhalla/pull/1575/files
Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1575&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8367156
Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/valhalla/pull/1575.diff
Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1575/head:pull/1575
PR: https://git.openjdk.org/valhalla/pull/1575
More information about the valhalla-dev
mailing list