859 !oopDesc::equals(k->class_loader(), class_loader())) { |
859 !oopDesc::equals(k->class_loader(), class_loader())) { |
860 |
860 |
861 check_constraints(d_hash, k, class_loader, false, THREAD); |
861 check_constraints(d_hash, k, class_loader, false, THREAD); |
862 |
862 |
863 // Need to check for a PENDING_EXCEPTION again; check_constraints |
863 // Need to check for a PENDING_EXCEPTION again; check_constraints |
864 // can throw and doesn't use the CHECK macro. |
864 // can throw but we may have to remove entry from the placeholder table below. |
865 if (!HAS_PENDING_EXCEPTION) { |
865 if (!HAS_PENDING_EXCEPTION) { |
|
866 // Record dependency for non-parent delegation. |
|
867 // This recording keeps the defining class loader of the klass (k) found |
|
868 // from being unloaded while the initiating class loader is loaded |
|
869 // even if the reference to the defining class loader is dropped |
|
870 // before references to the initiating class loader. |
|
871 loader_data->record_dependency(k); |
|
872 |
866 { // Grabbing the Compile_lock prevents systemDictionary updates |
873 { // Grabbing the Compile_lock prevents systemDictionary updates |
867 // during compilations. |
874 // during compilations. |
868 MutexLocker mu(Compile_lock, THREAD); |
875 MutexLocker mu(Compile_lock, THREAD); |
869 update_dictionary(d_hash, p_index, p_hash, |
876 update_dictionary(d_hash, p_index, p_hash, |
870 k, class_loader, THREAD); |
877 k, class_loader, THREAD); |
2175 // Make a new dictionary entry. |
2182 // Make a new dictionary entry. |
2176 Dictionary* dictionary = loader_data->dictionary(); |
2183 Dictionary* dictionary = loader_data->dictionary(); |
2177 InstanceKlass* sd_check = find_class(d_hash, name, dictionary); |
2184 InstanceKlass* sd_check = find_class(d_hash, name, dictionary); |
2178 if (sd_check == NULL) { |
2185 if (sd_check == NULL) { |
2179 dictionary->add_klass(d_hash, name, k); |
2186 dictionary->add_klass(d_hash, name, k); |
|
2187 |
2180 notice_modification(); |
2188 notice_modification(); |
2181 } |
2189 } |
2182 #ifdef ASSERT |
2190 #ifdef ASSERT |
2183 sd_check = find_class(d_hash, name, dictionary); |
2191 sd_check = find_class(d_hash, name, dictionary); |
2184 assert (sd_check != NULL, "should have entry in dictionary"); |
2192 assert (sd_check != NULL, "should have entry in dictionary"); |