< prev index next >

src/hotspot/share/gc/serial/defNewGeneration.cpp

Print this page
@@ -699,11 +699,11 @@
  }
  
  oop DefNewGeneration::copy_to_survivor_space(oop old) {
    assert(is_in_reserved(old) && !old->is_forwarded(),
           "shouldn't be scavenging this oop");
-   size_t s = old->size();
+   size_t s = old->compact_size();
    oop obj = NULL;
  
    // Try allocating obj in to-space (unless too old)
    if (old->age() < tenuring_threshold()) {
      obj = cast_to_oop(to()->allocate(s));

@@ -722,11 +722,11 @@
      // Prefetch beyond obj
      const intx interval = PrefetchCopyIntervalInBytes;
      Prefetch::write(obj, interval);
  
      // Copy obj
-     Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(old), cast_from_oop<HeapWord*>(obj), s);
+     old->copy_disjoint_compact(cast_from_oop<HeapWord*>(obj), s);
  
      // Increment age if obj still in new generation
      obj->incr_age();
      age_table()->add(obj, s);
    }
< prev index next >