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