8198313: Wrap holder object for ClassLoaderData in a WeakHandle

Use WeakHandle for ClassLoaderData::_holder so that is_alive closure is not needed

Reviewed-by: rehn, kbarrett
This commit is contained in:
Coleen Phillimore 2018-04-10 10:06:42 -04:00
parent 21f636f3cf
commit d187884156
13 changed files with 273 additions and 48 deletions

View file

@ -1901,7 +1901,7 @@ void InstanceKlass::clean_weak_instanceklass_links(BoolObjectClosure* is_alive)
}
void InstanceKlass::clean_implementors_list(BoolObjectClosure* is_alive) {
assert(class_loader_data()->is_alive(is_alive), "this klass should be live");
assert(class_loader_data()->is_alive(), "this klass should be live");
if (is_interface()) {
if (ClassUnloading) {
Klass* impl = implementor();
@ -3407,14 +3407,8 @@ void JNIid::verify(Klass* holder) {
}
}
oop InstanceKlass::klass_holder_phantom() {
oop* addr;
if (is_anonymous()) {
addr = _java_mirror.ptr_raw();
} else {
addr = &class_loader_data()->_class_loader;
}
return RootAccess<IN_CONCURRENT_ROOT | ON_PHANTOM_OOP_REF>::oop_load(addr);
oop InstanceKlass::holder_phantom() const {
return class_loader_data()->holder_phantom();
}
#ifdef ASSERT