JDK-8239142 : C2's UseUniqueSubclasses optimization is broken for array accesses
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12,13,14,15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-02-17
  • Updated: 2020-06-04
  • Resolved: 2020-02-18
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 11 JDK 13 JDK 14 JDK 15
11.0.8-oracleFixed 13.0.4Fixed 14.0.2Fixed 15 b11Fixed
Related Reports
Relates :  
Description
If UseUniqueSubclasses is enabled, C2 tries to narrow the type of array elements on access to avoid type checks:
http://hg.openjdk.java.net/jdk/jdk/file/690fc7e5a90f/src/hotspot/share/opto/parse2.cpp#l126

But the fix for JDK-8202377 added code that overwrites the elemtype:
http://hg.openjdk.java.net/jdk/jdk/rev/ffa644980dff#l27.26

Comments
Fix Request (13u) This fixes the performance regression bugs. Patch applies cleanly to 13u. Patched JDK passes tier1 tests.
04-06-2020

Fix Request (JDK 14.0.2) This patch fixes a performance regression due to a broken optimization in C2 and has already been backported to JDK 11u. The fix is low risk and applies cleanly to JDK 14.0.2. In addition to CI testing through all tiers in JDK 15 and 11u, additional testing will be executed in JDK 14.0.2 before pushing.
06-03-2020

Fix Request (11u) This fixes the performance regression bugs and keeps codebases in sync (I see 11.0.8-oracle). Patch applies cleanly to 11u. Patched JDK passes tier{1,2,3} tests.
29-02-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/83949f956490 User: thartmann Date: 2020-02-18 07:28:33 +0000
18-02-2020

http://cr.openjdk.java.net/~thartmann/8239142/webrev.00/
17-02-2020

ILW = Array access optimization in C2 is broken (only affects performance), access to array of an abstract type with only one implementor, no workaround = MMH = P3
17-02-2020