1076 disjoint_bases, copyfunc_name, dest_uninitialized);
1077
1078 const TypeFunc* call_type = OptoRuntime::fast_arraycopy_Type();
1079 Node* call = make_leaf_call(*ctrl, *mem, call_type, copyfunc_addr, copyfunc_name, adr_type,
1080 src_start, dest_start, copy_length XTOP);
1081
1082 finish_arraycopy_call(call, ctrl, mem, adr_type);
1083 }
1084
1085 void PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode *ac) {
1086 Node* ctrl = ac->in(TypeFunc::Control);
1087 Node* io = ac->in(TypeFunc::I_O);
1088 Node* src = ac->in(ArrayCopyNode::Src);
1089 Node* src_offset = ac->in(ArrayCopyNode::SrcPos);
1090 Node* dest = ac->in(ArrayCopyNode::Dest);
1091 Node* dest_offset = ac->in(ArrayCopyNode::DestPos);
1092 Node* length = ac->in(ArrayCopyNode::Length);
1093 MergeMemNode* merge_mem = NULL;
1094
1095 if (ac->is_clonebasic()) {
1096 assert (src_offset == NULL && dest_offset == NULL, "for clone offsets should be null");
1097 Node* mem = ac->in(TypeFunc::Memory);
1098 const char* copyfunc_name = "arraycopy";
1099 address copyfunc_addr =
1100 basictype2arraycopy(T_LONG, NULL, NULL,
1101 true, copyfunc_name, true);
1102
1103 const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM;
1104 const TypeFunc* call_type = OptoRuntime::fast_arraycopy_Type();
1105
1106 Node* call = make_leaf_call(ctrl, mem, call_type, copyfunc_addr, copyfunc_name, raw_adr_type, src, dest, length XTOP);
1107 transform_later(call);
1108
1109 BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
1110 bs->clone_barrier_at_expansion(ac, call, _igvn);
1111
1112 return;
1113 } else if (ac->is_copyof() || ac->is_copyofrange() || ac->is_cloneoop()) {
1114 Node* mem = ac->in(TypeFunc::Memory);
1115 merge_mem = MergeMemNode::make(mem);
1116 transform_later(merge_mem);
1117
1118 RegionNode* slow_region = new RegionNode(1);
1119 transform_later(slow_region);
1120
1121 AllocateArrayNode* alloc = NULL;
1122 if (ac->is_alloc_tightly_coupled()) {
1123 alloc = AllocateArrayNode::Ideal_array_allocation(dest, &_igvn);
1124 assert(alloc != NULL, "expect alloc");
1125 }
1126
1127 const TypePtr* adr_type = _igvn.type(dest)->is_oopptr()->add_offset(Type::OffsetBot);
1128 if (ac->_dest_type != TypeOopPtr::BOTTOM) {
1129 adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr();
1130 }
1131 generate_arraycopy(ac, alloc, &ctrl, merge_mem, &io,
|
1076 disjoint_bases, copyfunc_name, dest_uninitialized);
1077
1078 const TypeFunc* call_type = OptoRuntime::fast_arraycopy_Type();
1079 Node* call = make_leaf_call(*ctrl, *mem, call_type, copyfunc_addr, copyfunc_name, adr_type,
1080 src_start, dest_start, copy_length XTOP);
1081
1082 finish_arraycopy_call(call, ctrl, mem, adr_type);
1083 }
1084
1085 void PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode *ac) {
1086 Node* ctrl = ac->in(TypeFunc::Control);
1087 Node* io = ac->in(TypeFunc::I_O);
1088 Node* src = ac->in(ArrayCopyNode::Src);
1089 Node* src_offset = ac->in(ArrayCopyNode::SrcPos);
1090 Node* dest = ac->in(ArrayCopyNode::Dest);
1091 Node* dest_offset = ac->in(ArrayCopyNode::DestPos);
1092 Node* length = ac->in(ArrayCopyNode::Length);
1093 MergeMemNode* merge_mem = NULL;
1094
1095 if (ac->is_clonebasic()) {
1096 BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
1097 bs->clone_at_expansion(this, ac);
1098 return;
1099 } else if (ac->is_copyof() || ac->is_copyofrange() || ac->is_cloneoop()) {
1100 Node* mem = ac->in(TypeFunc::Memory);
1101 merge_mem = MergeMemNode::make(mem);
1102 transform_later(merge_mem);
1103
1104 RegionNode* slow_region = new RegionNode(1);
1105 transform_later(slow_region);
1106
1107 AllocateArrayNode* alloc = NULL;
1108 if (ac->is_alloc_tightly_coupled()) {
1109 alloc = AllocateArrayNode::Ideal_array_allocation(dest, &_igvn);
1110 assert(alloc != NULL, "expect alloc");
1111 }
1112
1113 const TypePtr* adr_type = _igvn.type(dest)->is_oopptr()->add_offset(Type::OffsetBot);
1114 if (ac->_dest_type != TypeOopPtr::BOTTOM) {
1115 adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr();
1116 }
1117 generate_arraycopy(ac, alloc, &ctrl, merge_mem, &io,
|