OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 int32_t upper_offset_; | 209 int32_t upper_offset_; |
210 HBasicBlock* basic_block_; | 210 HBasicBlock* basic_block_; |
211 HBoundsCheck* lower_check_; | 211 HBoundsCheck* lower_check_; |
212 HBoundsCheck* upper_check_; | 212 HBoundsCheck* upper_check_; |
213 BoundsCheckBbData* next_in_bb_; | 213 BoundsCheckBbData* next_in_bb_; |
214 BoundsCheckBbData* father_in_dt_; | 214 BoundsCheckBbData* father_in_dt_; |
215 | 215 |
216 void MoveIndexIfNecessary(HValue* index_raw, | 216 void MoveIndexIfNecessary(HValue* index_raw, |
217 HBoundsCheck* insert_before, | 217 HBoundsCheck* insert_before, |
218 HInstruction* end_of_scan_range) { | 218 HInstruction* end_of_scan_range) { |
219 ASSERT(index_raw->IsAdd() || index_raw->IsSub()); | 219 if (!index_raw->IsAdd() && !index_raw->IsSub()) { |
| 220 // index_raw can be HAdd(index_base, offset), HSub(index_base, offset), |
| 221 // or index_base directly. In the latter case, no need to move anything. |
| 222 return; |
| 223 } |
220 HArithmeticBinaryOperation* index = | 224 HArithmeticBinaryOperation* index = |
221 HArithmeticBinaryOperation::cast(index_raw); | 225 HArithmeticBinaryOperation::cast(index_raw); |
222 HValue* left_input = index->left(); | 226 HValue* left_input = index->left(); |
223 HValue* right_input = index->right(); | 227 HValue* right_input = index->right(); |
224 bool must_move_index = false; | 228 bool must_move_index = false; |
225 bool must_move_left_input = false; | 229 bool must_move_left_input = false; |
226 bool must_move_right_input = false; | 230 bool must_move_right_input = false; |
227 for (HInstruction* cursor = end_of_scan_range; cursor != insert_before;) { | 231 for (HInstruction* cursor = end_of_scan_range; cursor != insert_before;) { |
228 if (cursor == left_input) must_move_left_input = true; | 232 if (cursor == left_input) must_move_left_input = true; |
229 if (cursor == right_input) must_move_right_input = true; | 233 if (cursor == right_input) must_move_right_input = true; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 if (data->FatherInDominatorTree()) { | 404 if (data->FatherInDominatorTree()) { |
401 table_.Insert(data->Key(), data->FatherInDominatorTree(), zone()); | 405 table_.Insert(data->Key(), data->FatherInDominatorTree(), zone()); |
402 } else { | 406 } else { |
403 table_.Delete(data->Key()); | 407 table_.Delete(data->Key()); |
404 } | 408 } |
405 data = data->NextInBasicBlock(); | 409 data = data->NextInBasicBlock(); |
406 } | 410 } |
407 } | 411 } |
408 | 412 |
409 } } // namespace v8::internal | 413 } } // namespace v8::internal |
OLD | NEW |