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

Clean up InstanceKlass::_array_klasses

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 15
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      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

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

              Dates

              Created:
              Updated:
              Resolved: