RFR: 8372285: G1: Micro-optimize x86 barrier code [v3]

Aleksey Shipilev shade at openjdk.org
Fri Nov 21 10:07:37 UTC 2025


On Fri, 21 Nov 2025 09:58:07 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Backward jumps are actually shortened automatically, because assembler knows when their offset is small. Only forward branches need this special (forward-looking) treatment: assembler has no advanced knowledge the jump can be short, so we have to tell it. This is our SOP: rely on automatic shortening where possible for backward branches, shorten the forward branches where it is obvious. 
>> 
>> Yes, I think we can shorten `__ jcc(Assembler::equal, is_clean_card);` too, let me try that.
>
> Okay, thanks for the information, I am good with that. Although I think it would not hurt to make it explicit that we cared.

Right, we can make some of these backward branches explicitly short, just to drive the point home. Done in new commit, let's see if testing complains about any new shortenings.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28446#discussion_r2549210137


More information about the hotspot-dev mailing list