diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 40b57e7fb85..119367578a9 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -3866,7 +3866,7 @@ encode %{ // Handle existing monitor. __ ldr(tmp, Address(oop, oopDesc::mark_offset_in_bytes())); - __ tbnz(disp_hdr, exact_log2(markWord::monitor_value), object_has_monitor); + __ tbnz(tmp, exact_log2(markWord::monitor_value), object_has_monitor); if (!UseHeavyMonitors) { // Check if it is still a light weight lock, this is is true if we diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad index 75612ef7508..abe0f609a62 100644 --- a/src/hotspot/cpu/riscv/riscv.ad +++ b/src/hotspot/cpu/riscv/riscv.ad @@ -2474,7 +2474,7 @@ encode %{ // Handle existing monitor. __ ld(tmp, Address(oop, oopDesc::mark_offset_in_bytes())); - __ andi(t0, disp_hdr, markWord::monitor_value); + __ andi(t0, tmp, markWord::monitor_value); __ bnez(t0, object_has_monitor); if (!UseHeavyMonitors) {