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

[lworld] C1 support for array covariance for aaload

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • hotspot

      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));
          }
      }

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

              Created:
              Updated:
              Resolved: