JDK-8341404 : C2: investigate why synchronized method is made not compilable
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,24
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-10-02
  • Updated: 2025-08-14
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
https://ionutbalosin.com/2024/02/jvm-performance-comparison-for-jdk-21/#jit-compiler

nested_synchronized method in LockCoarseningBenchmark

The text of the blog reports that c2 deoptimizes repeatedly and makes the method not compilable.
Comments
The explanation for this is found in a comment in generateOooMap.cpp:1800 https://github.com/openjdk/jdk/blob/882d6358074135b2c4fe21b32bd73f40022980bc/src/hotspot/share/oops/generateOopMap.cpp#L1800-L1804. > // Bail out when we get repeated locks on an identical monitor. This case > // isn't too hard to handle and can be made to work if supporting nested > // redundant synchronized statements becomes a priority. The test case from the blog post is testing exactly "nested redundant synchronized" statements. The question is now if we have reached a point where this did become a priority and something that should be supported?
21-11-2024

Assigning this to me to reserve for a new hire in the compiler team.
23-10-2024