-
Enhancement
-
Resolution: Fixed
-
P5
-
17
-
b22
-
generic
-
generic
Move state_unloading_cycle computation after state_is_unloading checking in nmethod::is_unloading(). Avoiding useless state_unloading_cycle computation when state_is_unloading is true.
uint8_t state = RawAccess<MO_RELAXED>::load(&_is_unloading_state);
bool state_is_unloading = IsUnloadingState::is_unloading(state);
uint8_t state_unloading_cycle = IsUnloadingState::unloading_cycle(state); // compute early, useless if stat_is_unloading is true.
if (state_is_unloading) {
return true;
}
uint8_t current_cycle = CodeCache::unloading_cycle();
if (state_unloading_cycle == current_cycle) {
return false;
}
uint8_t state = RawAccess<MO_RELAXED>::load(&_is_unloading_state);
bool state_is_unloading = IsUnloadingState::is_unloading(state);
uint8_t state_unloading_cycle = IsUnloadingState::unloading_cycle(state); // compute early, useless if stat_is_unloading is true.
if (state_is_unloading) {
return true;
}
uint8_t current_cycle = CodeCache::unloading_cycle();
if (state_unloading_cycle == current_cycle) {
return false;
}