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

Clean up InstanceKlass::_array_klasses

XMLWordPrintable

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

      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).

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

              Created:
              Updated:
              Resolved: