| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 template<typename T, int N> | 126 template<typename T, int N> |
| 127 void OperandContainer<T, N>::PrintOperandsTo(StringStream* stream) { | 127 void OperandContainer<T, N>::PrintOperandsTo(StringStream* stream) { |
| 128 for (int i = 0; i < N; i++) { | 128 for (int i = 0; i < N; i++) { |
| 129 if (i > 0) stream->Add(" "); | 129 if (i > 0) stream->Add(" "); |
| 130 elems_[i]->PrintTo(stream); | 130 elems_[i]->PrintTo(stream); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 | 134 |
| 135 void LLabel::PrintDataTo(StringStream* stream) { | 135 void LLabel::PrintDataTo(StringStream* stream) { |
| 136 LGap::PrintDataTo(stream); | |
| 137 LLabel* rep = replacement(); | 136 LLabel* rep = replacement(); |
| 138 if (rep != NULL) { | 137 if (rep != NULL) { |
| 139 stream->Add(" Dead block replaced with B%d", rep->block_id()); | 138 stream->Add(" Dead block replaced with B%d", rep->block_id()); |
| 140 } | 139 } |
| 141 } | 140 } |
| 142 | 141 |
| 143 | 142 |
| 144 bool LGap::IsRedundant() const { | 143 bool LGap::IsRedundant() const { |
| 145 for (int i = 0; i < 4; i++) { | 144 for (int i = 0; i < 4; i++) { |
| 146 if (parallel_moves_[i] != NULL && !parallel_moves_[i]->IsRedundant()) { | 145 if (parallel_moves_[i] != NULL && !parallel_moves_[i]->IsRedundant()) { |
| 147 return false; | 146 return false; |
| 148 } | 147 } |
| 149 } | 148 } |
| 150 | |
| 151 return true; | 149 return true; |
| 152 } | 150 } |
| 153 | 151 |
| 154 | 152 |
| 155 void LGap::PrintDataTo(StringStream* stream) { | 153 void LGap::PrintDataTo(StringStream* stream) { |
| 156 for (int i = 0; i < 4; i++) { | 154 for (int i = 0; i < 4; i++) { |
| 157 stream->Add("("); | 155 stream->Add("("); |
| 158 if (parallel_moves_[i] != NULL) { | 156 if (parallel_moves_[i] != NULL) { |
| 159 parallel_moves_[i]->PrintDataTo(stream); | 157 parallel_moves_[i]->PrintDataTo(stream); |
| 160 } | 158 } |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 HBasicBlock* block = graph()->blocks()->at(i); | 378 HBasicBlock* block = graph()->blocks()->at(i); |
| 381 int first = block->first_instruction_index(); | 379 int first = block->first_instruction_index(); |
| 382 int last = block->last_instruction_index(); | 380 int last = block->last_instruction_index(); |
| 383 LInstruction* first_instr = instructions()->at(first); | 381 LInstruction* first_instr = instructions()->at(first); |
| 384 LInstruction* last_instr = instructions()->at(last); | 382 LInstruction* last_instr = instructions()->at(last); |
| 385 | 383 |
| 386 LLabel* label = LLabel::cast(first_instr); | 384 LLabel* label = LLabel::cast(first_instr); |
| 387 if (last_instr->IsGoto()) { | 385 if (last_instr->IsGoto()) { |
| 388 LGoto* goto_instr = LGoto::cast(last_instr); | 386 LGoto* goto_instr = LGoto::cast(last_instr); |
| 389 if (!goto_instr->include_stack_check() && | 387 if (!goto_instr->include_stack_check() && |
| 390 label->IsRedundant() && | |
| 391 !label->is_loop_header()) { | 388 !label->is_loop_header()) { |
| 392 bool can_eliminate = true; | 389 bool can_eliminate = true; |
| 393 for (int i = first + 1; i < last && can_eliminate; ++i) { | 390 for (int i = first + 1; i < last && can_eliminate; ++i) { |
| 394 LInstruction* cur = instructions()->at(i); | 391 LInstruction* cur = instructions()->at(i); |
| 395 if (cur->IsGap()) { | 392 if (cur->IsGap()) { |
| 396 LGap* gap = LGap::cast(cur); | 393 LGap* gap = LGap::cast(cur); |
| 397 if (!gap->IsRedundant()) { | 394 if (!gap->IsRedundant()) { |
| 398 can_eliminate = false; | 395 can_eliminate = false; |
| 399 } | 396 } |
| 400 } else { | 397 } else { |
| (...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2128 | 2125 |
| 2129 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2126 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2130 HEnvironment* outer = current_block_->last_environment()->outer(); | 2127 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2131 current_block_->UpdateEnvironment(outer); | 2128 current_block_->UpdateEnvironment(outer); |
| 2132 return NULL; | 2129 return NULL; |
| 2133 } | 2130 } |
| 2134 | 2131 |
| 2135 } } // namespace v8::internal | 2132 } } // namespace v8::internal |
| 2136 | 2133 |
| 2137 #endif // V8_TARGET_ARCH_X64 | 2134 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |