Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 bool LParallelMove::IsRedundant() const { | 33 bool LParallelMove::IsRedundant() const { |
| 34 for (int i = 0; i < move_operands_.length(); ++i) { | 34 for (int i = 0; i < move_operands_.length(); ++i) { |
| 35 if (!move_operands_[i].IsRedundant()) return false; | 35 if (!move_operands_[i].IsRedundant()) return false; |
| 36 } | 36 } |
| 37 return true; | 37 return true; |
| 38 } | 38 } |
| 39 | 39 |
| 40 | 40 |
| 41 void LParallelMove::PrintDataTo(StringStream* stream) const { | 41 void LParallelMove::PrintDataTo(StringStream* stream) const { |
| 42 bool first = true; | |
| 42 for (int i = move_operands_.length() - 1; i >= 0; --i) { | 43 for (int i = move_operands_.length() - 1; i >= 0; --i) { |
|
fschneider
2011/01/17 09:44:16
I'd also change the printint order to i=0..length-
Kevin Millikin (Chromium)
2011/01/17 10:13:09
I have no idea why it's backwards. I'll change it
| |
| 43 if (!move_operands_[i].IsEliminated()) { | 44 if (!move_operands_[i].IsEliminated()) { |
| 44 LOperand* from = move_operands_[i].from(); | 45 LOperand* source = move_operands_[i].source(); |
| 45 LOperand* to = move_operands_[i].to(); | 46 LOperand* destination = move_operands_[i].destination(); |
| 46 if (from->Equals(to)) { | 47 if (!first) stream->Add(" "); |
| 47 to->PrintTo(stream); | 48 first = false; |
| 49 if (source->Equals(destination)) { | |
| 50 destination->PrintTo(stream); | |
| 48 } else { | 51 } else { |
| 49 to->PrintTo(stream); | 52 destination->PrintTo(stream); |
| 50 stream->Add(" = "); | 53 stream->Add(" = "); |
|
William Hesse
2011/01/17 10:43:43
Why not use a "move arrow" "<-" rather than "=" wh
| |
| 51 from->PrintTo(stream); | 54 source->PrintTo(stream); |
| 52 } | 55 } |
| 53 stream->Add("; "); | 56 stream->Add(";"); |
| 54 } | 57 } |
| 55 } | 58 } |
| 56 } | 59 } |
| 57 | 60 |
| 58 | 61 |
| 59 void LEnvironment::PrintTo(StringStream* stream) { | 62 void LEnvironment::PrintTo(StringStream* stream) { |
| 60 stream->Add("[id=%d|", ast_id()); | 63 stream->Add("[id=%d|", ast_id()); |
| 61 stream->Add("[parameters=%d|", parameter_count()); | 64 stream->Add("[parameters=%d|", parameter_count()); |
| 62 stream->Add("[arguments_stack_height=%d|", arguments_stack_height()); | 65 stream->Add("[arguments_stack_height=%d|", arguments_stack_height()); |
| 63 for (int i = 0; i < values_.length(); ++i) { | 66 for (int i = 0; i < values_.length(); ++i) { |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 84 stream->Add("{"); | 87 stream->Add("{"); |
| 85 for (int i = 0; i < pointer_operands_.length(); ++i) { | 88 for (int i = 0; i < pointer_operands_.length(); ++i) { |
| 86 if (i != 0) stream->Add(";"); | 89 if (i != 0) stream->Add(";"); |
| 87 pointer_operands_[i]->PrintTo(stream); | 90 pointer_operands_[i]->PrintTo(stream); |
| 88 } | 91 } |
| 89 stream->Add("} @%d", position()); | 92 stream->Add("} @%d", position()); |
| 90 } | 93 } |
| 91 | 94 |
| 92 | 95 |
| 93 } } // namespace v8::internal | 96 } } // namespace v8::internal |
| OLD | NEW |