Index: src/compiler/simplified-lowering.cc |
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
index 09a157f93564319d04276a671dfa0cf7759e6434..9e1cf22543af90ff5929e016b0955e4ed84da551 100644 |
--- a/src/compiler/simplified-lowering.cc |
+++ b/src/compiler/simplified-lowering.cc |
@@ -822,10 +822,17 @@ class RepresentationSelector { |
return MachineRepresentation::kWord32; |
} else if (type->Is(Type::Boolean())) { |
return MachineRepresentation::kBit; |
- } else if (type->Is(Type::Number())) { |
- return MachineRepresentation::kFloat64; |
} else if (use.IsUsedAsFloat64()) { |
return MachineRepresentation::kFloat64; |
+ } else if (type->Is( |
+ Type::Union(Type::SignedSmall(), Type::NaN(), zone()))) { |
+ // TODO(turbofan): For Phis that return either NaN or some Smi, it's |
+ // beneficial to not go all the way to double, unless the uses are |
+ // double uses. For tagging that just means some potentially expensive |
+ // allocation code; we might want to do the same for -0 as well? |
+ return MachineRepresentation::kTagged; |
+ } else if (type->Is(Type::Number())) { |
+ return MachineRepresentation::kFloat64; |
} else if (type->Is(Type::Internal())) { |
// We mark (u)int64 as Type::Internal. |
// TODO(jarin) This is a workaround for our lack of (u)int64 |
@@ -1936,6 +1943,11 @@ class RepresentationSelector { |
} |
return; |
} |
+ case IrOpcode::kStringCharCodeAt: { |
+ VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(), |
+ MachineRepresentation::kWord32); |
+ return; |
+ } |
case IrOpcode::kStringFromCharCode: { |
VisitUnop(node, UseInfo::TruncatingWord32(), |
MachineRepresentation::kTagged); |