1157 return false;
1158 }
1159
1160 static bool skip_through_membars(Compile::AliasType* atp, const TypeInstPtr* tp, bool eliminate_boxing) {
1161 if ((atp != NULL) && (atp->index() >= Compile::AliasIdxRaw)) {
1162 bool non_volatile = (atp->field() != NULL) && !atp->field()->is_volatile();
1163 bool is_stable_ary = FoldStableValues &&
1164 (tp != NULL) && (tp->isa_aryptr() != NULL) &&
1165 tp->isa_aryptr()->is_stable();
1166
1167 return (eliminate_boxing && non_volatile) || is_stable_ary;
1168 }
1169
1170 return false;
1171 }
1172
1173 // Is the value loaded previously stored by an arraycopy? If so return
1174 // a load node that reads from the source array so we may be able to
1175 // optimize out the ArrayCopy node later.
1176 Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseGVN* phase) const {
1177 if (UseLoadBarrier && bottom_type()->make_oopptr() != NULL) {
1178 return NULL;
1179 }
1180
1181 Node* ld_adr = in(MemNode::Address);
1182 intptr_t ld_off = 0;
1183 AllocateNode* ld_alloc = AllocateNode::Ideal_allocation(ld_adr, phase, ld_off);
1184 Node* ac = find_previous_arraycopy(phase, ld_alloc, st, true);
1185 if (ac != NULL) {
1186 assert(ac->is_ArrayCopy(), "what kind of node can this be?");
1187
1188 Node* mem = ac->in(TypeFunc::Memory);
1189 Node* ctl = ac->in(0);
1190 Node* src = ac->in(ArrayCopyNode::Src);
1191
1192 if (!ac->as_ArrayCopy()->is_clonebasic() && !phase->type(src)->isa_aryptr()) {
1193 return NULL;
1194 }
1195
1196 LoadNode* ld = clone()->as_Load();
1197 Node* addp = in(MemNode::Address)->clone();
|
1157 return false;
1158 }
1159
1160 static bool skip_through_membars(Compile::AliasType* atp, const TypeInstPtr* tp, bool eliminate_boxing) {
1161 if ((atp != NULL) && (atp->index() >= Compile::AliasIdxRaw)) {
1162 bool non_volatile = (atp->field() != NULL) && !atp->field()->is_volatile();
1163 bool is_stable_ary = FoldStableValues &&
1164 (tp != NULL) && (tp->isa_aryptr() != NULL) &&
1165 tp->isa_aryptr()->is_stable();
1166
1167 return (eliminate_boxing && non_volatile) || is_stable_ary;
1168 }
1169
1170 return false;
1171 }
1172
1173 // Is the value loaded previously stored by an arraycopy? If so return
1174 // a load node that reads from the source array so we may be able to
1175 // optimize out the ArrayCopy node later.
1176 Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseGVN* phase) const {
1177 if (UseZGC && bottom_type()->make_oopptr() != NULL) {
1178 return NULL;
1179 }
1180
1181 Node* ld_adr = in(MemNode::Address);
1182 intptr_t ld_off = 0;
1183 AllocateNode* ld_alloc = AllocateNode::Ideal_allocation(ld_adr, phase, ld_off);
1184 Node* ac = find_previous_arraycopy(phase, ld_alloc, st, true);
1185 if (ac != NULL) {
1186 assert(ac->is_ArrayCopy(), "what kind of node can this be?");
1187
1188 Node* mem = ac->in(TypeFunc::Memory);
1189 Node* ctl = ac->in(0);
1190 Node* src = ac->in(ArrayCopyNode::Src);
1191
1192 if (!ac->as_ArrayCopy()->is_clonebasic() && !phase->type(src)->isa_aryptr()) {
1193 return NULL;
1194 }
1195
1196 LoadNode* ld = clone()->as_Load();
1197 Node* addp = in(MemNode::Address)->clone();
|