From: jkummerow@chromium.org Date: Fri, 21 Jun 2013 12:50:02 +0000 (+0000) Subject: HBoundsCheck shouldn't ignore Tagged input representations unconditionally X-Git-Tag: upstream/4.7.83~13730 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbc8ed7110544e10d3205dac954ef7ff83b7e575;p=platform%2Fupstream%2Fv8.git HBoundsCheck shouldn't ignore Tagged input representations unconditionally BUG=v8:2740 R=yangguo@chromium.org Review URL: https://codereview.chromium.org/16917003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15267 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index 9185a74..ebb0ad5 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -1156,8 +1156,12 @@ void HBoundsCheck::InferRepresentation(HInferRepresentation* h_infer) { HValue* actual_length = length()->ActualValue(); Representation index_rep = actual_index->representation(); Representation length_rep = actual_length->representation(); - if (index_rep.IsTagged()) index_rep = Representation::Smi(); - if (length_rep.IsTagged()) length_rep = Representation::Smi(); + if (index_rep.IsTagged() && actual_index->type().IsSmi()) { + index_rep = Representation::Smi(); + } + if (length_rep.IsTagged() && actual_length->type().IsSmi()) { + length_rep = Representation::Smi(); + } Representation r = index_rep.generalize(length_rep); if (r.is_more_general_than(Representation::Integer32())) { r = Representation::Integer32();