JDK-8278846 : C2: revisit exception propagation
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18,19
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-12-15
  • Updated: 2022-06-08
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
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
With late inlining we hit a couple bugs in the exception handling code because when an exception is thrown, rather than pop the expression stack, it is preserved until the exception handler executes or the exception is passed on to the caller. So far, the 2 bugs were fixed by working around the issue. However, popping the stack at the point where the exception is thrown would fix both issues and remove the need for workarounds. It's questionable whether the stack needs to be preserved until the exception is processed. It seems the stack is preserved because of a risk of an uncommon trap but, with today's code, there doesn't seem to be any uncommon trap on the path from exception throwing to exception handling.

See:
https://github.com/openjdk/jdk/pull/6572
Comments
Adding JDK-6868269 as related. I believe if we explicitly set the reexecute flag on any uncommon trap, then we will hit the assert in JDK-6868269. Does it make sense to always set the reexecute flag for uncommon traps, and make that part of the cleanup?
16-12-2021

Sounds good, thanks.
16-12-2021

Hi [~chagedorn], I'm not aware of any bug so an RFE likely makes more sense.
15-12-2021

Hi [~roland], this sounds more like a clean-up RFE. Or are there currently known bugs (after the fix for JDK-8275638 goes in) that can only be fixed by changing the exception propagation as suggested above?
15-12-2021