Skip to content

Commit a28d30c

Browse files
committedMar 25, 2024
8319900: Recursive lightweight locking: riscv64 implementation
Backport-of: e1b661f8c1df780cce28fe76d257b44e2fe44058
1 parent 455ada6 commit a28d30c

9 files changed

+499
-202
lines changed
 

‎src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,12 @@ int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr
6969
bnez(temp, slow_case, true /* is_far */);
7070
}
7171

72-
// Load object header
73-
ld(hdr, Address(obj, hdr_offset));
74-
7572
if (LockingMode == LM_LIGHTWEIGHT) {
7673
lightweight_lock(obj, hdr, temp, t1, slow_case);
7774
} else if (LockingMode == LM_LEGACY) {
7875
Label done;
76+
// Load object header
77+
ld(hdr, Address(obj, hdr_offset));
7978
// and mark it as unlocked
8079
ori(hdr, hdr, markWord::unlocked_value);
8180
// save unlocked object header into the displaced header location on the stack
@@ -134,9 +133,6 @@ void C1_MacroAssembler::unlock_object(Register hdr, Register obj, Register disp_
134133
verify_oop(obj);
135134

136135
if (LockingMode == LM_LIGHTWEIGHT) {
137-
ld(hdr, Address(obj, oopDesc::mark_offset_in_bytes()));
138-
test_bit(temp, hdr, exact_log2(markWord::monitor_value));
139-
bnez(temp, slow_case, /* is_far */ true);
140136
lightweight_unlock(obj, hdr, temp, t1, slow_case);
141137
} else if (LockingMode == LM_LEGACY) {
142138
// test if object header is pointing to the displaced header, and if so, restore

0 commit comments

Comments
 (0)
Please sign in to comment.