8259839: SystemDictionary exports too much implementation

Reviewed-by: iklam, dholmes
This commit is contained in:
Coleen Phillimore 2021-02-02 13:29:16 +00:00
parent 189b65b2ca
commit a421bfad28
6 changed files with 199 additions and 259 deletions

View file

@ -1046,7 +1046,7 @@ InstanceKlass* SystemDictionaryShared::find_or_load_shared_class(
k = load_shared_class_for_builtin_loader(name, class_loader, THREAD);
if (k != NULL) {
define_instance_class(k, class_loader, CHECK_NULL);
k = find_or_define_instance_class(name, class_loader, k, CHECK_NULL);
}
}
}
@ -1219,14 +1219,14 @@ bool SystemDictionaryShared::add_unregistered_class(InstanceKlass* k, TRAPS) {
}
// This function is called to resolve the super/interfaces of shared classes for
// non-built-in loaders. E.g., ChildClass in the below example
// non-built-in loaders. E.g., SharedClass in the below example
// where "super:" (and optionally "interface:") have been specified.
//
// java/lang/Object id: 0
// Interface id: 2 super: 0 source: cust.jar
// ChildClass id: 4 super: 0 interfaces: 2 source: cust.jar
// SharedClass id: 4 super: 0 interfaces: 2 source: cust.jar
InstanceKlass* SystemDictionaryShared::dump_time_resolve_super_or_fail(
Symbol* child_name, Symbol* class_name, Handle class_loader,
Symbol* class_name, Symbol* super_name, Handle class_loader,
Handle protection_domain, bool is_superclass, TRAPS) {
assert(DumpSharedSpaces, "only when dumping");
@ -1236,13 +1236,13 @@ InstanceKlass* SystemDictionaryShared::dump_time_resolve_super_or_fail(
// We're still loading the well-known classes, before the ClassListParser is created.
return NULL;
}
if (child_name->equals(parser->current_class_name())) {
if (class_name->equals(parser->current_class_name())) {
// When this function is called, all the numbered super and interface types
// must have already been loaded. Hence this function is never recursively called.
if (is_superclass) {
return parser->lookup_super_for_current_class(class_name);
return parser->lookup_super_for_current_class(super_name);
} else {
return parser->lookup_interface_for_current_class(class_name);
return parser->lookup_interface_for_current_class(super_name);
}
} else {
// The VM is not trying to resolve a super type of parser->current_class_name().