< prev index next >

src/hotspot/share/gc/shared/preservedMarks.inline.hpp

Print this page
*** 46,11 ***
      push(obj, m);
    }
  }
  
  inline void PreservedMarks::init_forwarded_mark(oop obj) {
!   obj->init_mark();
  }
  
  inline PreservedMarks::PreservedMarks()
      : _stack(OopAndMarkWordStack::default_segment_size(),
               // This stack should be used very infrequently so there's
--- 46,24 ---
      push(obj, m);
    }
  }
  
  inline void PreservedMarks::init_forwarded_mark(oop obj) {
!   assert(obj->is_forwarded(), "only forwarded here");
+ #ifdef _LP64
+   oop forwardee = obj->forwardee();
+   markWord header = forwardee->mark();
+   if (header.has_displaced_mark_helper()) {
+     header = header.displaced_mark_helper();
+   }
+   assert(UseCompressedClassPointers, "assume +UseCompressedClassPointers");
+   narrowKlass nklass = header.narrow_klass();
+   assert(nklass == obj->narrow_klass_legacy(), "narrow klass must match: header: " PTR_FORMAT ", nklass: " PTR_FORMAT, forwardee->mark().value(), uintptr_t(nklass));
+   obj->set_mark(markWord::prototype().set_narrow_klass(nklass));
+ #else
+   obj->set_mark(markWord::prototype());
+ #endif
  }
  
  inline PreservedMarks::PreservedMarks()
      : _stack(OopAndMarkWordStack::default_segment_size(),
               // This stack should be used very infrequently so there's
< prev index next >