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

Clean up InstanceKlass::_array_klasses

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 15
    • 15
    • hotspot
    • b22

    Description

      This name is confusing, as the field points just a single ArrayKlass, not a bunch of ArrayKlasses. It should also be an ObjArrayKlass* type instead of Klass*.

      class InstanceKlass: public Klass {
        // Array classes holding elements of this class.
        Klass* volatile _array_klasses;
        Klass* array_klasses() const { return _array_klasses; }

      There are other functions that always return ObjArrayKlass*, but are declared to return Klass*. This cause unnecessary type casting in their callers, so should also be fixed. E.g.,

      Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data, int n, Klass* element_klass, TRAPS).

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: