Commit da8dc90f authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[compiler] Template methods in SimplifiedLowering pt. 3

This is a CL in a string of CLs that template SimplifiedLowering.
It is done with the purpose of decoupling the implementation in the
three phases that SimplifiedLowering has (Propagate, Retype, Lower).

Template VisitBinop (and Binop specific ones like
VisitSpeculativeInt32Binop), for which we need to template:
 * VisitSpeculativeAdditiveOp
 * VisitSpeculativeNumberModulus
 * VisitCheckBounds

Bug: v8:10424
Change-Id: I51764cb2e9ea9c2aa14829888d352e1947be77b5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2135637Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67394}
parent a04762b3
......@@ -926,33 +926,36 @@ class RepresentationSelector {
}
// Helper for binops of the R x L -> O variety.
template <Phase T>
void VisitBinop(Node* node, UseInfo left_use, UseInfo right_use,
MachineRepresentation output,
Type restriction_type = Type::Any()) {
DCHECK_EQ(2, node->op()->ValueInputCount());
ProcessInput(node, 0, left_use);
ProcessInput(node, 1, right_use);
ProcessInput<T>(node, 0, left_use);
ProcessInput<T>(node, 1, right_use);
for (int i = 2; i < node->InputCount(); i++) {
EnqueueInput(node, i);
EnqueueInput<T>(node, i);
}
SetOutput(node, output, restriction_type);
SetOutput<T>(node, output, restriction_type);
}
// Helper for binops of the I x I -> O variety.
template <Phase T>
void VisitBinop(Node* node, UseInfo input_use, MachineRepresentation output,
Type restriction_type = Type::Any()) {
VisitBinop(node, input_use, input_use, output, restriction_type);
VisitBinop<T>(node, input_use, input_use, output, restriction_type);
}
template <Phase T>
void VisitSpeculativeInt32Binop(Node* node) {
DCHECK_EQ(2, node->op()->ValueInputCount());
if (BothInputsAre(node, Type::NumberOrOddball())) {
return VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
return VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
}
NumberOperationHint hint = NumberOperationHintOf(node->op());
return VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32);
return VisitBinop<T>(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32);
}
// Helper for unops of the I -> O variety.
......@@ -972,16 +975,22 @@ class RepresentationSelector {
}
// Helpers for specific types of binops.
template <Phase T>
void VisitFloat64Binop(Node* node) {
VisitBinop(node, UseInfo::TruncatingFloat64(),
MachineRepresentation::kFloat64);
VisitBinop<T>(node, UseInfo::TruncatingFloat64(),
MachineRepresentation::kFloat64);
}
template <Phase T>
void VisitInt64Binop(Node* node) {
VisitBinop(node, UseInfo::Word64(), MachineRepresentation::kWord64);
VisitBinop<T>(node, UseInfo::Word64(), MachineRepresentation::kWord64);
}
template <Phase T>
void VisitWord32TruncatingBinop(Node* node) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
}
// Infer representation for phi-like nodes.
......@@ -1422,7 +1431,7 @@ class RepresentationSelector {
GetUpperBound(node).Is(Type::Unsigned32()) ||
truncation.IsUsedAsWord32()) {
// => Int32Add/Sub
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) ChangeToPureOp(node, Int32Op(node));
return;
}
......@@ -1447,8 +1456,8 @@ class RepresentationSelector {
if (left_upper.Is(left_constraint_type) &&
right_upper.Is(Type::Signed32OrMinusZero()) &&
(left_upper.Is(Type::Signed32()) || right_upper.Is(Type::Signed32()))) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
} else {
// If the output's truncation is identify-zeros, we can pass it
// along. Moreover, if the operation is addition and we know the
......@@ -1467,8 +1476,8 @@ class RepresentationSelector {
// potentially guarded by a check.
UseInfo right_use = CheckedUseInfoAsWord32FromHint(hint, FeedbackSource(),
kIdentifyZeros);
VisitBinop(node, left_use, right_use, MachineRepresentation::kWord32,
Type::Signed32());
VisitBinop<T>(node, left_use, right_use, MachineRepresentation::kWord32,
Type::Signed32());
}
if (lower()) {
if (truncation.IsUsedAsWord32() ||
......@@ -1483,6 +1492,7 @@ class RepresentationSelector {
return;
}
template <Phase T>
void VisitSpeculativeAdditiveOp(Node* node, Truncation truncation,
SimplifiedLowering* lowering) {
if (BothInputsAre(node, type_cache_->kAdditiveSafeIntegerOrMinusZero) &&
......@@ -1490,29 +1500,30 @@ class RepresentationSelector {
GetUpperBound(node).Is(Type::Unsigned32()) ||
truncation.IsUsedAsWord32())) {
// => Int32Add/Sub
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) ChangeToPureOp(node, Int32Op(node));
return;
}
// default case => Float64Add/Sub
VisitBinop(node,
UseInfo::CheckedNumberOrOddballAsFloat64(kDistinguishZeros,
FeedbackSource()),
MachineRepresentation::kFloat64, Type::Number());
VisitBinop<T>(node,
UseInfo::CheckedNumberOrOddballAsFloat64(kDistinguishZeros,
FeedbackSource()),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) {
ChangeToPureOp(node, Float64Op(node));
}
return;
}
template <Phase T>
void VisitSpeculativeNumberModulus(Node* node, Truncation truncation,
SimplifiedLowering* lowering) {
if (BothInputsAre(node, Type::Unsigned32OrMinusZeroOrNaN()) &&
(truncation.IsUsedAsWord32() ||
NodeProperties::GetType(node).Is(Type::Unsigned32()))) {
// => unsigned Uint32Mod
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) DeferReplacement(node, lowering->Uint32Mod(node));
return;
}
......@@ -1520,7 +1531,7 @@ class RepresentationSelector {
(truncation.IsUsedAsWord32() ||
NodeProperties::GetType(node).Is(Type::Signed32()))) {
// => signed Int32Mod
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) DeferReplacement(node, lowering->Int32Mod(node));
return;
}
......@@ -1533,8 +1544,8 @@ class RepresentationSelector {
if (BothInputsAreUnsigned32(node)) {
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Unsigned32());
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Unsigned32());
if (lower()) ChangeToUint32OverflowOp(node);
return;
}
......@@ -1546,8 +1557,8 @@ class RepresentationSelector {
// If both the inputs the feedback are int32, use the overflow op.
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
if (lower()) ChangeToInt32OverflowOp(node);
return;
}
......@@ -1565,15 +1576,15 @@ class RepresentationSelector {
UseInfo const rhs_use = CheckedUseInfoAsWord32FromHint(
hint, FeedbackSource(), kIdentifyZeros);
if (truncation.IsUsedAsWord32()) {
VisitBinop(node, lhs_use, rhs_use, MachineRepresentation::kWord32);
VisitBinop<T>(node, lhs_use, rhs_use, MachineRepresentation::kWord32);
if (lower()) DeferReplacement(node, lowering->Int32Mod(node));
} else if (BothInputsAre(node, Type::Unsigned32OrMinusZeroOrNaN())) {
VisitBinop(node, lhs_use, rhs_use, MachineRepresentation::kWord32,
Type::Unsigned32());
VisitBinop<T>(node, lhs_use, rhs_use, MachineRepresentation::kWord32,
Type::Unsigned32());
if (lower()) ChangeToUint32OverflowOp(node);
} else {
VisitBinop(node, lhs_use, rhs_use, MachineRepresentation::kWord32,
Type::Signed32());
VisitBinop<T>(node, lhs_use, rhs_use, MachineRepresentation::kWord32,
Type::Signed32());
if (lower()) ChangeToInt32OverflowOp(node);
}
return;
......@@ -1583,8 +1594,8 @@ class RepresentationSelector {
TypeOf(node->InputAt(1)).Is(Type::Unsigned32()) &&
(truncation.IsUsedAsWord32() ||
NodeProperties::GetType(node).Is(Type::Unsigned32()))) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Number());
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Number());
if (lower()) DeferReplacement(node, lowering->Uint32Mod(node));
return;
}
......@@ -1592,8 +1603,8 @@ class RepresentationSelector {
TypeOf(node->InputAt(1)).Is(Type::Signed32()) &&
(truncation.IsUsedAsWord32() ||
NodeProperties::GetType(node).Is(Type::Signed32()))) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Number());
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Number());
if (lower()) DeferReplacement(node, lowering->Int32Mod(node));
return;
}
......@@ -1607,8 +1618,8 @@ class RepresentationSelector {
truncation.identify_zeros(), FeedbackSource());
UseInfo const rhs_use = UseInfo::CheckedNumberOrOddballAsFloat64(
kIdentifyZeros, FeedbackSource());
VisitBinop(node, lhs_use, rhs_use, MachineRepresentation::kFloat64,
Type::Number());
VisitBinop<T>(node, lhs_use, rhs_use, MachineRepresentation::kFloat64,
Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
}
......@@ -1647,6 +1658,7 @@ class RepresentationSelector {
}
}
template <Phase T>
void VisitCheckBounds(Node* node, SimplifiedLowering* lowering) {
CheckBoundsParameters const& p = CheckBoundsParametersOf(node->op());
FeedbackSource const& feedback = p.check_parameters().feedback();
......@@ -1657,8 +1669,8 @@ class RepresentationSelector {
// Map -0 to 0, and the values in the [-2^31,-1] range to the
// [2^31,2^32-1] range, which will be considered out-of-bounds
// as well, because the {length_type} is limited to Unsigned31.
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) {
CheckBoundsParameters::Mode mode = p.mode();
if (lowering->poisoning_level_ ==
......@@ -1674,8 +1686,8 @@ class RepresentationSelector {
node, simplified()->CheckedUint32Bounds(feedback, mode));
}
} else {
VisitBinop(node, UseInfo::CheckedTaggedAsArrayIndex(feedback),
UseInfo::Word(), MachineType::PointerRepresentation());
VisitBinop<T>(node, UseInfo::CheckedTaggedAsArrayIndex(feedback),
UseInfo::Word(), MachineType::PointerRepresentation());
if (lower()) {
if (jsgraph_->machine()->Is64()) {
NodeProperties::ChangeOp(
......@@ -1688,9 +1700,9 @@ class RepresentationSelector {
}
} else {
CHECK(length_type.Is(type_cache_->kPositiveSafeInteger));
VisitBinop(node,
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, feedback),
UseInfo::Word64(), MachineRepresentation::kWord64);
VisitBinop<T>(node,
UseInfo::CheckedSigned64AsWord64(kIdentifyZeros, feedback),
UseInfo::Word64(), MachineRepresentation::kWord64);
if (lower()) {
NodeProperties::ChangeOp(
node, simplified()->CheckedUint64Bounds(feedback, p.mode()));
......@@ -1953,8 +1965,8 @@ class RepresentationSelector {
rhs_type.Is(Type::Unsigned32OrMinusZeroOrNaN()) &&
OneInputCannotBe(node, type_cache_->kZeroish))) {
// => unsigned Int32Cmp
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node));
return;
}
......@@ -1964,14 +1976,14 @@ class RepresentationSelector {
rhs_type.Is(Type::Signed32OrMinusZeroOrNaN()) &&
OneInputCannotBe(node, type_cache_->kZeroish))) {
// => signed Int32Cmp
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
return;
}
// => Float64Cmp
VisitBinop(node, UseInfo::TruncatingFloat64(kIdentifyZeros),
MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::TruncatingFloat64(kIdentifyZeros),
MachineRepresentation::kBit);
if (lower()) NodeProperties::ChangeOp(node, Float64Op(node));
return;
}
......@@ -1985,19 +1997,19 @@ class RepresentationSelector {
if (lhs_type.Is(Type::Unsigned32OrMinusZero()) &&
rhs_type.Is(Type::Unsigned32OrMinusZero())) {
// => unsigned Int32Cmp
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node));
} else if (lhs_type.Is(Type::Signed32OrMinusZero()) &&
rhs_type.Is(Type::Signed32OrMinusZero())) {
// => signed Int32Cmp
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
} else {
// => Float64Cmp
VisitBinop(node, UseInfo::TruncatingFloat64(kIdentifyZeros),
MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::TruncatingFloat64(kIdentifyZeros),
MachineRepresentation::kBit);
if (lower()) NodeProperties::ChangeOp(node, Float64Op(node));
}
return;
......@@ -2009,7 +2021,7 @@ class RepresentationSelector {
case IrOpcode::kSpeculativeNumberAdd:
case IrOpcode::kSpeculativeNumberSubtract:
return VisitSpeculativeAdditiveOp(node, truncation, lowering);
return VisitSpeculativeAdditiveOp<T>(node, truncation, lowering);
case IrOpcode::kSpeculativeNumberLessThan:
case IrOpcode::kSpeculativeNumberLessThanOrEqual:
......@@ -2022,15 +2034,15 @@ class RepresentationSelector {
if (lhs_type.Is(Type::Unsigned32OrMinusZero()) &&
rhs_type.Is(Type::Unsigned32OrMinusZero())) {
// => unsigned Int32Cmp
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
if (lower()) ChangeToPureOp(node, Uint32Op(node));
return;
} else if (lhs_type.Is(Type::Signed32OrMinusZero()) &&
rhs_type.Is(Type::Signed32OrMinusZero())) {
// => signed Int32Cmp
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kBit);
if (lower()) ChangeToPureOp(node, Int32Op(node));
return;
}
......@@ -2040,10 +2052,10 @@ class RepresentationSelector {
case NumberOperationHint::kSigned32:
case NumberOperationHint::kSignedSmall:
if (propagate()) {
VisitBinop(node,
CheckedUseInfoAsWord32FromHint(hint, FeedbackSource(),
kIdentifyZeros),
MachineRepresentation::kBit);
VisitBinop<T>(node,
CheckedUseInfoAsWord32FromHint(
hint, FeedbackSource(), kIdentifyZeros),
MachineRepresentation::kBit);
} else if (retype()) {
SetOutput<T>(node, MachineRepresentation::kBit, Type::Any());
} else {
......@@ -2052,18 +2064,18 @@ class RepresentationSelector {
Node* rhs = node->InputAt(1);
if (IsNodeRepresentationTagged(lhs) &&
IsNodeRepresentationTagged(rhs)) {
VisitBinop(node,
UseInfo::CheckedSignedSmallAsTaggedSigned(
FeedbackSource(), kIdentifyZeros),
MachineRepresentation::kBit);
VisitBinop<T>(node,
UseInfo::CheckedSignedSmallAsTaggedSigned(
FeedbackSource(), kIdentifyZeros),
MachineRepresentation::kBit);
ChangeToPureOp(
node, changer_->TaggedSignedOperatorFor(node->opcode()));
} else {
VisitBinop(node,
CheckedUseInfoAsWord32FromHint(
hint, FeedbackSource(), kIdentifyZeros),
MachineRepresentation::kBit);
VisitBinop<T>(node,
CheckedUseInfoAsWord32FromHint(
hint, FeedbackSource(), kIdentifyZeros),
MachineRepresentation::kBit);
ChangeToPureOp(node, Int32Op(node));
}
}
......@@ -2078,10 +2090,10 @@ class RepresentationSelector {
DCHECK_NE(IrOpcode::kSpeculativeNumberEqual, node->opcode());
V8_FALLTHROUGH;
case NumberOperationHint::kNumber:
VisitBinop(node,
CheckedUseInfoAsFloat64FromHint(hint, FeedbackSource(),
kIdentifyZeros),
MachineRepresentation::kBit);
VisitBinop<T>(node,
CheckedUseInfoAsFloat64FromHint(
hint, FeedbackSource(), kIdentifyZeros),
MachineRepresentation::kBit);
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
}
......@@ -2099,17 +2111,17 @@ class RepresentationSelector {
TypeOf(node).Is(Type::Unsigned32()) ||
truncation.IsUsedAsWord32())) {
// => Int32Add/Sub
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) ChangeToPureOp(node, Int32Op(node));
} else if (jsgraph_->machine()->Is64() &&
BothInputsAre(node, type_cache_->kSafeInteger) &&
GetUpperBound(node).Is(type_cache_->kSafeInteger)) {
// => Int64Add/Sub
VisitInt64Binop(node);
VisitInt64Binop<T>(node);
if (lower()) ChangeToPureOp(node, Int64Op(node));
} else {
// => Float64Add/Sub
VisitFloat64Binop(node);
VisitFloat64Binop<T>(node);
if (lower()) ChangeToPureOp(node, Float64Op(node));
}
return;
......@@ -2126,7 +2138,7 @@ class RepresentationSelector {
// (b) the output is known to be Unsigned32, or
// (c) the uses are truncating and the result is in the safe
// integer range.
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) ChangeToPureOp(node, Int32Op(node));
return;
}
......@@ -2141,8 +2153,8 @@ class RepresentationSelector {
// If both inputs and feedback are int32, use the overflow op.
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
if (lower()) {
LowerToCheckedInt32Mul(node, truncation, input0_type,
input1_type);
......@@ -2153,8 +2165,8 @@ class RepresentationSelector {
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Signed32());
VisitBinop<T>(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Signed32());
if (lower()) {
LowerToCheckedInt32Mul(node, truncation, input0_type, input1_type);
}
......@@ -2162,10 +2174,10 @@ class RepresentationSelector {
}
// Checked float64 x float64 => float64
VisitBinop(node,
UseInfo::CheckedNumberOrOddballAsFloat64(kDistinguishZeros,
FeedbackSource()),
MachineRepresentation::kFloat64, Type::Number());
VisitBinop<T>(node,
UseInfo::CheckedNumberOrOddballAsFloat64(
kDistinguishZeros, FeedbackSource()),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
}
......@@ -2181,32 +2193,32 @@ class RepresentationSelector {
// (b) the output is known to be Unsigned32, or
// (c) the uses are truncating and the result is in the safe
// integer range.
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) ChangeToPureOp(node, Int32Op(node));
return;
}
// Number x Number => Float64Mul
VisitFloat64Binop(node);
VisitFloat64Binop<T>(node);
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
}
case IrOpcode::kSpeculativeNumberDivide: {
if (BothInputsAreUnsigned32(node) && truncation.IsUsedAsWord32()) {
// => unsigned Uint32Div
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) DeferReplacement(node, lowering->Uint32Div(node));
return;
}
if (BothInputsAreSigned32(node)) {
if (NodeProperties::GetType(node).Is(Type::Signed32())) {
// => signed Int32Div
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) DeferReplacement(node, lowering->Int32Div(node));
return;
}
if (truncation.IsUsedAsWord32()) {
// => signed Int32Div
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) DeferReplacement(node, lowering->Int32Div(node));
return;
}
......@@ -2220,8 +2232,8 @@ class RepresentationSelector {
if (BothInputsAreUnsigned32(node)) {
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Unsigned32());
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Unsigned32());
if (lower()) ChangeToUint32OverflowOp(node);
return;
}
......@@ -2233,8 +2245,8 @@ class RepresentationSelector {
// If both the inputs the feedback are int32, use the overflow op.
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32, Type::Signed32());
if (lower()) ChangeToInt32OverflowOp(node);
return;
}
......@@ -2245,23 +2257,23 @@ class RepresentationSelector {
hint == NumberOperationHint::kSignedSmallInputs) {
// If the result is truncated, we only need to check the inputs.
if (truncation.IsUsedAsWord32()) {
VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32);
VisitBinop<T>(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32);
if (lower()) DeferReplacement(node, lowering->Int32Div(node));
return;
} else if (hint != NumberOperationHint::kSignedSmallInputs) {
VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Signed32());
VisitBinop<T>(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Signed32());
if (lower()) ChangeToInt32OverflowOp(node);
return;
}
}
// default case => Float64Div
VisitBinop(node,
UseInfo::CheckedNumberOrOddballAsFloat64(kDistinguishZeros,
FeedbackSource()),
MachineRepresentation::kFloat64, Type::Number());
VisitBinop<T>(node,
UseInfo::CheckedNumberOrOddballAsFloat64(
kDistinguishZeros, FeedbackSource()),
MachineRepresentation::kFloat64, Type::Number());
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
}
......@@ -2271,7 +2283,7 @@ class RepresentationSelector {
(truncation.IsUsedAsWord32() ||
TypeOf(node).Is(Type::Unsigned32()))) {
// => unsigned Uint32Div
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) DeferReplacement(node, lowering->Uint32Div(node));
return;
}
......@@ -2280,17 +2292,17 @@ class RepresentationSelector {
(truncation.IsUsedAsWord32() ||
TypeOf(node).Is(Type::Signed32()))) {
// => signed Int32Div
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) DeferReplacement(node, lowering->Int32Div(node));
return;
}
// Number x Number => Float64Div
VisitFloat64Binop(node);
VisitFloat64Binop<T>(node);
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
}
case IrOpcode::kSpeculativeNumberModulus:
return VisitSpeculativeNumberModulus(node, truncation, lowering);
return VisitSpeculativeNumberModulus<T>(node, truncation, lowering);
case IrOpcode::kNumberModulus: {
Type const lhs_type = TypeOf(node->InputAt(0));
Type const rhs_type = TypeOf(node->InputAt(1));
......@@ -2299,7 +2311,7 @@ class RepresentationSelector {
(truncation.IsUsedAsWord32() ||
TypeOf(node).Is(Type::Unsigned32()))) {
// => unsigned Uint32Mod
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) DeferReplacement(node, lowering->Uint32Mod(node));
return;
}
......@@ -2309,7 +2321,7 @@ class RepresentationSelector {
(truncation.IdentifiesZeroAndMinusZero() &&
TypeOf(node).Is(Type::Signed32OrMinusZero())))) {
// => signed Int32Mod
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) DeferReplacement(node, lowering->Int32Mod(node));
return;
}
......@@ -2321,29 +2333,30 @@ class RepresentationSelector {
UseInfo const lhs_use =
UseInfo::TruncatingFloat64(truncation.identify_zeros());
UseInfo const rhs_use = UseInfo::TruncatingFloat64(kIdentifyZeros);
VisitBinop(node, lhs_use, rhs_use, MachineRepresentation::kFloat64);
VisitBinop<T>(node, lhs_use, rhs_use, MachineRepresentation::kFloat64);
if (lower()) ChangeToPureOp(node, Float64Op(node));
return;
}
case IrOpcode::kNumberBitwiseOr:
case IrOpcode::kNumberBitwiseXor:
case IrOpcode::kNumberBitwiseAnd: {
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
return;
}
case IrOpcode::kSpeculativeNumberBitwiseOr:
case IrOpcode::kSpeculativeNumberBitwiseXor:
case IrOpcode::kSpeculativeNumberBitwiseAnd:
VisitSpeculativeInt32Binop(node);
VisitSpeculativeInt32Binop<T>(node);
if (lower()) {
ChangeToPureOp(node, Int32Op(node));
}
return;
case IrOpcode::kNumberShiftLeft: {
Type rhs_type = GetUpperBound(node->InputAt(1));
VisitBinop(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(), MachineRepresentation::kWord32);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) {
MaskShiftOperand(node, rhs_type);
ChangeToPureOp(node, lowering->machine()->Word32Shl());
......@@ -2353,9 +2366,9 @@ class RepresentationSelector {
case IrOpcode::kSpeculativeNumberShiftLeft: {
if (BothInputsAre(node, Type::NumberOrOddball())) {
Type rhs_type = GetUpperBound(node->InputAt(1));
VisitBinop(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) {
MaskShiftOperand(node, rhs_type);
ChangeToPureOp(node, lowering->machine()->Word32Shl());
......@@ -2364,8 +2377,8 @@ class RepresentationSelector {
}
NumberOperationHint hint = NumberOperationHintOf(node->op());
Type rhs_type = GetUpperBound(node->InputAt(1));
VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Signed32());
VisitBinop<T>(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Signed32());
if (lower()) {
MaskShiftOperand(node, rhs_type);
ChangeToPureOp(node, lowering->machine()->Word32Shl());
......@@ -2374,8 +2387,9 @@ class RepresentationSelector {
}
case IrOpcode::kNumberShiftRight: {
Type rhs_type = GetUpperBound(node->InputAt(1));
VisitBinop(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(), MachineRepresentation::kWord32);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) {
MaskShiftOperand(node, rhs_type);
ChangeToPureOp(node, lowering->machine()->Word32Sar());
......@@ -2385,9 +2399,9 @@ class RepresentationSelector {
case IrOpcode::kSpeculativeNumberShiftRight: {
if (BothInputsAre(node, Type::NumberOrOddball())) {
Type rhs_type = GetUpperBound(node->InputAt(1));
VisitBinop(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) {
MaskShiftOperand(node, rhs_type);
ChangeToPureOp(node, lowering->machine()->Word32Sar());
......@@ -2396,8 +2410,8 @@ class RepresentationSelector {
}
NumberOperationHint hint = NumberOperationHintOf(node->op());
Type rhs_type = GetUpperBound(node->InputAt(1));
VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Signed32());
VisitBinop<T>(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Signed32());
if (lower()) {
MaskShiftOperand(node, rhs_type);
ChangeToPureOp(node, lowering->machine()->Word32Sar());
......@@ -2406,8 +2420,9 @@ class RepresentationSelector {
}
case IrOpcode::kNumberShiftRightLogical: {
Type rhs_type = GetUpperBound(node->InputAt(1));
VisitBinop(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(), MachineRepresentation::kWord32);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) {
MaskShiftOperand(node, rhs_type);
ChangeToPureOp(node, lowering->machine()->Word32Shr());
......@@ -2425,8 +2440,8 @@ class RepresentationSelector {
// have seen so far were of type Unsigned31. We speculate that this
// will continue to hold. Moreover, since the RHS is 0, the result
// will just be the (converted) LHS.
VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Unsigned31());
VisitBinop<T>(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Unsigned31());
if (lower()) {
node->RemoveInput(1);
NodeProperties::ChangeOp(
......@@ -2435,17 +2450,17 @@ class RepresentationSelector {
return;
}
if (BothInputsAre(node, Type::NumberOrOddball())) {
VisitBinop(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) {
MaskShiftOperand(node, rhs_type);
ChangeToPureOp(node, lowering->machine()->Word32Shr());
}
return;
}
VisitBinop(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Unsigned32());
VisitBinop<T>(node, CheckedUseInfoAsWord32FromHint(hint),
MachineRepresentation::kWord32, Type::Unsigned32());
if (lower()) {
MaskShiftOperand(node, rhs_type);
ChangeToPureOp(node, lowering->machine()->Word32Shr());
......@@ -2483,8 +2498,9 @@ class RepresentationSelector {
return;
}
case IrOpcode::kNumberImul: {
VisitBinop(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(), MachineRepresentation::kWord32);
VisitBinop<T>(node, UseInfo::TruncatingWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node));
return;
}
......@@ -2508,7 +2524,7 @@ class RepresentationSelector {
(lhs_type.Is(Type::Unsigned32OrMinusZero()) &&
rhs_type.Is(Type::Unsigned32OrMinusZero()) &&
truncation.IdentifiesZeroAndMinusZero())) {
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) {
lowering->DoMax(node, lowering->machine()->Uint32LessThan(),
MachineRepresentation::kWord32);
......@@ -2518,7 +2534,7 @@ class RepresentationSelector {
(lhs_type.Is(Type::Signed32OrMinusZero()) &&
rhs_type.Is(Type::Signed32OrMinusZero()) &&
truncation.IdentifiesZeroAndMinusZero())) {
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) {
lowering->DoMax(node, lowering->machine()->Int32LessThan(),
MachineRepresentation::kWord32);
......@@ -2526,15 +2542,15 @@ class RepresentationSelector {
} else if (jsgraph_->machine()->Is64() &&
lhs_type.Is(type_cache_->kSafeInteger) &&
rhs_type.Is(type_cache_->kSafeInteger)) {
VisitInt64Binop(node);
VisitInt64Binop<T>(node);
if (lower()) {
lowering->DoMax(node, lowering->machine()->Int64LessThan(),
MachineRepresentation::kWord64);
}
} else {
VisitBinop(node,
UseInfo::TruncatingFloat64(truncation.identify_zeros()),
MachineRepresentation::kFloat64);
VisitBinop<T>(node,
UseInfo::TruncatingFloat64(truncation.identify_zeros()),
MachineRepresentation::kFloat64);
if (lower()) {
// If the right hand side is not NaN, and the left hand side
// is not NaN (or -0 if the difference between the zeros is
......@@ -2566,7 +2582,7 @@ class RepresentationSelector {
(lhs_type.Is(Type::Unsigned32OrMinusZero()) &&
rhs_type.Is(Type::Unsigned32OrMinusZero()) &&
truncation.IdentifiesZeroAndMinusZero())) {
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) {
lowering->DoMin(node, lowering->machine()->Uint32LessThan(),
MachineRepresentation::kWord32);
......@@ -2576,7 +2592,7 @@ class RepresentationSelector {
(lhs_type.Is(Type::Signed32OrMinusZero()) &&
rhs_type.Is(Type::Signed32OrMinusZero()) &&
truncation.IdentifiesZeroAndMinusZero())) {
VisitWord32TruncatingBinop(node);
VisitWord32TruncatingBinop<T>(node);
if (lower()) {
lowering->DoMin(node, lowering->machine()->Int32LessThan(),
MachineRepresentation::kWord32);
......@@ -2584,15 +2600,15 @@ class RepresentationSelector {
} else if (jsgraph_->machine()->Is64() &&
lhs_type.Is(type_cache_->kSafeInteger) &&
rhs_type.Is(type_cache_->kSafeInteger)) {
VisitInt64Binop(node);
VisitInt64Binop<T>(node);
if (lower()) {
lowering->DoMin(node, lowering->machine()->Int64LessThan(),
MachineRepresentation::kWord64);
}
} else {
VisitBinop(node,
UseInfo::TruncatingFloat64(truncation.identify_zeros()),
MachineRepresentation::kFloat64);
VisitBinop<T>(node,
UseInfo::TruncatingFloat64(truncation.identify_zeros()),
MachineRepresentation::kFloat64);
if (lower()) {
// If the left hand side is not NaN, and the right hand side
// is not NaN (or -0 if the difference between the zeros is
......@@ -2613,8 +2629,8 @@ class RepresentationSelector {
}
case IrOpcode::kNumberAtan2:
case IrOpcode::kNumberPow: {
VisitBinop(node, UseInfo::TruncatingFloat64(),
MachineRepresentation::kFloat64);
VisitBinop<T>(node, UseInfo::TruncatingFloat64(),
MachineRepresentation::kFloat64);
if (lower()) NodeProperties::ChangeOp(node, Float64Op(node));
return;
}
......@@ -2778,7 +2794,7 @@ class RepresentationSelector {
return;
}
case IrOpcode::kReferenceEqual: {
VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::AnyTagged(), MachineRepresentation::kBit);
if (lower()) {
if (COMPRESS_POINTERS_BOOL) {
NodeProperties::ChangeOp(node, lowering->machine()->Word32Equal());
......@@ -2789,22 +2805,22 @@ class RepresentationSelector {
return;
}
case IrOpcode::kSameValueNumbersOnly: {
VisitBinop(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
VisitBinop<T>(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
return;
}
case IrOpcode::kSameValue: {
if (truncation.IsUnused()) return VisitUnused<T>(node);
if (BothInputsAre(node, Type::Number())) {
VisitBinop(node, UseInfo::TruncatingFloat64(),
MachineRepresentation::kBit);
VisitBinop<T>(node, UseInfo::TruncatingFloat64(),
MachineRepresentation::kBit);
if (lower()) {
NodeProperties::ChangeOp(node,
lowering->simplified()->NumberSameValue());
}
} else {
VisitBinop(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
VisitBinop<T>(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
}
return;
}
......@@ -2821,16 +2837,16 @@ class RepresentationSelector {
}
case IrOpcode::kSpeculativeBigIntAdd: {
if (truncation.IsUsedAsWord64()) {
VisitBinop(node,
UseInfo::CheckedBigIntTruncatingWord64(FeedbackSource{}),
MachineRepresentation::kWord64);
VisitBinop<T>(
node, UseInfo::CheckedBigIntTruncatingWord64(FeedbackSource{}),
MachineRepresentation::kWord64);
if (lower()) {
ChangeToPureOp(node, lowering->machine()->Int64Add());
}
} else {
VisitBinop(node,
UseInfo::CheckedBigIntAsTaggedPointer(FeedbackSource{}),
MachineRepresentation::kTaggedPointer);
VisitBinop<T>(node,
UseInfo::CheckedBigIntAsTaggedPointer(FeedbackSource{}),
MachineRepresentation::kTaggedPointer);
if (lower()) {
NodeProperties::ChangeOp(node, lowering->simplified()->BigIntAdd());
}
......@@ -2839,16 +2855,16 @@ class RepresentationSelector {
}
case IrOpcode::kSpeculativeBigIntSubtract: {
if (truncation.IsUsedAsWord64()) {
VisitBinop(node,
UseInfo::CheckedBigIntTruncatingWord64(FeedbackSource{}),
MachineRepresentation::kWord64);
VisitBinop<T>(
node, UseInfo::CheckedBigIntTruncatingWord64(FeedbackSource{}),
MachineRepresentation::kWord64);
if (lower()) {
ChangeToPureOp(node, lowering->machine()->Int64Sub());
}
} else {
VisitBinop(node,
UseInfo::CheckedBigIntAsTaggedPointer(FeedbackSource{}),
MachineRepresentation::kTaggedPointer);
VisitBinop<T>(node,
UseInfo::CheckedBigIntAsTaggedPointer(FeedbackSource{}),
MachineRepresentation::kTaggedPointer);
if (lower()) {
NodeProperties::ChangeOp(node,
lowering->simplified()->BigIntSubtract());
......@@ -2890,16 +2906,16 @@ class RepresentationSelector {
case IrOpcode::kStringEqual:
case IrOpcode::kStringLessThan:
case IrOpcode::kStringLessThanOrEqual: {
return VisitBinop(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
return VisitBinop<T>(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
}
case IrOpcode::kStringCharCodeAt: {
return VisitBinop(node, UseInfo::AnyTagged(), UseInfo::Word(),
MachineRepresentation::kWord32);
return VisitBinop<T>(node, UseInfo::AnyTagged(), UseInfo::Word(),
MachineRepresentation::kWord32);
}
case IrOpcode::kStringCodePointAt: {
return VisitBinop(node, UseInfo::AnyTagged(), UseInfo::Word(),
MachineRepresentation::kTaggedSigned);
return VisitBinop<T>(node, UseInfo::AnyTagged(), UseInfo::Word(),
MachineRepresentation::kTaggedSigned);
}
case IrOpcode::kStringFromSingleCharCode: {
VisitUnop<T>(node, UseInfo::TruncatingWord32(),
......@@ -2912,8 +2928,8 @@ class RepresentationSelector {
return;
}
case IrOpcode::kStringFromCodePointAt: {
return VisitBinop(node, UseInfo::AnyTagged(), UseInfo::Word(),
MachineRepresentation::kTaggedPointer);
return VisitBinop<T>(node, UseInfo::AnyTagged(), UseInfo::Word(),
MachineRepresentation::kTaggedPointer);
}
case IrOpcode::kStringIndexOf: {
ProcessInput<T>(node, 0, UseInfo::AnyTagged());
......@@ -2945,7 +2961,7 @@ class RepresentationSelector {
return;
}
case IrOpcode::kCheckBounds:
return VisitCheckBounds(node, lowering);
return VisitCheckBounds<T>(node, lowering);
case IrOpcode::kPoisonIndex: {
VisitUnop<T>(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
......@@ -3046,8 +3062,8 @@ class RepresentationSelector {
}
case IrOpcode::kLoadFieldByIndex: {
if (truncation.IsUnused()) return VisitUnused<T>(node);
VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
MachineRepresentation::kTagged);
VisitBinop<T>(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
MachineRepresentation::kTagged);
return;
}
case IrOpcode::kLoadField: {
......@@ -3091,13 +3107,13 @@ class RepresentationSelector {
case IrOpcode::kLoadElement: {
if (truncation.IsUnused()) return VisitUnused<T>(node);
ElementAccess access = ElementAccessOf(node->op());
VisitBinop(node, UseInfoForBasePointer(access), UseInfo::Word(),
access.machine_type.representation());
VisitBinop<T>(node, UseInfoForBasePointer(access), UseInfo::Word(),
access.machine_type.representation());
return;
}
case IrOpcode::kLoadStackArgument: {
if (truncation.IsUnused()) return VisitUnused<T>(node);
VisitBinop(node, UseInfo::Word(), MachineRepresentation::kTagged);
VisitBinop<T>(node, UseInfo::Word(), MachineRepresentation::kTagged);
return;
}
case IrOpcode::kStoreElement: {
......@@ -3222,8 +3238,8 @@ class RepresentationSelector {
}
case IrOpcode::kConvertReceiver: {
Type input_type = TypeOf(node->InputAt(0));
VisitBinop(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
VisitBinop<T>(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
if (lower()) {
// Try to optimize the {node} based on the input type.
if (input_type.Is(Type::Receiver())) {
......@@ -3504,8 +3520,8 @@ class RepresentationSelector {
return;
}
case IrOpcode::kNewArgumentsElements: {
VisitBinop(node, UseInfo::Word(), UseInfo::TaggedSigned(),
MachineRepresentation::kTaggedPointer);
VisitBinop<T>(node, UseInfo::Word(), UseInfo::TaggedSigned(),
MachineRepresentation::kTaggedPointer);
return;
}
case IrOpcode::kCheckFloat64Hole: {
......@@ -3570,8 +3586,8 @@ class RepresentationSelector {
}
case IrOpcode::kCheckEqualsSymbol:
case IrOpcode::kCheckEqualsInternalizedString:
return VisitBinop(node, UseInfo::AnyTagged(),
MachineRepresentation::kNone);
return VisitBinop<T>(node, UseInfo::AnyTagged(),
MachineRepresentation::kNone);
case IrOpcode::kMapGuard:
// Eliminate MapGuard nodes here.
return VisitUnused<T>(node);
......@@ -3591,8 +3607,8 @@ class RepresentationSelector {
node, UseInfo::CheckedHeapObjectAsTaggedPointer(FeedbackSource()),
MachineRepresentation::kBit);
case IrOpcode::kEnsureWritableFastElements:
return VisitBinop(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
return VisitBinop<T>(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedPointer);
case IrOpcode::kMaybeGrowFastElements: {
ProcessInput<T>(node, 0, UseInfo::AnyTagged()); // object
ProcessInput<T>(node, 1, UseInfo::AnyTagged()); // elements
......@@ -3652,16 +3668,16 @@ class RepresentationSelector {
case IrOpcode::kFindOrderedHashMapEntry: {
Type const key_type = TypeOf(node->InputAt(1));
if (key_type.Is(Type::Signed32OrMinusZero())) {
VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
MachineType::PointerRepresentation());
VisitBinop<T>(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
MachineType::PointerRepresentation());
if (lower()) {
NodeProperties::ChangeOp(
node,
lowering->simplified()->FindOrderedHashMapEntryForInt32Key());
}
} else {
VisitBinop(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedSigned);
VisitBinop<T>(node, UseInfo::AnyTagged(),
MachineRepresentation::kTaggedSigned);
}
return;
}
......
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