Skip to content

Commit

Permalink
8256807: C2: Not marking stores correctly as mismatched in string opts
Browse files Browse the repository at this point in the history
Reviewed-by: vlivanov, roland, thartmann
  • Loading branch information
chhagedorn committed Dec 1, 2020
1 parent 3d460bd commit aa2d36f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/hotspot/share/opto/stringopts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

1 comment on commit aa2d36f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.