RFR: 8280872: Reorder code cache segments to improve code density [v6]
Boris Ulasevich
bulasevich at openjdk.java.net
Thu Mar 24 13:26:45 UTC 2022
On Thu, 17 Mar 2022 17:36:16 GMT, Volker Simonis <simonis at openjdk.org> wrote:
>> 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 56:
>
>> 54: __ ldr(rscratch2, l);
>> 55: int jump_code_size = __ far_jump(ExternalAddress(entry_point));
>> 56: // IC stub code size is not expected to vary depending on target address.
>
> Does the new code still align `cached_value` on a `wordSize` boundary as this was ensured before by `align(wordsize)`? I think that's only true if `code_begin` is guaranteed to start at a `wordSize` boundary because `far_jump` is either one or three instructions (plus one `ldr` instruction). If yes, please add a comment explaining that. Otherwise explain why the alignment isn't necessary anymore.
Thanks for pointing this out. I think alignment is important because of data load penalty issues and MT issues.
Actually the stub is aligned on the CodeEntryAlignment and stub_size is aligned, so this address is also aligned.
I removed align(wordSize) because the stub_size is constant and there is no room for additional alignments within a stub. Let me add an assert here to check the alignment.
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 428:
>
>> 426: uint64_t offset;
>> 427: // We can use ADRP here because we know that the total size of
>> 428: // the code cache cannot exceed 2Gb.
>
> Not directly related to your change, but what's correct here:
> - the comment which says "code cache can't exceed 2gb"
> - the assertion above which asserts `ReservedCodeCacheSize < 4*G`
>
> Maybe you can fix this while you're on it?
ADRP limit is 4GB - it is checked by assert. The comment reminds us that CODE_CACHE_SIZE_LIMIT (defined in globalDefinitions.hpp) is 2G which is Ok for us. let me update comment a little:
+ // the code cache cannot exceed 2Gb (ADRP limit is 4GB)
-------------
PR: https://git.openjdk.java.net/jdk/pull/7517
More information about the hotspot-dev
mailing list