Index: src/compiler/representation-change.cc |
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc |
index 7a5a43e61a9a51ebe7138664b5a2744f48aaf7fb..9b834d84179bdb92908bb2f2e2cb4b26e1c79b9e 100644 |
--- a/src/compiler/representation-change.cc |
+++ b/src/compiler/representation-change.cc |
@@ -271,9 +271,15 @@ Node* RepresentationChanger::GetTaggedSignedRepresentationFor( |
return TypeError(node, output_rep, output_type, |
MachineRepresentation::kTaggedSigned); |
} |
- } else if (CanBeTaggedPointer(output_rep) && |
- use_info.type_check() == TypeCheckKind::kSignedSmall) { |
- op = simplified()->CheckedTaggedToTaggedSigned(); |
+ } else if (CanBeTaggedPointer(output_rep)) { |
+ if (use_info.type_check() == TypeCheckKind::kSignedSmall) { |
+ op = simplified()->CheckedTaggedToTaggedSigned(); |
+ } else if (output_type->Is(Type::SignedSmall())) { |
+ op = simplified()->ChangeTaggedToTaggedSigned(); |
+ } else { |
+ return TypeError(node, output_rep, output_type, |
+ MachineRepresentation::kTaggedSigned); |
+ } |
} else if (output_rep == MachineRepresentation::kBit && |
use_info.type_check() == TypeCheckKind::kSignedSmall) { |
// TODO(turbofan): Consider adding a Bailout operator that just deopts. |