< prev index next >

src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp

Print this page
*** 58,14 ***
--- 58,16 ---
  
    size_t size = obj->size();
    // Copy object and reinit its mark.
    HeapWord* obj_addr = cast_from_oop<HeapWord*>(obj);
    HeapWord* destination = cast_from_oop<HeapWord*>(FullGCForwarding::forwardee(obj));
+   assert(obj_addr != destination, "only copy actually-moving objects");
    Copy::aligned_conjoint_words(obj_addr, destination, size);
  
    // There is no need to transform stack chunks - marking already did that.
    cast_to_oop(destination)->init_mark();
+   cast_to_oop(destination)->initialize_hash_if_necessary(obj);
    assert(cast_to_oop(destination)->klass() != nullptr, "should have a class");
  }
  
  void G1FullGCCompactTask::compact_region(G1HeapRegion* hr) {
    assert(!hr->has_pinned_objects(), "Should be no region with pinned objects in compaction queue");
< prev index next >