8256807: C2: Not marking stores correctly as mismatched in string opts

Reviewed-by: vlivanov, roland, thartmann
This commit is contained in:
Christian Hagedorn 2020-12-01 10:11:39 +00:00
parent 3d460bd295
commit aa2d36f6de

View File

@ -1311,7 +1311,8 @@ void PhaseStringOpts::getChars(GraphKit& kit, Node* arg, Node* dst_array, BasicT
Node* index = __ SubI(charPos, __ intcon((bt == T_BYTE) ? 1 : 2));
Node* ch = __ AddI(r, __ intcon('0'));
Node* st = __ store_to_memory(kit.control(), kit.array_element_address(dst_array, index, T_BYTE),
ch, bt, byte_adr_idx, MemNode::unordered, (bt != T_BYTE) /* mismatched */);
ch, bt, byte_adr_idx, MemNode::unordered, false /* require_atomic_access */,
false /* unaligned */, (bt != T_BYTE) /* mismatched */);
iff = kit.create_and_map_if(head, __ Bool(__ CmpI(q, __ intcon(0)), BoolTest::ne),
PROB_FAIR, COUNT_UNKNOWN);
@ -1349,7 +1350,8 @@ void PhaseStringOpts::getChars(GraphKit& kit, Node* arg, Node* dst_array, BasicT
} else {
Node* index = __ SubI(charPos, __ intcon((bt == T_BYTE) ? 1 : 2));
st = __ store_to_memory(kit.control(), kit.array_element_address(dst_array, index, T_BYTE),
sign, bt, byte_adr_idx, MemNode::unordered, (bt != T_BYTE) /* mismatched */);
sign, bt, byte_adr_idx, MemNode::unordered, false /* require_atomic_access */,
false /* unaligned */, (bt != T_BYTE) /* mismatched */);
final_merge->init_req(merge_index + 1, kit.control());
final_mem->init_req(merge_index + 1, st);
@ -1542,7 +1544,8 @@ void PhaseStringOpts::copy_constant_string(GraphKit& kit, IdealKit& ideal, ciTyp
} else {
val = readChar(src_array, i++);
}
__ store(__ ctrl(), adr, __ ConI(val), T_CHAR, byte_adr_idx, MemNode::unordered, true /* mismatched */);
__ store(__ ctrl(), adr, __ ConI(val), T_CHAR, byte_adr_idx, MemNode::unordered, false /* require_atomic_access */,
true /* mismatched */);
index = __ AddI(index, __ ConI(2));
}
if (src_is_byte) {
@ -1629,7 +1632,8 @@ Node* PhaseStringOpts::copy_char(GraphKit& kit, Node* val, Node* dst_array, Node
}
if (!dcon || !dbyte) {
// Destination is UTF16. Store a char.
__ store(__ ctrl(), adr, val, T_CHAR, byte_adr_idx, MemNode::unordered, true /* mismatched */);
__ store(__ ctrl(), adr, val, T_CHAR, byte_adr_idx, MemNode::unordered, false /* require_atomic_access */,
true /* mismatched */);
__ set(end, __ AddI(start, __ ConI(2)));
}
if (!dcon) {