RFR: 8280872: Reorder code cache segments to improve code density [v9]

Vladimir Kozlov kvn at openjdk.java.net
Tue Apr 5 20:30:47 UTC 2022


On Tue, 5 Apr 2022 06:22:09 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/c2/aarch64/TestFarJump.java line 39:
>> 
>>> 37:  * @requires vm.flagless
>>> 38:  * @requires os.arch=="aarch64"
>>> 39:  * @requires vm.debug == false
>> 
>> Why you disabled test with debug VM?
>
> In a debug build the functionality does not work as expected. On AARCH64 branch range is +/-128MB. This is reflected by branch_range constant in [assembler_aarch64.hpp](https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/assembler_aarch64.hpp#L850). The issue is that for debug build the branch_range constant is intentionally modified to test trampolines, and my test fails because branches are encoded into three instructions starting at 2MB, not 128MB:
> 
>   // The maximum range of a branch is fixed for the AArch64
>   // architecture.  In debug mode we shrink it in order to test
>   // trampolines, but not so small that branches in the interpreter
>   // are out of range.
>   static const uint64_t branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M);

Got it.

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

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


More information about the hotspot-dev mailing list