JDK-8276116 : C2: optimize long range checks in int counted loops
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-10-28
  • Updated: 2022-02-07
  • Resolved: 2021-12-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.
JDK 18 JDK 19
18 b28Fixed 19Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Similar to JDK-8259609 but for loop and range checks of the shape:

for (int i = start; i < stop; i += inc) {
  Objects.checkIndex(scale * ((long)i) + offset, length);
}

and

for (int i = start; i < stop; i += inc) {
  Objects.checkIndex(((long)(scale * i)) + offset, length);
}
Comments
Changeset: b3faecf7 Author: Roland Westrelin <roland@openjdk.org> Date: 2021-12-08 21:33:33 +0000 URL: https://git.openjdk.java.net/jdk/commit/b3faecf73966ce0435644a89f8f43d85720e8328
08-12-2021