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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (nodes_[i]->operand()->Equals(operand)) return nodes_[i]; | 169 if (nodes_[i]->operand()->Equals(operand)) return nodes_[i]; |
170 } | 170 } |
171 | 171 |
172 // No node found => create a new one. | 172 // No node found => create a new one. |
173 LGapNode* result = new LGapNode(operand); | 173 LGapNode* result = new LGapNode(operand); |
174 nodes_.Add(result); | 174 nodes_.Add(result); |
175 return result; | 175 return result; |
176 } | 176 } |
177 | 177 |
178 | 178 |
| 179 bool LParallelMove::IsRedundant() const { |
| 180 for (int i = 0; i < move_operands_.length(); ++i) { |
| 181 if (!move_operands_[i].IsRedundant()) return false; |
| 182 } |
| 183 return true; |
| 184 } |
| 185 |
| 186 |
| 187 void LParallelMove::PrintDataTo(StringStream* stream) const { |
| 188 for (int i = move_operands_.length() - 1; i >= 0; --i) { |
| 189 if (!move_operands_[i].IsEliminated()) { |
| 190 LOperand* from = move_operands_[i].from(); |
| 191 LOperand* to = move_operands_[i].to(); |
| 192 if (from->Equals(to)) { |
| 193 to->PrintTo(stream); |
| 194 } else { |
| 195 to->PrintTo(stream); |
| 196 stream->Add(" = "); |
| 197 from->PrintTo(stream); |
| 198 } |
| 199 stream->Add("; "); |
| 200 } |
| 201 } |
| 202 } |
| 203 |
| 204 |
179 } } // namespace v8::internal | 205 } } // namespace v8::internal |
OLD | NEW |