8210887: Tweak C2 gc api for arraycopy

Reviewed-by: kvn, thartmann
This commit is contained in:
Roland Westrelin 2018-09-28 10:42:40 +02:00
parent b00f4560cb
commit ce59b4b472
9 changed files with 64 additions and 47 deletions

View file

@ -552,7 +552,7 @@ Node* PhaseMacroExpand::generate_arraycopy(ArrayCopyNode *ac, AllocateArrayNode*
// 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 @@ void PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode *ac) {
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,