src/hotspot/share/opto/macroArrayCopy.cpp
changeset 51984 2ef304ee001d
parent 50399 ee87876734c9
child 52424 e3d79743f57d
equal deleted inserted replaced
51983:2a12a3865916 51984:2ef304ee001d
   550       }
   550       }
   551     }
   551     }
   552     // At this point we know we do not need type checks on oop stores.
   552     // At this point we know we do not need type checks on oop stores.
   553 
   553 
   554     BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
   554     BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
   555     if (alloc != NULL && !bs->array_copy_requires_gc_barriers(copy_type)) {
   555     if (!bs->array_copy_requires_gc_barriers(alloc != NULL, copy_type, false, BarrierSetC2::Expansion)) {
   556       // If we do not need gc barriers, copy using the jint or jlong stub.
   556       // If we do not need gc barriers, copy using the jint or jlong stub.
   557       copy_type = LP64_ONLY(UseCompressedOops ? T_INT : T_LONG) NOT_LP64(T_INT);
   557       copy_type = LP64_ONLY(UseCompressedOops ? T_INT : T_LONG) NOT_LP64(T_INT);
   558       assert(type2aelembytes(basic_elem_type) == type2aelembytes(copy_type),
   558       assert(type2aelembytes(basic_elem_type) == type2aelembytes(copy_type),
   559              "sizes agree");
   559              "sizes agree");
   560     }
   560     }
  1125 
  1125 
  1126     const TypePtr* adr_type = _igvn.type(dest)->is_oopptr()->add_offset(Type::OffsetBot);
  1126     const TypePtr* adr_type = _igvn.type(dest)->is_oopptr()->add_offset(Type::OffsetBot);
  1127     if (ac->_dest_type != TypeOopPtr::BOTTOM) {
  1127     if (ac->_dest_type != TypeOopPtr::BOTTOM) {
  1128       adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr();
  1128       adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr();
  1129     }
  1129     }
  1130     if (ac->_src_type != ac->_dest_type) {
       
  1131       adr_type = TypeRawPtr::BOTTOM;
       
  1132     }
       
  1133     generate_arraycopy(ac, alloc, &ctrl, merge_mem, &io,
  1130     generate_arraycopy(ac, alloc, &ctrl, merge_mem, &io,
  1134                        adr_type, T_OBJECT,
  1131                        adr_type, T_OBJECT,
  1135                        src, src_offset, dest, dest_offset, length,
  1132                        src, src_offset, dest, dest_offset, length,
  1136                        true, !ac->is_copyofrange());
  1133                        true, !ac->is_copyofrange());
  1137 
  1134