src/share/vm/oops/objArrayKlass.cpp

Print this page
rev 4051 : 8029858: Enhance array copies
Summary: Just read the source element once
Reviewed-by: coleenp, ahgross

*** 147,157 **** oop new_val = element_is_null ? oop(NULL) : oopDesc::decode_heap_oop_not_null(element); if (element_is_null || Klass::cast((new_val->klass()))->is_subtype_of(bound)) { bs->write_ref_field_pre(p, new_val); ! *p = *from; } else { // We must do a barrier to cover the partial copy. const size_t pd = pointer_delta(p, dst, (size_t)heapOopSize); // pointer delta is scaled to number of elements (length field in // objArrayOop) which we assume is 32 bit. --- 147,157 ---- oop new_val = element_is_null ? oop(NULL) : oopDesc::decode_heap_oop_not_null(element); if (element_is_null || Klass::cast((new_val->klass()))->is_subtype_of(bound)) { bs->write_ref_field_pre(p, new_val); ! *p = element; } else { // We must do a barrier to cover the partial copy. const size_t pd = pointer_delta(p, dst, (size_t)heapOopSize); // pointer delta is scaled to number of elements (length field in // objArrayOop) which we assume is 32 bit.