OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 } | 1149 } |
1150 } | 1150 } |
1151 | 1151 |
1152 | 1152 |
1153 void HBoundsCheck::InferRepresentation(HInferRepresentation* h_infer) { | 1153 void HBoundsCheck::InferRepresentation(HInferRepresentation* h_infer) { |
1154 ASSERT(CheckFlag(kFlexibleRepresentation)); | 1154 ASSERT(CheckFlag(kFlexibleRepresentation)); |
1155 HValue* actual_index = index()->ActualValue(); | 1155 HValue* actual_index = index()->ActualValue(); |
1156 HValue* actual_length = length()->ActualValue(); | 1156 HValue* actual_length = length()->ActualValue(); |
1157 Representation index_rep = actual_index->representation(); | 1157 Representation index_rep = actual_index->representation(); |
1158 Representation length_rep = actual_length->representation(); | 1158 Representation length_rep = actual_length->representation(); |
1159 if (index_rep.IsTagged()) index_rep = Representation::Smi(); | 1159 if (index_rep.IsTagged() && actual_index->type().IsSmi()) { |
1160 if (length_rep.IsTagged()) length_rep = Representation::Smi(); | 1160 index_rep = Representation::Smi(); |
| 1161 } |
| 1162 if (length_rep.IsTagged() && actual_length->type().IsSmi()) { |
| 1163 length_rep = Representation::Smi(); |
| 1164 } |
1161 Representation r = index_rep.generalize(length_rep); | 1165 Representation r = index_rep.generalize(length_rep); |
1162 if (r.is_more_general_than(Representation::Integer32())) { | 1166 if (r.is_more_general_than(Representation::Integer32())) { |
1163 r = Representation::Integer32(); | 1167 r = Representation::Integer32(); |
1164 } | 1168 } |
1165 UpdateRepresentation(r, h_infer, "boundscheck"); | 1169 UpdateRepresentation(r, h_infer, "boundscheck"); |
1166 } | 1170 } |
1167 | 1171 |
1168 | 1172 |
1169 bool HBoundsCheckBaseIndexInformation::IsRelationTrueInternal( | 1173 bool HBoundsCheckBaseIndexInformation::IsRelationTrueInternal( |
1170 NumericRelation relation, | 1174 NumericRelation relation, |
(...skipping 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3881 case kBackingStore: | 3885 case kBackingStore: |
3882 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); | 3886 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); |
3883 stream->Add("[backing-store]"); | 3887 stream->Add("[backing-store]"); |
3884 break; | 3888 break; |
3885 } | 3889 } |
3886 | 3890 |
3887 stream->Add("@%d", offset()); | 3891 stream->Add("@%d", offset()); |
3888 } | 3892 } |
3889 | 3893 |
3890 } } // namespace v8::internal | 3894 } } // namespace v8::internal |
OLD | NEW |