8008549: NPG: SystemDictionary::find(...) unnecessarily keeps class loaders alive

SystemDictionary::find(...) should not create and register ClassLoaderData objects for class loaders.

Co-authored-by: Erik Helin <erik.helin@oracle.com>
Reviewed-by: coleenp, acorn
This commit is contained in:
Stefan Karlsson 2013-02-21 17:22:15 +01:00
parent 1a74b23a2f
commit 9ed09d08f5
4 changed files with 20 additions and 6 deletions

View file

@ -866,16 +866,22 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
// the new entry.
Klass* SystemDictionary::find(Symbol* class_name,
Handle class_loader,
Handle protection_domain,
TRAPS) {
Handle class_loader,
Handle protection_domain,
TRAPS) {
// UseNewReflection
// The result of this call should be consistent with the result
// of the call to resolve_instance_class_or_null().
// See evaluation 6790209 and 4474172 for more details.
class_loader = Handle(THREAD, java_lang_ClassLoader::non_reflection_class_loader(class_loader()));
ClassLoaderData* loader_data = register_loader(class_loader, CHECK_NULL);
ClassLoaderData* loader_data = ClassLoaderData::class_loader_data_or_null(class_loader());
if (loader_data == NULL) {
// If the ClassLoaderData has not been setup,
// then the class loader has no entries in the dictionary.
return NULL;
}
unsigned int d_hash = dictionary()->compute_hash(class_name, loader_data);
int d_index = dictionary()->hash_to_index(d_hash);