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

[lworld][c1] NewMultiArray should preserve type information

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • repo-valhalla
    • repo-valhalla
    • hotspot

      For code like this:

             0: bipush 9
             2: iconst_2
             3: multianewarray #2, 2 // class "[[QPoint;"
             7: astore_3
             8: aload_3
             9: iload_1
            10: aaload <<<<< should be loading from "[[QPoint;"
            11: iload_2
            12: aload_0
            13: aastore <<<<< should be storing to "[QPoint;"
            14: aload_3
            15: areturn

      The multianewarray instruction at bci#3 throws away the type information. I.e., NewMultiArray::exact_type() returns NULL.

      When we get to the aaload at bci#10, we only know that the operand is a T_OBJECT.

      When we get to the aastore at bci#13, we only know that the operand is a T_OBJECT, so we don't know that the array is actually flattened.

      The fix is to implement this function properly:

      ciType* NewMultiArray::exact_type() const {
        return _klass;
      }



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

              Created:
              Updated:
              Resolved: