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

Evgeny Astigeevich duke at openjdk.java.net
Thu Mar 10 14:58:45 UTC 2022


On Wed, 9 Mar 2022 14:13:38 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 updated the pull request incrementally with two additional commits since the last revision:
> 
>  - moving nops out of far_jump
>  - minor renaming

Can we have tests for this?

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 1078:

> 1076:   static bool is_trampoline_needed() {
> 1077:     return ReservedCodeCacheSize > branch_range;
> 1078:   }

What about to keep `far_branches` and to use it in `is_trampoline_needed` and other places?

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

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


More information about the hotspot-dev mailing list