Skip to content


8277411: C2 fast_unlock intrinsic on AArch64 has unnecessary ownershi…
Browse files Browse the repository at this point in the history
…p check

Backport-of: 3d810ad6912b7bca03e212b604cf60412da11c18
  • Loading branch information
Dmitry Chuyko authored and Paul Hohensee committed Sep 13, 2022
1 parent 061ddca commit b196bc4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/hotspot/cpu/aarch64/
Original file line number Diff line number Diff line change
Expand Up @@ -3913,19 +3913,15 @@ encode %{
__ bind(object_has_monitor);
STATIC_ASSERT(markWord::monitor_value <= INT_MAX);
__ add(tmp, tmp, -(int)markWord::monitor_value); // monitor
__ ldr(rscratch1, Address(tmp, ObjectMonitor::owner_offset_in_bytes()));
__ ldr(disp_hdr, Address(tmp, ObjectMonitor::recursions_offset_in_bytes()));

Label notRecursive;
__ cmp(rscratch1, rthread);
__ br(Assembler::NE, cont);

__ cbz(disp_hdr, notRecursive);

// Recursive lock
__ sub(disp_hdr, disp_hdr, 1u);
__ str(disp_hdr, Address(tmp, ObjectMonitor::recursions_offset_in_bytes()));
// flag == EQ was set in the ownership check above
__ cmp(disp_hdr, disp_hdr); // Sets flags for result
__ b(cont);

__ bind(notRecursive);
Expand Down

1 comment on commit b196bc4

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.