< prev index next >

src/hotspot/share/runtime/synchronizer.cpp

Print this page
@@ -24,10 +24,11 @@
  
  #include "precompiled.hpp"
  #include "classfile/vmSymbols.hpp"
  #include "gc/shared/suspendibleThreadSet.hpp"
  #include "jfr/jfrEvents.hpp"
+ #include "gc/shared/suspendibleThreadSet.hpp"
  #include "logging/log.hpp"
  #include "logging/logStream.hpp"
  #include "memory/allocation.inline.hpp"
  #include "memory/padded.hpp"
  #include "memory/resourceArea.hpp"

@@ -900,11 +901,11 @@
      v = (v ^ (v >> 19)) ^ (t ^ (t >> 8));
      current->_hashStateW = v;
      value = v;
    }
  
-   value &= markWord::hash_mask;
+   value &= UseCompactObjectHeaders ? markWord::hash_mask_compact : markWord::hash_mask;
    if (value == 0) value = 0xBAD;
    assert(value != markWord::no_hash, "invariant");
    return value;
  }
  

@@ -1707,10 +1708,13 @@
                       _in_use_list.count(), _in_use_list.max());
        }
  
        // A JavaThread needs to handshake in order to safely free the
        // ObjectMonitors that were deflated in this cycle.
+       // Also, we sync and desync GC threads around the handshake, so that they can
+       // safely read the mark-word and look-through to the object-monitor, without
+       // being afraid that the object-monitor is going away.
        HandshakeForDeflation hfd_hc;
        Handshake::execute(&hfd_hc);
        // Also, we sync and desync GC threads around the handshake, so that they can
        // safely read the mark-word and look-through to the object-monitor, without
        // being afraid that the object-monitor is going away.
< prev index next >