[lworld] TypeAryKlassPtr::cast_to_refined_array_klass_ptr looks suspicious

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • repo-valhalla
    • Affects Version/s: repo-valhalla
    • Component/s: hotspot

      I wonder what this method is trying to do. This method only does something if `klass_is_exact` is true. But in that case, the TypeAryKlassPtr is a constant already. Should `exact_klass` return the correct ciKlass?

      I believe there are 2 problems here:

      - It may create a nonsensical ciKlass (a non-atomic nullable array).
      - A TypeAryKlassPtr generally does not have a ciKlass, it only has that field for primitive arrays to differentiate boolean[], byte[], short[], char[], int[]. This fact is also kind of necessary, because there is no way to decide which would be the ciKlass for different kinds of T[] since there is no relationship between the nullable T[] and the null-restricted T[], especially if the type is not a constant. For arrays of value types, we also have different kinds of atomic refined types, too.

            Assignee:
            Quan Anh Mai
            Reporter:
            Quan Anh Mai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: