< prev index next >

src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp

Print this page
*** 1702,12 ***
  
        // Save the test result, for recursive case, the result is zero
        __ sd(swap_reg, Address(lock_reg, mark_word_offset));
        __ bnez(swap_reg, slow_path_lock);
      } else {
!       assert(LockingMode == LM_LIGHTWEIGHT, "");
-       __ ld(swap_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
        __ lightweight_lock(obj_reg, swap_reg, tmp, lock_tmp, slow_path_lock);
      }
  
      __ bind(count);
      __ increment(Address(xthread, JavaThread::held_monitor_count_offset()));
--- 1702,11 ---
  
        // Save the test result, for recursive case, the result is zero
        __ sd(swap_reg, Address(lock_reg, mark_word_offset));
        __ bnez(swap_reg, slow_path_lock);
      } else {
!       assert(LockingMode == LM_LIGHTWEIGHT, "must be");
        __ lightweight_lock(obj_reg, swap_reg, tmp, lock_tmp, slow_path_lock);
      }
  
      __ bind(count);
      __ increment(Address(xthread, JavaThread::held_monitor_count_offset()));

*** 1829,13 ***
        __ cmpxchg_obj_header(x10, old_hdr, obj_reg, t0, count, &slow_path_unlock);
        __ bind(count);
        __ decrement(Address(xthread, JavaThread::held_monitor_count_offset()));
      } else {
        assert(LockingMode == LM_LIGHTWEIGHT, "");
-       __ ld(old_hdr, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
-       __ test_bit(t0, old_hdr, exact_log2(markWord::monitor_value));
-       __ bnez(t0, slow_path_unlock);
        __ lightweight_unlock(obj_reg, old_hdr, swap_reg, lock_tmp, slow_path_unlock);
        __ decrement(Address(xthread, JavaThread::held_monitor_count_offset()));
      }
  
      // slow path re-enters here
--- 1828,10 ---
< prev index next >