< prev index next >

src/hotspot/share/oops/klass.cpp

Print this page

        

*** 360,370 **** // May be cleaned concurrently, so must use the Compile_lock. // The log parameter is for clean_weak_klass_links to report unlinked classes. Klass* Klass::subklass(bool log) const { // Need load_acquire on the _subklass, because it races with inserts that // publishes freshly initialized data. ! for (Klass* chain = OrderAccess::load_acquire(&_subklass); chain != NULL; // Do not need load_acquire on _next_sibling, because inserts never // create _next_sibling edges to dead data. chain = Atomic::load(&chain->_next_sibling)) { --- 360,370 ---- // May be cleaned concurrently, so must use the Compile_lock. // The log parameter is for clean_weak_klass_links to report unlinked classes. Klass* Klass::subklass(bool log) const { // Need load_acquire on the _subklass, because it races with inserts that // publishes freshly initialized data. ! for (Klass* chain = Atomic::load_acquire(&_subklass); chain != NULL; // Do not need load_acquire on _next_sibling, because inserts never // create _next_sibling edges to dead data. chain = Atomic::load(&chain->_next_sibling)) {
*** 400,410 **** return NULL; } void Klass::set_subklass(Klass* s) { assert(s != this, "sanity check"); ! OrderAccess::release_store(&_subklass, s); } void Klass::set_next_sibling(Klass* s) { assert(s != this, "sanity check"); // Does not need release semantics. If used by cleanup, it will link to --- 400,410 ---- return NULL; } void Klass::set_subklass(Klass* s) { assert(s != this, "sanity check"); ! Atomic::release_store(&_subklass, s); } void Klass::set_next_sibling(Klass* s) { assert(s != this, "sanity check"); // Does not need release semantics. If used by cleanup, it will link to
*** 425,435 **** // Make sure there is no stale subklass head super->clean_subklass(); for (;;) { ! Klass* prev_first_subklass = OrderAccess::load_acquire(&_super->_subklass); if (prev_first_subklass != NULL) { // set our sibling to be the superklass' previous first subklass assert(prev_first_subklass->is_loader_alive(), "May not attach not alive klasses"); set_next_sibling(prev_first_subklass); } --- 425,435 ---- // Make sure there is no stale subklass head super->clean_subklass(); for (;;) { ! Klass* prev_first_subklass = Atomic::load_acquire(&_super->_subklass); if (prev_first_subklass != NULL) { // set our sibling to be the superklass' previous first subklass assert(prev_first_subklass->is_loader_alive(), "May not attach not alive klasses"); set_next_sibling(prev_first_subklass); }
*** 444,454 **** } void Klass::clean_subklass() { for (;;) { // Need load_acquire, due to contending with concurrent inserts ! Klass* subklass = OrderAccess::load_acquire(&_subklass); if (subklass == NULL || subklass->is_loader_alive()) { return; } // Try to fix _subklass until it points at something not dead. Atomic::cmpxchg(subklass->next_sibling(), &_subklass, subklass); --- 444,454 ---- } void Klass::clean_subklass() { for (;;) { // Need load_acquire, due to contending with concurrent inserts ! Klass* subklass = Atomic::load_acquire(&_subklass); if (subklass == NULL || subklass->is_loader_alive()) { return; } // Try to fix _subklass until it points at something not dead. Atomic::cmpxchg(subklass->next_sibling(), &_subklass, subklass);
< prev index next >