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
parent 7f175058
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment