< prev index next > src/hotspot/cpu/riscv/interp_masm_riscv.cpp
Print this page
test_bit(tmp, tmp, exact_log2(JVM_ACC_IS_VALUE_BASED_CLASS));
bnez(tmp, slow_case);
}
if (LockingMode == LM_LIGHTWEIGHT) {
- ld(tmp, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
lightweight_lock(obj_reg, tmp, tmp2, tmp3, slow_case);
j(count);
} else if (LockingMode == LM_LEGACY) {
// Load (object->mark() | 1) into swap_reg
ld(t0, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
// Free entry
sd(zr, Address(lock_reg, BasicObjectLock::obj_offset()));
if (LockingMode == LM_LIGHTWEIGHT) {
Label slow_case;
-
- // Check for non-symmetric locking. This is allowed by the spec and the interpreter
- // must handle it.
- Register tmp1 = t0;
- Register tmp2 = header_reg;
- // First check for lock-stack underflow.
- lwu(tmp1, Address(xthread, JavaThread::lock_stack_top_offset()));
- mv(tmp2, (unsigned)LockStack::start_offset());
- ble(tmp1, tmp2, slow_case);
- // Then check if the top of the lock-stack matches the unlocked object.
- subw(tmp1, tmp1, oopSize);
- add(tmp1, xthread, tmp1);
- ld(tmp1, Address(tmp1, 0));
- bne(tmp1, obj_reg, slow_case);
-
- ld(header_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
- test_bit(t0, header_reg, exact_log2(markWord::monitor_value));
- bnez(t0, slow_case);
lightweight_unlock(obj_reg, header_reg, swap_reg, tmp_reg, slow_case);
j(count);
bind(slow_case);
} else if (LockingMode == LM_LEGACY) {
< prev index next >