8029858: Enhance array copies
authordsimms
Fri, 10 Jan 2014 15:58:40 +0100
changeset 23841 f861d5d148bf
parent 23840 a1963807bff5
child 23875 9c5200481921
8029858: Enhance array copies Summary: Just read the source element once Reviewed-by: coleenp, ahgross
hotspot/src/share/vm/oops/objArrayKlass.cpp
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp	Thu Feb 20 13:11:23 2014 -0500
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp	Fri Jan 10 15:58:40 2014 +0100
@@ -269,7 +269,7 @@
         if (element_is_null ||
             (new_val->klass())->is_subtype_of(bound)) {
           bs->write_ref_field_pre(p, new_val);
-          *p = *from;
+          *p = element;
         } else {
           // We must do a barrier to cover the partial copy.
           const size_t pd = pointer_delta(p, dst, (size_t)heapOopSize);