Description
Feature request
Please include the following information:
Is your feature request related to a problem? Please describe.
For aarch64 Graal determines if a branch is far (and needs a trampoline) by checking if the offset will fit in 28 bits (source). HotSpot however reduces this size to 22 bits for debug builds (source) for testing. This can cause issues when HotSpot expects there to be a trampoline because of its reduced range but Graal did not generate one.
Describe the solution you'd like.
The solution is to make Graal aware of the HotSpot branch range similar to how getMaxCallTargetOffset() works.
Describe who do you think will benefit the most.
GraalVM contributors and users
Describe alternatives you've considered.
- Hard code the range to the same value as HotSpot instead of making a call to the backend. However I'm not sure of a way for Graal to know if it is debug/release and keeping HotSpot/Graal in sync is duplicate work.
- Do nothing and let HotSpot assume that if a trampoline doesn't exist it isn't needed. This could technically work with certain null checks but it hides the ability to find actual missing trampolines.
Additional context.
This was found when working on JDK-8316694
Express whether you'd like to help contributing this feature
Yes I can help contribute to this feature
If you'd like to contribute, please read the contribution guide.