Index: src/compiler/effect-control-linearizer.cc |
diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc |
index 362df3ae31758a4180f00a4ac13c4f09e240148d..43d260153ca4d9e56ceb570acb5c24ad349d1ef1 100644 |
--- a/src/compiler/effect-control-linearizer.cc |
+++ b/src/compiler/effect-control-linearizer.cc |
@@ -636,11 +636,8 @@ bool EffectControlLinearizer::TryWireInStateEffect(Node* node, |
case IrOpcode::kCheckIf: |
state = LowerCheckIf(node, frame_state, *effect, *control); |
break; |
- case IrOpcode::kCheckTaggedPointer: |
- state = LowerCheckTaggedPointer(node, frame_state, *effect, *control); |
- break; |
- case IrOpcode::kCheckTaggedSigned: |
- state = LowerCheckTaggedSigned(node, frame_state, *effect, *control); |
+ case IrOpcode::kCheckHeapObject: |
+ state = LowerCheckHeapObject(node, frame_state, *effect, *control); |
break; |
case IrOpcode::kCheckedInt32Add: |
state = LowerCheckedInt32Add(node, frame_state, *effect, *control); |
@@ -663,9 +660,17 @@ bool EffectControlLinearizer::TryWireInStateEffect(Node* node, |
case IrOpcode::kCheckedInt32Mul: |
state = LowerCheckedInt32Mul(node, frame_state, *effect, *control); |
break; |
+ case IrOpcode::kCheckedInt32ToTaggedSigned: |
+ state = |
+ LowerCheckedInt32ToTaggedSigned(node, frame_state, *effect, *control); |
+ break; |
case IrOpcode::kCheckedUint32ToInt32: |
state = LowerCheckedUint32ToInt32(node, frame_state, *effect, *control); |
break; |
+ case IrOpcode::kCheckedUint32ToTaggedSigned: |
+ state = LowerCheckedUint32ToTaggedSigned(node, frame_state, *effect, |
+ *control); |
+ break; |
case IrOpcode::kCheckedFloat64ToInt32: |
state = LowerCheckedFloat64ToInt32(node, frame_state, *effect, *control); |
break; |
@@ -679,6 +684,10 @@ bool EffectControlLinearizer::TryWireInStateEffect(Node* node, |
case IrOpcode::kCheckedTaggedToFloat64: |
state = LowerCheckedTaggedToFloat64(node, frame_state, *effect, *control); |
break; |
+ case IrOpcode::kCheckedTaggedToTaggedSigned: |
+ state = LowerCheckedTaggedToTaggedSigned(node, frame_state, *effect, |
+ *control); |
+ break; |
case IrOpcode::kTruncateTaggedToWord32: |
state = LowerTruncateTaggedToWord32(node, *effect, *control); |
break; |
@@ -1320,8 +1329,8 @@ EffectControlLinearizer::LowerCheckIf(Node* node, Node* frame_state, |
} |
EffectControlLinearizer::ValueEffectControl |
-EffectControlLinearizer::LowerCheckTaggedPointer(Node* node, Node* frame_state, |
- Node* effect, Node* control) { |
+EffectControlLinearizer::LowerCheckHeapObject(Node* node, Node* frame_state, |
+ Node* effect, Node* control) { |
Node* value = node->InputAt(0); |
Node* check = ObjectIsSmi(value); |
@@ -1333,19 +1342,6 @@ EffectControlLinearizer::LowerCheckTaggedPointer(Node* node, Node* frame_state, |
} |
EffectControlLinearizer::ValueEffectControl |
-EffectControlLinearizer::LowerCheckTaggedSigned(Node* node, Node* frame_state, |
- Node* effect, Node* control) { |
- Node* value = node->InputAt(0); |
- |
- Node* check = ObjectIsSmi(value); |
- control = effect = |
- graph()->NewNode(common()->DeoptimizeUnless(DeoptimizeReason::kNotASmi), |
- check, frame_state, effect, control); |
- |
- return ValueEffectControl(value, effect, control); |
-} |
- |
-EffectControlLinearizer::ValueEffectControl |
EffectControlLinearizer::LowerCheckedInt32Add(Node* node, Node* frame_state, |
Node* effect, Node* control) { |
Node* lhs = node->InputAt(0); |
@@ -1671,6 +1667,27 @@ EffectControlLinearizer::LowerCheckedInt32Mul(Node* node, Node* frame_state, |
} |
EffectControlLinearizer::ValueEffectControl |
+EffectControlLinearizer::LowerCheckedInt32ToTaggedSigned(Node* node, |
+ Node* frame_state, |
+ Node* effect, |
+ Node* control) { |
+ DCHECK(SmiValuesAre31Bits()); |
+ Node* value = node->InputAt(0); |
+ |
+ Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), value, value, |
+ control); |
+ |
+ Node* check = graph()->NewNode(common()->Projection(1), add, control); |
+ control = effect = |
+ graph()->NewNode(common()->DeoptimizeIf(DeoptimizeReason::kOverflow), |
+ check, frame_state, effect, control); |
+ |
+ value = graph()->NewNode(common()->Projection(0), add, control); |
+ |
+ return ValueEffectControl(value, effect, control); |
+} |
+ |
+EffectControlLinearizer::ValueEffectControl |
EffectControlLinearizer::LowerCheckedUint32ToInt32(Node* node, |
Node* frame_state, |
Node* effect, |
@@ -1687,6 +1704,22 @@ EffectControlLinearizer::LowerCheckedUint32ToInt32(Node* node, |
} |
EffectControlLinearizer::ValueEffectControl |
+EffectControlLinearizer::LowerCheckedUint32ToTaggedSigned(Node* node, |
+ Node* frame_state, |
+ Node* effect, |
+ Node* control) { |
+ Node* value = node->InputAt(0); |
+ Node* check = graph()->NewNode(machine()->Uint32LessThanOrEqual(), value, |
+ SmiMaxValueConstant()); |
+ control = effect = graph()->NewNode( |
+ common()->DeoptimizeUnless(DeoptimizeReason::kLostPrecision), check, |
+ frame_state, effect, control); |
+ value = ChangeUint32ToSmi(value); |
+ |
+ return ValueEffectControl(value, effect, control); |
+} |
+ |
+EffectControlLinearizer::ValueEffectControl |
EffectControlLinearizer::BuildCheckedFloat64ToInt32(CheckForMinusZeroMode mode, |
Node* value, |
Node* frame_state, |
@@ -1891,6 +1924,21 @@ EffectControlLinearizer::LowerCheckedTaggedToFloat64(Node* node, |
} |
EffectControlLinearizer::ValueEffectControl |
+EffectControlLinearizer::LowerCheckedTaggedToTaggedSigned(Node* node, |
+ Node* frame_state, |
+ Node* effect, |
+ Node* control) { |
+ Node* value = node->InputAt(0); |
+ |
+ Node* check = ObjectIsSmi(value); |
+ control = effect = |
+ graph()->NewNode(common()->DeoptimizeUnless(DeoptimizeReason::kNotASmi), |
+ check, frame_state, effect, control); |
+ |
+ return ValueEffectControl(value, effect, control); |
+} |
+ |
+EffectControlLinearizer::ValueEffectControl |
EffectControlLinearizer::LowerTruncateTaggedToWord32(Node* node, Node* effect, |
Node* control) { |
Node* value = node->InputAt(0); |