Index: src/compiler/effect-control-linearizer.cc |
diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc |
index 959712f075fc3f34e7c51426f6a0efa7b04ff98b..6ad238e6ada1d5a1e58ddfbf09cbaf36a981d5ee 100644 |
--- a/src/compiler/effect-control-linearizer.cc |
+++ b/src/compiler/effect-control-linearizer.cc |
@@ -625,6 +625,9 @@ bool EffectControlLinearizer::TryWireInStateEffect(Node* node, |
case IrOpcode::kCheckNumber: |
state = LowerCheckNumber(node, frame_state, *effect, *control); |
break; |
+ case IrOpcode::kCheckString: |
+ state = LowerCheckString(node, frame_state, *effect, *control); |
+ break; |
case IrOpcode::kCheckIf: |
state = LowerCheckIf(node, frame_state, *effect, *control); |
break; |
@@ -1044,6 +1047,32 @@ EffectControlLinearizer::LowerCheckNumber(Node* node, Node* frame_state, |
} |
EffectControlLinearizer::ValueEffectControl |
+EffectControlLinearizer::LowerCheckString(Node* node, Node* frame_state, |
+ Node* effect, Node* control) { |
+ Node* value = node->InputAt(0); |
+ |
+ Node* check0 = ObjectIsSmi(value); |
+ control = effect = |
+ graph()->NewNode(common()->DeoptimizeIf(DeoptimizeReason::kSmi), check0, |
+ frame_state, effect, control); |
+ |
+ Node* value_map = effect = graph()->NewNode( |
+ simplified()->LoadField(AccessBuilder::ForMap()), value, effect, control); |
+ Node* value_instance_type = effect = graph()->NewNode( |
+ simplified()->LoadField(AccessBuilder::ForMapInstanceType()), value_map, |
+ effect, control); |
+ |
+ Node* check1 = |
+ graph()->NewNode(machine()->Uint32LessThan(), value_instance_type, |
+ jsgraph()->Uint32Constant(FIRST_NONSTRING_TYPE)); |
+ control = effect = graph()->NewNode( |
+ common()->DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType), check1, |
+ frame_state, effect, control); |
+ |
+ return ValueEffectControl(value, effect, control); |
+} |
+ |
+EffectControlLinearizer::ValueEffectControl |
EffectControlLinearizer::LowerCheckIf(Node* node, Node* frame_state, |
Node* effect, Node* control) { |
Node* value = node->InputAt(0); |