| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 template<typename T, int N> | 124 template<typename T, int N> |
| 125 void OperandContainer<T, N>::PrintOperandsTo(StringStream* stream) { | 125 void OperandContainer<T, N>::PrintOperandsTo(StringStream* stream) { |
| 126 for (int i = 0; i < N; i++) { | 126 for (int i = 0; i < N; i++) { |
| 127 if (i > 0) stream->Add(" "); | 127 if (i > 0) stream->Add(" "); |
| 128 elems_[i]->PrintTo(stream); | 128 elems_[i]->PrintTo(stream); |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 | 131 |
| 132 | 132 |
| 133 void LLabel::PrintDataTo(StringStream* stream) { | 133 void LLabel::PrintDataTo(StringStream* stream) { |
| 134 LGap::PrintDataTo(stream); |
| 134 LLabel* rep = replacement(); | 135 LLabel* rep = replacement(); |
| 135 if (rep != NULL) { | 136 if (rep != NULL) { |
| 136 stream->Add(" Dead block replaced with B%d", rep->block_id()); | 137 stream->Add(" Dead block replaced with B%d", rep->block_id()); |
| 137 } | 138 } |
| 138 } | 139 } |
| 139 | 140 |
| 140 | 141 |
| 141 bool LGap::IsRedundant() const { | 142 bool LGap::IsRedundant() const { |
| 142 for (int i = 0; i < 4; i++) { | 143 for (int i = 0; i < 4; i++) { |
| 143 if (parallel_moves_[i] != NULL && !parallel_moves_[i]->IsRedundant()) { | 144 if (parallel_moves_[i] != NULL && !parallel_moves_[i]->IsRedundant()) { |
| 144 return false; | 145 return false; |
| 145 } | 146 } |
| 146 } | 147 } |
| 148 |
| 147 return true; | 149 return true; |
| 148 } | 150 } |
| 149 | 151 |
| 150 | 152 |
| 151 void LGap::PrintDataTo(StringStream* stream) const { | 153 void LGap::PrintDataTo(StringStream* stream) const { |
| 152 for (int i = 0; i < 4; i++) { | 154 for (int i = 0; i < 4; i++) { |
| 153 stream->Add("("); | 155 stream->Add("("); |
| 154 if (parallel_moves_[i] != NULL) { | 156 if (parallel_moves_[i] != NULL) { |
| 155 parallel_moves_[i]->PrintDataTo(stream); | 157 parallel_moves_[i]->PrintDataTo(stream); |
| 156 } | 158 } |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 HBasicBlock* block = graph()->blocks()->at(i); | 423 HBasicBlock* block = graph()->blocks()->at(i); |
| 422 int first = block->first_instruction_index(); | 424 int first = block->first_instruction_index(); |
| 423 int last = block->last_instruction_index(); | 425 int last = block->last_instruction_index(); |
| 424 LInstruction* first_instr = instructions()->at(first); | 426 LInstruction* first_instr = instructions()->at(first); |
| 425 LInstruction* last_instr = instructions()->at(last); | 427 LInstruction* last_instr = instructions()->at(last); |
| 426 | 428 |
| 427 LLabel* label = LLabel::cast(first_instr); | 429 LLabel* label = LLabel::cast(first_instr); |
| 428 if (last_instr->IsGoto()) { | 430 if (last_instr->IsGoto()) { |
| 429 LGoto* goto_instr = LGoto::cast(last_instr); | 431 LGoto* goto_instr = LGoto::cast(last_instr); |
| 430 if (!goto_instr->include_stack_check() && | 432 if (!goto_instr->include_stack_check() && |
| 433 label->IsRedundant() && |
| 431 !label->is_loop_header()) { | 434 !label->is_loop_header()) { |
| 432 bool can_eliminate = true; | 435 bool can_eliminate = true; |
| 433 for (int i = first + 1; i < last && can_eliminate; ++i) { | 436 for (int i = first + 1; i < last && can_eliminate; ++i) { |
| 434 LInstruction* cur = instructions()->at(i); | 437 LInstruction* cur = instructions()->at(i); |
| 435 if (cur->IsGap()) { | 438 if (cur->IsGap()) { |
| 436 LGap* gap = LGap::cast(cur); | 439 LGap* gap = LGap::cast(cur); |
| 437 if (!gap->IsRedundant()) { | 440 if (!gap->IsRedundant()) { |
| 438 can_eliminate = false; | 441 can_eliminate = false; |
| 439 } | 442 } |
| 440 } else { | 443 } else { |
| (...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 | 2132 |
| 2130 | 2133 |
| 2131 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2134 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2132 HEnvironment* outer = current_block_->last_environment()->outer(); | 2135 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2133 current_block_->UpdateEnvironment(outer); | 2136 current_block_->UpdateEnvironment(outer); |
| 2134 return NULL; | 2137 return NULL; |
| 2135 } | 2138 } |
| 2136 | 2139 |
| 2137 | 2140 |
| 2138 } } // namespace v8::internal | 2141 } } // namespace v8::internal |
| OLD | NEW |