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

Aleksey Shipilev shade at openjdk.org
Wed Nov 26 08:03:56 UTC 2025


On Mon, 24 Nov 2025 09:48:52 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> We know from [JDK-8372284](https://bugs.openjdk.org/browse/JDK-8372284) that G1 C2 stubs can take ~10% of total instructions. So minor optimizations in hand-written assembly pay off for code density. This PR does a little x86-specific polishing: `testptr` where possible, short forward branches where possible. I rewired some code to make it abundantly clear the branches in question are short. It also makes clear that lots of the affected methods are essentially fall-through.
>> 
>> The patch is deliberately on simpler side, so we can backport it to 25u, if need arises.
>> 
>> Additional testing:
>>  - [x] Linux x86_64 server fastdebug, `tier1`
>>  - [x]  Linux x86_64 server fastdebug, `all`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Indenting was still off

I am guessing Vladimir is already in holiday mode. I believe I have addressed his comments, yielding to Vladimir's suggestions. Since there are other approvals, and the testing looks green, I will integrate shortly to unblock other work. Thanks!

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

PR Comment: https://git.openjdk.org/jdk/pull/28446#issuecomment-3579960651


More information about the hotspot-dev mailing list