< prev index next >

src/hotspot/share/classfile/altHashing.cpp

Print this page
@@ -54,10 +54,13 @@
  // Get the hash code of the classes mirror if it exists, otherwise just
  // return a random number, which is one of the possible hash code used for
  // objects.  We don't want to call the synchronizer hash code to install
  // this value because it may safepoint.
  static intptr_t object_hash(Klass* k) {
+   if (UseCompactObjectHeaders) {
+     return os::random();
+   }
    intptr_t hc = k->java_mirror()->mark().hash();
    return hc != markWord::no_hash ? hc : os::random();
  }
  
  // Seed value used for each alternative hash calculated.
< prev index next >