< prev index next >

src/hotspot/cpu/x86/sharedRuntime_x86.cpp

Print this page
@@ -24,10 +24,11 @@
  
  #include "precompiled.hpp"
  #include "asm/macroAssembler.hpp"
  #include "runtime/interfaceSupport.inline.hpp"
  #include "runtime/sharedRuntime.hpp"
+ #include "utilities/globalDefinitions.hpp"
  #include "vmreg_x86.inline.hpp"
  #ifdef COMPILER1
  #include "c1/c1_Runtime1.hpp"
  #endif //COMPILER1
  

@@ -57,21 +58,33 @@
      __ bind(Continue);
    }
  
    __ movptr(result, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
  
-   // check if locked
-   __ testptr(result, markWord::unlocked_value);
-   __ jcc(Assembler::zero, slowCase);
+ 
+   if (LockingMode == LM_LIGHTWEIGHT) {
+     // check if monitor
+     __ testptr(result, markWord::monitor_value);
+     __ jcc(Assembler::notZero, slowCase);
+   } else {
+     // check if locked
+     __ testptr(result, markWord::unlocked_value);
+     __ jcc(Assembler::zero, slowCase);
+   }
  
    // get hash
  #ifdef _LP64
    // Read the header and build a mask to get its hash field.
    // Depend on hash_mask being at most 32 bits and avoid the use of hash_mask_in_place
    // because it could be larger than 32 bits in a 64-bit vm. See markWord.hpp.
-   __ shrptr(result, markWord::hash_shift);
-   __ andptr(result, markWord::hash_mask);
+   if (UseCompactObjectHeaders) {
+     __ shrptr(result, markWord::hash_shift_compact);
+     __ andptr(result, markWord::hash_mask_compact);
+   } else {
+     __ shrptr(result, markWord::hash_shift);
+     __ andptr(result, markWord::hash_mask);
+   }
  #else
    __ andptr(result, markWord::hash_mask_in_place);
  #endif //_LP64
  
    // test if hashCode exists
< prev index next >