We currently always load the shared array classes in the boot loader:
https://github.com/openjdk/jdk/blob/939344b8433b32166f42ad73ae3d96e84b033478/src/hotspot/share/oops/instanceKlass.cpp#L2689
array_klasses()->restore_unshareable_info(ClassLoaderData::the_null_class_loader_data(), Handle(), CHECK);
This is incorrect. The obj array classes should be in the same loader that defines the ObjArrayKlass::_bottom_klass.
Currently, this bug is not causing problems because:
- for the static archive, we only archive object array classes from the boot loader
- for the dynamic archive, we don't archive any object array classes
However, we should fix this bug in preparation for future development, where we may need to archive archive object array classes for any loaders.
https://github.com/openjdk/jdk/blob/939344b8433b32166f42ad73ae3d96e84b033478/src/hotspot/share/oops/instanceKlass.cpp#L2689
array_klasses()->restore_unshareable_info(ClassLoaderData::the_null_class_loader_data(), Handle(), CHECK);
This is incorrect. The obj array classes should be in the same loader that defines the ObjArrayKlass::_bottom_klass.
Currently, this bug is not causing problems because:
- for the static archive, we only archive object array classes from the boot loader
- for the dynamic archive, we don't archive any object array classes
However, we should fix this bug in preparation for future development, where we may need to archive archive object array classes for any loaders.