8210094: Better loading of classloader classes

Reviewed-by: acorn, hseigel, ahgross, rhalade
This commit is contained in:
Coleen Phillimore 2018-09-10 16:49:01 -04:00
parent 90aa9d02a4
commit e66dfd30c4
14 changed files with 369 additions and 81 deletions

View file

@ -861,8 +861,15 @@ InstanceKlass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
check_constraints(d_hash, k, class_loader, false, THREAD);
// Need to check for a PENDING_EXCEPTION again; check_constraints
// can throw and doesn't use the CHECK macro.
// can throw but we may have to remove entry from the placeholder table below.
if (!HAS_PENDING_EXCEPTION) {
// Record dependency for non-parent delegation.
// This recording keeps the defining class loader of the klass (k) found
// from being unloaded while the initiating class loader is loaded
// even if the reference to the defining class loader is dropped
// before references to the initiating class loader.
loader_data->record_dependency(k);
{ // Grabbing the Compile_lock prevents systemDictionary updates
// during compilations.
MutexLocker mu(Compile_lock, THREAD);
@ -2177,6 +2184,7 @@ void SystemDictionary::update_dictionary(unsigned int d_hash,
InstanceKlass* sd_check = find_class(d_hash, name, dictionary);
if (sd_check == NULL) {
dictionary->add_klass(d_hash, name, k);
notice_modification();
}
#ifdef ASSERT