JDK-8362118 : C2: add more debug prints to string concatenation optimizations
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,25
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-07-14
  • Updated: 2025-08-11
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 :  
Relates :  
Description
We can consider enhancing the debug printouts in this optimization phase due to recently identified bugs in this area.

Suggestions: 

- dump the start/end nodes for each pair that is considered for stacked string concatenations, and the number of arguments for both concats (JDK-8362394)
- print IGV graphs between each call to replace_string_concat
- Add a CITime category for stringopts (found through JDK-8362394)
- Hide the existing control flow printing behind a Verbose flag
Comments
" - dump the start/end nodes for each pair that is considered for stacked string concatenations " To easily find the start and end of a StringBuilder-append-toString link. " Add a CITime category for stringopts " The current output looks like C2 Compile Time: 4.205 s Parse: 3.904 s Optimize: 0.064 s Escape Analysis: 0.001 s Conn Graph: 0.001 s Macro Eliminate: 0.001 s So stringopts is "parse" but maybe it's clearer to have a separate category
17-07-2025

" print IGV graphs between each call to replace_string_concat" I attached the image upstream_before_and_after_stringopts that illustrates that the current approach is coarse-grained. This graph is printed from the test case in JDK-8362117. The whole graph changes between the two phases (each node displays a color change). It could be beneficial to print intermediate steps to understand stringopts.
15-07-2025