Commit 20baf1bf authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[turbofan] Put StringSubstring on the effect chain

This change ensures that GVN does not move StringSubstring out of
switches, which might introduce partial redundancies.

Bug: chromium:816522
Change-Id: I63b91edd995c84b68d756ed5de08fa13567f3d80
Reviewed-on: https://chromium-review.googlesource.com/939621Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51610}
parent 8b0e6cc3
......@@ -3709,10 +3709,10 @@ Reduction JSCallReducer::ReduceStringPrototypeSubstring(Node* node) {
graph()->NewNode(simplified()->NumberMin(), finalStart, finalEnd);
Node* to = graph()->NewNode(simplified()->NumberMax(), finalStart, finalEnd);
Node* value =
graph()->NewNode(simplified()->StringSubstring(), receiver, from, to);
Node* value = effect = graph()->NewNode(simplified()->StringSubstring(),
receiver, from, to, effect, control);
ReplaceWithValue(node, value, effect, control);
return Replace(node);
return Replace(value);
}
Reduction JSCallReducer::ReduceJSConstructWithArrayLike(Node* node) {
......
......@@ -2412,6 +2412,7 @@ class RepresentationSelector {
ProcessInput(node, 0, UseInfo::AnyTagged());
ProcessInput(node, 1, UseInfo::TruncatingWord32());
ProcessInput(node, 2, UseInfo::TruncatingWord32());
ProcessRemainingInputs(node, 3);
SetOutput(node, MachineRepresentation::kTaggedPointer);
return;
}
......
......@@ -676,7 +676,6 @@ bool operator==(CheckMinusZeroParameters const& lhs,
V(StringLength, Operator::kNoProperties, 1, 0) \
V(StringToLowerCaseIntl, Operator::kNoProperties, 1, 0) \
V(StringToUpperCaseIntl, Operator::kNoProperties, 1, 0) \
V(StringSubstring, Operator::kNoProperties, 3, 0) \
V(TypeOf, Operator::kNoProperties, 1, 1) \
V(PlainPrimitiveToNumber, Operator::kNoProperties, 1, 0) \
V(PlainPrimitiveToWord32, Operator::kNoProperties, 1, 0) \
......@@ -721,10 +720,11 @@ bool operator==(CheckMinusZeroParameters const& lhs,
V(NewConsString, Operator::kNoProperties, 3, 0) \
V(MaskIndexWithBound, Operator::kNoProperties, 2, 0)
#define EFFECT_DEPENDENT_OP_LIST(V) \
V(StringCharAt, Operator::kNoProperties, 2, 1) \
V(StringCharCodeAt, Operator::kNoProperties, 2, 1) \
V(SeqStringCharCodeAt, Operator::kNoProperties, 2, 1)
#define EFFECT_DEPENDENT_OP_LIST(V) \
V(StringCharAt, Operator::kNoProperties, 2, 1) \
V(StringCharCodeAt, Operator::kNoProperties, 2, 1) \
V(SeqStringCharCodeAt, Operator::kNoProperties, 2, 1) \
V(StringSubstring, Operator::kNoProperties, 3, 1)
#define SPECULATIVE_NUMBER_BINOP_LIST(V) \
SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(V) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment