< prev index next >

src/hotspot/cpu/x86/interp_masm_x86.cpp

Print this page
*** 1181,15 ***
      }
  
      if (LockingMode == LM_LIGHTWEIGHT) {
  #ifdef _LP64
        const Register thread = r15_thread;
  #else
!       const Register thread = lock_reg;
!       get_thread(thread);
  #endif
-       lightweight_lock(obj_reg, swap_reg, thread, tmp_reg, slow_case);
      } else if (LockingMode == LM_LEGACY) {
        // Load immediate 1 into swap_reg %rax
        movl(swap_reg, 1);
  
        // Load (object->mark() | 1) into swap_reg %rax
--- 1181,15 ---
      }
  
      if (LockingMode == LM_LIGHTWEIGHT) {
  #ifdef _LP64
        const Register thread = r15_thread;
+       lightweight_lock(lock_reg, obj_reg, swap_reg, thread, tmp_reg, slow_case);
  #else
!       // Lacking registers and thread on x86_32. Always take slow path.
!       jmp(slow_case);
  #endif
      } else if (LockingMode == LM_LEGACY) {
        // Load immediate 1 into swap_reg %rax
        movl(swap_reg, 1);
  
        // Load (object->mark() | 1) into swap_reg %rax

*** 1247,19 ***
      jmp(done);
  
      bind(slow_case);
  
      // Call the runtime routine for slow case
!     if (LockingMode == LM_LIGHTWEIGHT) {
!       call_VM(noreg,
!               CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter_obj),
-               obj_reg);
-     } else {
-       call_VM(noreg,
-               CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
-               lock_reg);
-     }
      bind(done);
    }
  }
  
  
--- 1247,13 ---
      jmp(done);
  
      bind(slow_case);
  
      // Call the runtime routine for slow case
!     call_VM(noreg,
!             CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
!             lock_reg);
      bind(done);
    }
  }
  
  

*** 1304,14 ***
  
      if (LockingMode == LM_LIGHTWEIGHT) {
  #ifdef _LP64
        lightweight_unlock(obj_reg, swap_reg, r15_thread, header_reg, slow_case);
  #else
!       // This relies on the implementation of lightweight_unlock being able to handle
!       // that the reg_rax and thread Register parameters may alias each other.
-       get_thread(swap_reg);
-       lightweight_unlock(obj_reg, swap_reg, swap_reg, header_reg, slow_case);
  #endif
      } else if (LockingMode == LM_LEGACY) {
        // Load the old header from BasicLock structure
        movptr(header_reg, Address(swap_reg,
                                   BasicLock::displaced_header_offset_in_bytes()));
--- 1298,12 ---
  
      if (LockingMode == LM_LIGHTWEIGHT) {
  #ifdef _LP64
        lightweight_unlock(obj_reg, swap_reg, r15_thread, header_reg, slow_case);
  #else
!       // Lacking registers and thread on x86_32. Always take slow path.
!       jmp(slow_case);
  #endif
      } else if (LockingMode == LM_LEGACY) {
        // Load the old header from BasicLock structure
        movptr(header_reg, Address(swap_reg,
                                   BasicLock::displaced_header_offset_in_bytes()));
< prev index next >