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,7 +83,10 @@ void BarrierSetNMethod::arm_with(nmethod* nm, int value) {
if (is_not_entrant(nm)) { if (is_not_entrant(nm)) {
value |= not_entrant; value |= not_entrant;
} }
set_guard_value(nm, value); if (guard_value(nm) != value) {
// Patch the code only if needed.
set_guard_value(nm, value);
}
} }
bool BarrierSetNMethod::is_armed(nmethod* nm) { bool BarrierSetNMethod::is_armed(nmethod* nm) {

View File

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