Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8218142

[lworld] C1 support for array covariance for aaload

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      C1 should support loading of elements in a flattened array, even if the array has been casted to an Object[].

      Example:

      public class CovLoad {
          static final value class V {
              final int v0 = 0, v1 = 0;
          }

          static Object test(Object arr[], int i) {
              return arr[i]; // << HERE
          }

          static Object[] cast(Object arr) {
              return (Object[])arr;
          }

          public static void main(String args[]) {
              V[] arr = new V[1];
              arr[0] = V.default;
              Object[] oarr = cast(arr);
              System.out.println(test(oarr, 1));
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              iklam Ioi Lam
              Reporter:
              iklam Ioi Lam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: