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