Integrated: 8372285: G1: Micro-optimize x86 barrier code

Aleksey Shipilev shade at openjdk.org
Thu Nov 27 05:32:56 UTC 2025


On Fri, 21 Nov 2025 09:06:54 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`

This pull request has now been integrated.

Changeset: 848c0c79
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/848c0c79b69c489db6c6bbb24644134fe33fd0ec
Stats:     90 lines in 1 file changed: 21 ins; 29 del; 40 mod

8372285: G1: Micro-optimize x86 barrier code

Reviewed-by: tschatzl, ayang

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

PR: https://git.openjdk.org/jdk/pull/28446


More information about the hotspot-dev mailing list