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

Evgeny Astigeevich duke at openjdk.java.net
Wed Mar 16 14:39:49 UTC 2022


On Wed, 16 Mar 2022 09:37:29 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:

>> Currently the codecache segment order is [non-nmethod, non-profiled, profiled]. With this change we move the non-nmethod segment between two code segments. It changes nothing for any platform besides AARCH.
>> 
>> In AARCH the offset limit for a branch instruction is 128MB. The bigger jumps are encoded with three instructions. Most of far branches are jumps into the non-nmethod blobs. With the non-nmethod segment in between code segments the jump distance from method to the stub becomes shorter. The result is a 4% reduction in generated code size for the CodeCache range from 128MB to 240MB.
>> 
>> As a side effect, the performance of some tests is slightly improved:
>> ``ArraysFill.testCharFill      10  thrpt   15  170235.720 -> 178477.212  ops/ms``
>> 
>> Testing: jdk/hotspot jtreg and microbenchmarks on AMD and AARCH
>
> Boris Ulasevich has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   rename, adding test

src/hotspot/cpu/aarch64/icBuffer_aarch64.cpp line 58:

> 56:   // IC stub code size is not expected to vary depending on target address.
> 57:   // We use NOPs to make the ldr+far_jump+int64 size equal to ic_stub_code_size.
> 58:   for (int i = jump_code_size; i < ic_stub_code_size() - 12; i += 4) {

12 == 3 * NativeInstruction::instruction_size
4 == NativeInstruction::instruction_size

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

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


More information about the hotspot-dev mailing list