src/hotspot/share/oops/klass.cpp
changeset 59252 623722a6aeb9
parent 59249 29b0d0b61615
child 59290 97d13893ec3c
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
   434       set_next_sibling(prev_first_subklass);
   434       set_next_sibling(prev_first_subklass);
   435     }
   435     }
   436     // Note that the prev_first_subklass is always alive, meaning no sibling_next links
   436     // Note that the prev_first_subklass is always alive, meaning no sibling_next links
   437     // are ever created to not alive klasses. This is an important invariant of the lock-free
   437     // are ever created to not alive klasses. This is an important invariant of the lock-free
   438     // cleaning protocol, that allows us to safely unlink dead klasses from the sibling list.
   438     // cleaning protocol, that allows us to safely unlink dead klasses from the sibling list.
   439     if (Atomic::cmpxchg(this, &super->_subklass, prev_first_subklass) == prev_first_subklass) {
   439     if (Atomic::cmpxchg(&super->_subklass, prev_first_subklass, this) == prev_first_subklass) {
   440       return;
   440       return;
   441     }
   441     }
   442   }
   442   }
   443   debug_only(verify();)
   443   debug_only(verify();)
   444 }
   444 }
   449     Klass* subklass = Atomic::load_acquire(&_subklass);
   449     Klass* subklass = Atomic::load_acquire(&_subklass);
   450     if (subklass == NULL || subklass->is_loader_alive()) {
   450     if (subklass == NULL || subklass->is_loader_alive()) {
   451       return;
   451       return;
   452     }
   452     }
   453     // Try to fix _subklass until it points at something not dead.
   453     // Try to fix _subklass until it points at something not dead.
   454     Atomic::cmpxchg(subklass->next_sibling(), &_subklass, subklass);
   454     Atomic::cmpxchg(&_subklass, subklass, subklass->next_sibling());
   455   }
   455   }
   456 }
   456 }
   457 
   457 
   458 void Klass::clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses) {
   458 void Klass::clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses) {
   459   if (!ClassUnloading || !unloading_occurred) {
   459   if (!ClassUnloading || !unloading_occurred) {