| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/il_printer.h" | 5 #include "vm/il_printer.h" |
| 6 | 6 |
| 7 #include "vm/intermediate_language.h" | 7 #include "vm/intermediate_language.h" |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 #include "vm/parser.h" | 9 #include "vm/parser.h" |
| 10 | 10 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 | 144 |
| 145 void Computation::PrintOperandsTo(BufferFormatter* f) const { | 145 void Computation::PrintOperandsTo(BufferFormatter* f) const { |
| 146 for (int i = 0; i < InputCount(); ++i) { | 146 for (int i = 0; i < InputCount(); ++i) { |
| 147 if (i > 0) f->Print(", "); | 147 if (i > 0) f->Print(", "); |
| 148 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); | 148 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 | 151 |
| 152 | 152 |
| 153 void UseVal::PrintTo(BufferFormatter* f) const { | 153 void Value::PrintTo(BufferFormatter* f) const { |
| 154 if (definition()->HasSSATemp()) { | 154 if (definition()->HasSSATemp()) { |
| 155 f->Print("v%d", definition()->ssa_temp_index()); | 155 f->Print("v%d", definition()->ssa_temp_index()); |
| 156 } else { | 156 } else { |
| 157 f->Print("t%d", definition()->temp_index()); | 157 f->Print("t%d", definition()->temp_index()); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 void ConstantComp::PrintOperandsTo(BufferFormatter* f) const { | 162 void ConstantComp::PrintOperandsTo(BufferFormatter* f) const { |
| 163 f->Print("#%s", value().ToCString()); | 163 f->Print("#%s", value().ToCString()); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 f->Print("}"); | 422 f->Print("}"); |
| 423 } | 423 } |
| 424 | 424 |
| 425 | 425 |
| 426 void GraphEntryInstr::PrintTo(BufferFormatter* f) const { | 426 void GraphEntryInstr::PrintTo(BufferFormatter* f) const { |
| 427 f->Print("%2d: [graph]", block_id()); | 427 f->Print("%2d: [graph]", block_id()); |
| 428 if (start_env_ != NULL) { | 428 if (start_env_ != NULL) { |
| 429 f->Print("\n{\n"); | 429 f->Print("\n{\n"); |
| 430 const GrowableArray<Value*>& values = start_env_->values(); | 430 const GrowableArray<Value*>& values = start_env_->values(); |
| 431 for (intptr_t i = 0; i < values.length(); i++) { | 431 for (intptr_t i = 0; i < values.length(); i++) { |
| 432 if (values[i]->IsUse()) { | 432 Definition* def = values[i]->definition(); |
| 433 Definition* def = values[i]->AsUse()->definition(); | 433 f->Print(" ", i); |
| 434 f->Print(" ", i); | 434 def->PrintTo(f); |
| 435 def->PrintTo(f); | 435 f->Print("\n"); |
| 436 f->Print("\n"); | |
| 437 } | |
| 438 } | 436 } |
| 439 f->Print("} "); | 437 f->Print("} "); |
| 440 start_env_->PrintTo(f); | 438 start_env_->PrintTo(f); |
| 441 } | 439 } |
| 442 } | 440 } |
| 443 | 441 |
| 444 | 442 |
| 445 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { | 443 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { |
| 446 f->Print("%2d: [join]", block_id()); | 444 f->Print("%2d: [join]", block_id()); |
| 447 if (phis_ != NULL) { | 445 if (phis_ != NULL) { |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 if ((locations_ != NULL) && !locations_[i].IsInvalid()) { | 808 if ((locations_ != NULL) && !locations_[i].IsInvalid()) { |
| 811 f->Print(" ["); | 809 f->Print(" ["); |
| 812 locations_[i].PrintTo(f); | 810 locations_[i].PrintTo(f); |
| 813 f->Print("]"); | 811 f->Print("]"); |
| 814 } | 812 } |
| 815 } | 813 } |
| 816 f->Print(" }"); | 814 f->Print(" }"); |
| 817 } | 815 } |
| 818 | 816 |
| 819 } // namespace dart | 817 } // namespace dart |
| OLD | NEW |