Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 3d0d5505aea05800177fdce62d85f9cafe7dcaef..696f279663abadca08af066fcf1b0d70f8639088 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -9684,6 +9684,7 @@ void HOptimizedGraphBuilder::VisitArithmeticExpression(BinaryOperation* expr) { |
// TODO(rossberg): this should die eventually. |
Representation HOptimizedGraphBuilder::ToRepresentation(TypeInfo info) { |
if (info.IsUninitialized()) return Representation::None(); |
+ // TODO(verwaest): Return Smi rather than Integer32. |
if (info.IsSmi()) return Representation::Integer32(); |
if (info.IsInteger32()) return Representation::Integer32(); |
if (info.IsDouble()) return Representation::Double(); |
@@ -9917,6 +9918,10 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) { |
result->set_position(expr->position()); |
return ast_context()->ReturnInstruction(result, expr->id()); |
} else { |
+ // TODO(verwaest): Remove once ToRepresentation properly returns Smi when |
+ // the IC measures Smi. |
+ if (left_type->Is(Type::Integer31())) left_rep = Representation::Smi(); |
+ if (right_type->Is(Type::Integer31())) right_rep = Representation::Smi(); |
HCompareIDAndBranch* result = |
new(zone()) HCompareIDAndBranch(left, right, op); |
result->set_observed_input_representation(left_rep, right_rep); |