8189123: More consistent classloading
Reviewed-by: acorn, ahgross, rhalade
This commit is contained in:
parent
278672706d
commit
f988f60dc8
@ -50,6 +50,7 @@ bool VerificationType::resolve_and_check_assignability(InstanceKlass* klass, Sym
|
||||
Klass* this_class = SystemDictionary::resolve_or_fail(
|
||||
name, Handle(THREAD, klass->class_loader()),
|
||||
Handle(THREAD, klass->protection_domain()), true, CHECK_false);
|
||||
klass->class_loader_data()->record_dependency(this_class);
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
Verifier::trace_class_resolution(this_class, klass);
|
||||
}
|
||||
@ -67,6 +68,7 @@ bool VerificationType::resolve_and_check_assignability(InstanceKlass* klass, Sym
|
||||
Klass* from_class = SystemDictionary::resolve_or_fail(
|
||||
from_name, Handle(THREAD, klass->class_loader()),
|
||||
Handle(THREAD, klass->protection_domain()), true, CHECK_false);
|
||||
klass->class_loader_data()->record_dependency(from_class);
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
Verifier::trace_class_resolution(from_class, klass);
|
||||
}
|
||||
|
@ -2013,9 +2013,12 @@ Klass* ClassVerifier::load_class(Symbol* name, TRAPS) {
|
||||
name, Handle(THREAD, loader), Handle(THREAD, protection_domain),
|
||||
true, THREAD);
|
||||
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
InstanceKlass* cur_class = InstanceKlass::cast(current_class());
|
||||
Verifier::trace_class_resolution(kls, cur_class);
|
||||
if (kls != NULL) {
|
||||
current_class()->class_loader_data()->record_dependency(kls);
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
InstanceKlass* cur_class = InstanceKlass::cast(current_class());
|
||||
Verifier::trace_class_resolution(kls, cur_class);
|
||||
}
|
||||
}
|
||||
return kls;
|
||||
}
|
||||
|
@ -839,6 +839,11 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name,
|
||||
Handle h_prot (THREAD, protection_domain);
|
||||
jclass result = find_class_from_class_loader(env, h_name, init, h_loader,
|
||||
h_prot, true, thread);
|
||||
if (result != NULL) {
|
||||
oop mirror = JNIHandles::resolve_non_null(result);
|
||||
Klass* to_class = java_lang_Class::as_Klass(mirror);
|
||||
ClassLoaderData::class_loader_data(h_loader())->record_dependency(to_class);
|
||||
}
|
||||
|
||||
if (log_is_enabled(Debug, class, resolve) && result != NULL) {
|
||||
// this function is generally only used for class loading during verification.
|
||||
|
Loading…
Reference in New Issue
Block a user