Index: src/compiler/simplified-lowering.cc |
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
index 4bba861313aeb7195ff01deb4469a576e6341bd3..3eb10c21988d5e68c70d7f702c78549b799621f6 100644 |
--- a/src/compiler/simplified-lowering.cc |
+++ b/src/compiler/simplified-lowering.cc |
@@ -474,32 +474,23 @@ class RepresentationSelector { |
bool CanLowerToInt32Binop(Node* node, MachineTypeUnion use) { |
return BothInputsAre(node, Type::Signed32()) && |
- (!CanObserveNonInt32(use) || |
+ (!CanObserveNonWord32(use) || |
NodeProperties::GetType(node)->Is(Type::Signed32())); |
} |
- bool CanLowerToInt32AdditiveBinop(Node* node, MachineTypeUnion use) { |
+ bool CanLowerToWord32AdditiveBinop(Node* node, MachineTypeUnion use) { |
return BothInputsAre(node, safe_int_additive_range_) && |
- !CanObserveNonInt32(use); |
+ !CanObserveNonWord32(use); |
} |
bool CanLowerToUint32Binop(Node* node, MachineTypeUnion use) { |
return BothInputsAre(node, Type::Unsigned32()) && |
- (!CanObserveNonUint32(use) || |
+ (!CanObserveNonWord32(use) || |
NodeProperties::GetType(node)->Is(Type::Unsigned32())); |
} |
- bool CanLowerToUint32AdditiveBinop(Node* node, MachineTypeUnion use) { |
- return BothInputsAre(node, safe_int_additive_range_) && |
- !CanObserveNonUint32(use); |
- } |
- |
bool CanObserveNonWord32(MachineTypeUnion use) { |
- return (use & ~(kTypeUint32 | kTypeInt32)) != 0; |
- } |
- |
- bool CanObserveNonInt32(MachineTypeUnion use) { |
- return (use & (kTypeUint32 | kTypeNumber | kTypeAny)) != 0; |
+ return (use & kTypeMask & ~(kTypeInt32 | kTypeUint32)) != 0; |
} |
bool CanObserveMinusZero(MachineTypeUnion use) { |
@@ -511,10 +502,6 @@ class RepresentationSelector { |
return (use & (kTypeNumber | kTypeAny)) != 0; |
} |
- bool CanObserveNonUint32(MachineTypeUnion use) { |
- return (use & (kTypeInt32 | kTypeNumber | kTypeAny)) != 0; |
- } |
- |
// Dispatching routine for visiting the node {node} with the usage {use}. |
// Depending on the operator, propagate new usage info to the inputs. |
void VisitNode(Node* node, MachineTypeUnion use, |
@@ -644,22 +631,16 @@ class RepresentationSelector { |
// => signed Int32Add/Sub |
VisitInt32Binop(node); |
if (lower()) NodeProperties::ChangeOp(node, Int32Op(node)); |
- } else if (CanLowerToInt32AdditiveBinop(node, use)) { |
- // => signed Int32Add/Sub, truncating inputs |
- ProcessTruncateWord32Input(node, 0, kTypeInt32); |
- ProcessTruncateWord32Input(node, 1, kTypeInt32); |
- SetOutput(node, kMachInt32); |
- if (lower()) NodeProperties::ChangeOp(node, Int32Op(node)); |
} else if (CanLowerToUint32Binop(node, use)) { |
// => unsigned Int32Add/Sub |
VisitUint32Binop(node); |
if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node)); |
- } else if (CanLowerToUint32AdditiveBinop(node, use)) { |
+ } else if (CanLowerToWord32AdditiveBinop(node, use)) { |
// => signed Int32Add/Sub, truncating inputs |
- ProcessTruncateWord32Input(node, 0, kTypeUint32); |
- ProcessTruncateWord32Input(node, 1, kTypeUint32); |
- SetOutput(node, kMachUint32); |
- if (lower()) NodeProperties::ChangeOp(node, Uint32Op(node)); |
+ ProcessTruncateWord32Input(node, 0, kTypeInt32); |
+ ProcessTruncateWord32Input(node, 1, kTypeInt32); |
+ SetOutput(node, kMachInt32); |
+ if (lower()) NodeProperties::ChangeOp(node, Int32Op(node)); |
} else { |
// => Float64Add/Sub |
VisitFloat64Binop(node); |