JDK-8346194 : Improve G1 pre-barrier C2 cost estimate
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-12-13
  • Updated: 2025-03-26
  • Resolved: 2025-03-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b15Fixed
Related Reports
Relates :  
Description
Currently, the pre-barrier has an estimated cost of 50 nodes for the C2 compiler for code generation.

This cost assumes that all of these 50 nodes are in the regular/fast path of the generated code - however this is not the case, the large majority of these nodes are part of the seldomly executed slow path and do not matter for code layout purposes.

This is similar to ZGC, and similar to ZGC the node cost should be reduced to just 4 (cmp, bool, if, if-proj for the fast path/jmp).

Likely this will not have a lot of impact on code generation because the post-barrier's cost is still overwhelmingly large (60), but that will be fixed in JDK-8342382.
Comments
Changeset: 9f8d833f Branch: master Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2025-03-17 07:57:45 +0000 URL: https://git.openjdk.org/jdk/commit/9f8d833f8654cb4280d002ef86ce3ae9d709eddc
17-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23862 Date: 2025-03-03 12:30:23 +0000
03-03-2025