TheRealMDoerr suggestions

This commit is contained in:
Dean Long 2025-06-12 12:40:03 -07:00
parent 726bddfb43
commit 88c1d72eda
2 changed files with 8 additions and 2 deletions

View File

@ -83,8 +83,11 @@ void BarrierSetNMethod::arm_with(nmethod* nm, int value) {
if (is_not_entrant(nm)) {
value |= not_entrant;
}
if (guard_value(nm) != value) {
// Patch the code only if needed.
set_guard_value(nm, value);
}
}
bool BarrierSetNMethod::is_armed(nmethod* nm) {
return (guard_value(nm) & ~not_entrant) != disarmed_guard_value();

View File

@ -113,8 +113,11 @@ void ZBarrierSetNMethod::arm_with(nmethod* nm, int value) {
if (is_not_entrant(nm)) {
value |= not_entrant;
}
if (guard_value(nm) != value) {
// Patch the code only if needed.
set_guard_value(nm, value);
}
}
bool ZBarrierSetNMethod::is_armed(nmethod* nm) {
int value = guard_value(nm) & ~not_entrant;