JDK-8370610 : Revisit Stadler's PEA C2 implementation
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2025-10-24
  • Updated: 2025-10-27
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Following PR tried to implement Stadler's Partial Escape Analysis in C2 Compiler

https://github.com/openjdk/jdk/pull/14041

Graal Compiler already implements Partial Escape Analysis in some form using Virtual Object and Virtual Object States while C2 Escape analysis misses out on several allocation elimination opportunities.

Goal of this JBS is to explore existing C2 escape analysis, develop Java tests which clearly identify missing allocation elimination opportunities w.r.t to Graal and review the efforts of PR 14041.

Partial escape analysis: -
- Context sensitive allocation elimination, each new allocation has its corresponding Virtual Object and Virtual Object State to keep track of various field value modifications and state of object like locked / unlocked in different control flows . An allocation that remains in Virtual State on all control paths is non-escaping and can be eliminated.
 
- While Valhalla gives the control of value instance creation to user, PEA/EA opportunistically eliminates allocations if an allocation is non-escaping through inter and intra procedural analysis. Thus following analogies correctly relates existing JVM components
    o Auto-vectorization - Vector API
    o EA/PEA – Valhalla
Comments
Jatin Bhateja added a comment - 2025-09-25 06:04 Tests for escape analysis with different configurations to measure the performance of the C2 compiler, Graal compiler, and Valhalla. https://github.com/jatin-bhateja/external_staging/tree/main/Valhalla/partial_escape_analysis_graal_c2_valhalla/JDK-8366137 Next, analyze the performance gaps.
24-10-2025

Jatin Bhateja added a comment - 2025-08-26 16:26 - edited Attached micro benchmarks compare the performance of an affine transform on a 2D plane with Valhalla and partial escape analysis. While in the base case, Valhalla is 1.7x time faster, but in comparison to the hand-crafted PEA micro, it's 0.4x slower. It will be of interest to analyze and close this gap.
24-10-2025

Tobias Hartmann added a comment - 2025-08-26 14:42 See also: https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2023-August/067286.html https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2023-July/066670.html https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2023-May/065068.html https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2023-March/063118.html https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2023-January/062018.html
24-10-2025