RFR: 8280872: Reorder code cache segments to improve code density [v8]
Volker Simonis
simonis at openjdk.java.net
Mon Mar 28 18:12:53 UTC 2022
On Thu, 24 Mar 2022 13:36:27 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. Currently only the aarch64 backend is adapted to make use of these changes.
>>
>> 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 with a new target base due to a merge or a rebase. The pull request now contains eight commits:
>
> - Merge branch 'openjdk:master' into codecache_segments_order
> - review findings: use instruction_size istead of raw constant, strengthen the assert, check alignment, move comments, segments order: profiled - non_method - non_profiled
> - rename, adding test
> - moving nops out of far_jump
> - minor renaming
> - review comments. remove far_call limit. undo trampoline-to-farcall. add trampoline_needs_far_jump func
> - fix name: is_non_nmethod, adding target_needs_far_branch func
> - change codecache segments order: nonprofiled-nonmethod-profiled
> increase far jump threshold: sideof(codecache)=128M -> sizeof(nonprofiled+nonmethod)=128M
src/hotspot/cpu/aarch64/icBuffer_aarch64.cpp line 64:
> 62: }
> 63: __ bind(l);
> 64: assert((uintptr_t)__ pc() % wordSize == 0);
Looks like this leads to a compilation failure in the debug build. Can you please check before submitting?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7517
More information about the hotspot-dev
mailing list