JDK-8306481 : Better handling of saturated values in Parse::dynamic_branch_prediction
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-04-19
  • Updated: 2023-04-20
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
Copied from JDK-8306331, regarding Parse::dynamic_branch_prediction():

... this code could handle saturated values better. The BranchData and JumpData counters are stored as uint and saturate at 0xffffffff, while scale_count() counters and return value use int and saturate at 0x7fffffff. We should be able to make a meaningful comparison between "taken" and "not_taken" paths with raw counter values up to 0xfffffffe, but the current code loses information converting to int. Also, the current code limits the sum of taken + not_taken to <= 0x7fffffff even if neither value is saturated. Finally, it seems like we should be able to compare 0 on one path to "saturated" on the other path, but again the current code doesn't allow that because a raw 0xffffffff saturated value becomes negative and is rejected.

See also Kim's suggestion in JDK-8306331 for using INT_MAX/2 as the saturated value.