< prev index next >

src/hotspot/share/gc/shared/generation.cpp

Print this page
@@ -154,21 +154,21 @@
    return res;
  }
  
  // Ignores "ref" and calls allocate().
  oop Generation::promote(oop obj, size_t obj_size) {
-   assert(obj_size == (size_t)obj->size(), "bad obj_size passed in");
+   assert(obj_size == (size_t)obj->compact_size(), "bad obj_size passed in");
  
  #ifndef PRODUCT
    if (GenCollectedHeap::heap()->promotion_should_fail()) {
      return NULL;
    }
  #endif  // #ifndef PRODUCT
  
    HeapWord* result = allocate(obj_size, false);
    if (result != NULL) {
-     Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(obj), result, obj_size);
+     obj->copy_disjoint_compact(result, obj_size);
      return cast_to_oop(result);
    } else {
      GenCollectedHeap* gch = GenCollectedHeap::heap();
      return gch->handle_failed_promotion(this, obj, obj_size);
    }
< prev index next >