src/hotspot/share/opto/macroArrayCopy.cpp
changeset 51984 2ef304ee001d
parent 50399 ee87876734c9
child 52424 e3d79743f57d
--- a/src/hotspot/share/opto/macroArrayCopy.cpp	Thu Sep 27 16:25:25 2018 +0200
+++ b/src/hotspot/share/opto/macroArrayCopy.cpp	Fri Sep 28 10:42:40 2018 +0200
@@ -552,7 +552,7 @@
     // At this point we know we do not need type checks on oop stores.
 
     BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
-    if (alloc != NULL && !bs->array_copy_requires_gc_barriers(copy_type)) {
+    if (!bs->array_copy_requires_gc_barriers(alloc != NULL, copy_type, false, BarrierSetC2::Expansion)) {
       // If we do not need gc barriers, copy using the jint or jlong stub.
       copy_type = LP64_ONLY(UseCompressedOops ? T_INT : T_LONG) NOT_LP64(T_INT);
       assert(type2aelembytes(basic_elem_type) == type2aelembytes(copy_type),
@@ -1127,9 +1127,6 @@
     if (ac->_dest_type != TypeOopPtr::BOTTOM) {
       adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr();
     }
-    if (ac->_src_type != ac->_dest_type) {
-      adr_type = TypeRawPtr::BOTTOM;
-    }
     generate_arraycopy(ac, alloc, &ctrl, merge_mem, &io,
                        adr_type, T_OBJECT,
                        src, src_offset, dest, dest_offset, length,