From 4ac1aa533dca18648c8eab02a9bd8c7a6a9483dc Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Thu, 13 Jun 2013 14:58:41 +0000 Subject: [PATCH] Temporarily patch HCompareIDAndBranch to accept Smi. R=jkummerow@chromium.org Review URL: https://chromiumcodereview.appspot.com/16957005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hydrogen.cc b/src/hydrogen.cc index e86d216120..f47b1ab072 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -9687,6 +9687,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(); @@ -9920,6 +9921,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);