Skip to content
Permalink
Browse files
8256807: C2: Not marking stores correctly as mismatched in string opts
Reviewed-by: vlivanov, roland, thartmann
  • Loading branch information
chhagedorn committed Dec 1, 2020
1 parent 3d460bd commit aa2d36f6de09c84092c40c0b5d44c194a7cbca44
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/hotspot/share/opto/stringopts.cpp
@@ -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) {

1 comment on commit aa2d36f

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on aa2d36f Dec 1, 2020

Please sign in to comment.