457 } |
457 } |
458 } |
458 } |
459 |
459 |
460 // Iterate over all different indices |
460 // Iterate over all different indices |
461 if (_optimistic) { |
461 if (_optimistic) { |
462 for (int i=0; i<indices.length(); i++) { |
462 for (int i = 0; i < indices.length(); i++) { |
463 Instruction *index_instruction = indices.at(i); |
463 Instruction *index_instruction = indices.at(i); |
464 AccessIndexedInfo *info = _access_indexed_info[index_instruction->id()]; |
464 AccessIndexedInfo *info = _access_indexed_info[index_instruction->id()]; |
465 assert(info != NULL, "Info must not be null"); |
465 assert(info != NULL, "Info must not be null"); |
466 |
466 |
467 // if idx < 0, max > 0, max + idx may fall between 0 and |
467 // if idx < 0, max > 0, max + idx may fall between 0 and |
529 for (int j = 0; j<info->_list->length(); j++) { |
529 for (int j = 0; j<info->_list->length(); j++) { |
530 AccessIndexed *ai = info->_list->at(j); |
530 AccessIndexed *ai = info->_list->at(j); |
531 remove_range_check(ai); |
531 remove_range_check(ai); |
532 } |
532 } |
533 } |
533 } |
534 _access_indexed_info[index_instruction->id()] = NULL; |
534 } |
535 } |
|
536 indices.clear(); |
|
537 |
535 |
538 if (list_constant.length() > 1) { |
536 if (list_constant.length() > 1) { |
539 AccessIndexed *first = list_constant.at(0); |
537 AccessIndexed *first = list_constant.at(0); |
540 Instruction *insert_position = first->prev(); |
538 Instruction *insert_position = first->prev(); |
541 ValueStack *state = first->state_before(); |
539 ValueStack *state = first->state_before(); |
558 AccessIndexed *ai = list_constant.at(j); |
556 AccessIndexed *ai = list_constant.at(j); |
559 remove_range_check(ai); |
557 remove_range_check(ai); |
560 } |
558 } |
561 } |
559 } |
562 } |
560 } |
|
561 |
|
562 // Clear data structures for next array |
|
563 for (int i = 0; i < indices.length(); i++) { |
|
564 Instruction *index_instruction = indices.at(i); |
|
565 _access_indexed_info[index_instruction->id()] = NULL; |
|
566 } |
|
567 indices.clear(); |
563 } |
568 } |
564 } |
569 } |
565 |
570 |
566 bool RangeCheckEliminator::set_process_block_flags(BlockBegin *block) { |
571 bool RangeCheckEliminator::set_process_block_flags(BlockBegin *block) { |
567 Instruction *cur = block; |
572 Instruction *cur = block; |