Index: src/compiler/simplified-lowering.cc |
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
index ac0f53af9d0c686483d3c8d2c4d77f4a6f9e6f0a..ee1d7b7a8132c693c30a87c226fc94970e95fed6 100644 |
--- a/src/compiler/simplified-lowering.cc |
+++ b/src/compiler/simplified-lowering.cc |
@@ -1860,9 +1860,18 @@ class RepresentationSelector { |
return; |
} |
case IrOpcode::kCheckTaggedHole: { |
- ProcessInput(node, 0, UseInfo::AnyTagged()); |
- ProcessRemainingInputs(node, 1); |
- SetOutput(node, MachineRepresentation::kTagged); |
+ CheckTaggedHoleMode mode = CheckTaggedHoleModeOf(node->op()); |
+ if (truncation.TruncatesToWord32() && |
+ mode == CheckTaggedHoleMode::kConvertHoleToUndefined) { |
+ ProcessInput(node, 0, UseInfo::CheckedSigned32AsWord32()); |
+ ProcessRemainingInputs(node, 1); |
+ SetOutput(node, MachineRepresentation::kWord32); |
+ if (lower()) DeferReplacement(node, node->InputAt(0)); |
+ } else { |
+ ProcessInput(node, 0, UseInfo::AnyTagged()); |
+ ProcessRemainingInputs(node, 1); |
+ SetOutput(node, MachineRepresentation::kTagged); |
+ } |
return; |
} |