< prev index next >

src/hotspot/share/code/nmethod.cpp


*** 1571,1588 **** bool state_is_unloading = IsUnloadingState::is_unloading(state); uint8_t state_unloading_cycle = IsUnloadingState::unloading_cycle(state); if (state_is_unloading) { return true; } ! if (state_unloading_cycle == CodeCache::unloading_cycle()) { return false; } // The IsUnloadingBehaviour is responsible for checking if there are any dead // oops in the CompiledMethod, by calling oops_do on it. ! state_unloading_cycle = CodeCache::unloading_cycle(); ! state_is_unloading = IsUnloadingBehaviour::current()->is_unloading(this); state = IsUnloadingState::create(state_is_unloading, state_unloading_cycle); RawAccess<MO_RELAXED>::store(&_is_unloading_state, state); --- 1571,1595 ---- bool state_is_unloading = IsUnloadingState::is_unloading(state); uint8_t state_unloading_cycle = IsUnloadingState::unloading_cycle(state); if (state_is_unloading) { return true; } ! uint8_t current_cycle = CodeCache::unloading_cycle(); ! if (state_unloading_cycle == current_cycle) { return false; } // The IsUnloadingBehaviour is responsible for checking if there are any dead // oops in the CompiledMethod, by calling oops_do on it. ! state_unloading_cycle = current_cycle; ! ! if (is_zombie()) { ! // Zombies without calculated unloading epoch are never unloading due to GC. ! state_is_unloading = false; ! } else { ! state_is_unloading = IsUnloadingBehaviour::current()->is_unloading(this); ! } state = IsUnloadingState::create(state_is_unloading, state_unloading_cycle); RawAccess<MO_RELAXED>::store(&_is_unloading_state, state);
< prev index next >