Index: src/compiler/simplified-lowering.cc |
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
index 1691f1618fc1e7b1486c856195fdfca078e7a187..658c32a5b0a67b75a2bae68db7532da44e0f0c1f 100644 |
--- a/src/compiler/simplified-lowering.cc |
+++ b/src/compiler/simplified-lowering.cc |
@@ -992,6 +992,18 @@ class RepresentationSelector { |
} |
} |
+ void VisitCheck(Node* node, Type* type, SimplifiedLowering* lowering) { |
+ if (InputIs(node, type)) { |
+ VisitUnop(node, UseInfo::AnyTagged(), |
+ MachineRepresentation::kTaggedPointer); |
+ if (lower()) DeferReplacement(node, node->InputAt(0)); |
+ } else { |
+ VisitUnop(node, UseInfo::CheckedHeapObjectAsTaggedPointer(), |
+ MachineRepresentation::kTaggedPointer); |
+ } |
+ return; |
+ } |
+ |
void VisitCall(Node* node, SimplifiedLowering* lowering) { |
const CallDescriptor* desc = CallDescriptorOf(node->op()); |
int params = static_cast<int>(desc->ParameterCount()); |
@@ -2390,14 +2402,7 @@ class RepresentationSelector { |
return; |
} |
case IrOpcode::kCheckInternalizedString: { |
- if (InputIs(node, Type::InternalizedString())) { |
- VisitUnop(node, UseInfo::AnyTagged(), |
- MachineRepresentation::kTaggedPointer); |
- if (lower()) DeferReplacement(node, node->InputAt(0)); |
- } else { |
- VisitUnop(node, UseInfo::CheckedHeapObjectAsTaggedPointer(), |
- MachineRepresentation::kTaggedPointer); |
- } |
+ VisitCheck(node, Type::InternalizedString(), lowering); |
return; |
} |
case IrOpcode::kCheckNumber: { |
@@ -2410,14 +2415,7 @@ class RepresentationSelector { |
return; |
} |
case IrOpcode::kCheckReceiver: { |
- if (InputIs(node, Type::Receiver())) { |
- VisitUnop(node, UseInfo::AnyTagged(), |
- MachineRepresentation::kTaggedPointer); |
- if (lower()) DeferReplacement(node, node->InputAt(0)); |
- } else { |
- VisitUnop(node, UseInfo::CheckedHeapObjectAsTaggedPointer(), |
- MachineRepresentation::kTaggedPointer); |
- } |
+ VisitCheck(node, Type::Receiver(), lowering); |
return; |
} |
case IrOpcode::kCheckSmi: { |
@@ -2433,14 +2431,11 @@ class RepresentationSelector { |
return; |
} |
case IrOpcode::kCheckString: { |
- if (InputIs(node, Type::String())) { |
- VisitUnop(node, UseInfo::AnyTagged(), |
- MachineRepresentation::kTaggedPointer); |
- if (lower()) DeferReplacement(node, node->InputAt(0)); |
- } else { |
- VisitUnop(node, UseInfo::CheckedHeapObjectAsTaggedPointer(), |
- MachineRepresentation::kTaggedPointer); |
- } |
+ VisitCheck(node, Type::String(), lowering); |
+ return; |
+ } |
+ case IrOpcode::kCheckSymbol: { |
+ VisitCheck(node, Type::Symbol(), lowering); |
return; |
} |