8210926: vmTestbase/nsk/jvmti/scenarios/allocation/AP11/ap11t001/TestDescription.java failed with JVMTI_ERROR_INVALID_CLASS in CDS mode

Reset InstanceKlass _init_state to 'allocated' before writing out shared classes at dump time.

Reviewed-by: dholmes, coleenp
This commit is contained in:
Jiangli Zhou 2018-10-01 00:52:37 -04:00
parent 0746fffe5c
commit 061c4d7a81
3 changed files with 15 additions and 14 deletions

View file

@ -338,6 +338,11 @@ void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) {
for (Klass* k = OrderAccess::load_acquire(&_klasses); k != NULL; k = k->next_link()) {
// Do not filter ArrayKlass oops here...
if (k->is_array_klass() || (k->is_instance_klass() && InstanceKlass::cast(k)->is_loaded())) {
#ifdef ASSERT
oop m = k->java_mirror();
assert(m != NULL, "NULL mirror");
assert(m->is_a(SystemDictionary::Class_klass()), "invalid mirror");
#endif
klass_closure->do_klass(k);
}
}