< prev index next >

src/hotspot/share/cds/archiveHeapWriter.cpp

Print this page
@@ -531,13 +531,13 @@
    oop fake_oop = cast_to_oop(buffered_addr);
    fake_oop->set_narrow_klass(nk);
  
    // We need to retain the identity_hash, because it may have been used by some hashtables
    // in the shared heap.
-   if (src_obj != nullptr && !src_obj->fast_no_hash_check()) {
+   if (src_obj != nullptr && !src_obj->fast_no_hash_check() && (!(EnableValhalla && src_obj->mark().is_inline_type()))) {
      intptr_t src_hash = src_obj->identity_hash();
-     fake_oop->set_mark(markWord::prototype().copy_set_hash(src_hash));
+     fake_oop->set_mark(src_klass->prototype_header().copy_set_hash(src_hash));
      assert(fake_oop->mark().is_unlocked(), "sanity");
  
      DEBUG_ONLY(intptr_t archived_hash = fake_oop->identity_hash());
      assert(src_hash == archived_hash, "Different hash codes: original " INTPTR_FORMAT ", archived " INTPTR_FORMAT, src_hash, archived_hash);
    }
< prev index next >