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