| 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 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 void Computation::PrintOperandsTo(BufferFormatter* f) const { | 117 void Computation::PrintOperandsTo(BufferFormatter* f) const { |
| 118 for (int i = 0; i < InputCount(); ++i) { | 118 for (int i = 0; i < InputCount(); ++i) { |
| 119 if (i > 0) f->Print(", "); | 119 if (i > 0) f->Print(", "); |
| 120 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); | 120 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 | 124 |
| 125 void UseVal::PrintTo(BufferFormatter* f) const { | 125 void UseVal::PrintTo(BufferFormatter* f) const { |
| 126 if (definition()->ssa_temp_index() != -1) { | 126 if (definition()->HasSSATemp()) { |
| 127 f->Print("v%d", definition()->ssa_temp_index()); | 127 f->Print("v%d", definition()->ssa_temp_index()); |
| 128 } else { | 128 } else { |
| 129 f->Print("t%d", definition()->temp_index()); | 129 f->Print("t%d", definition()->temp_index()); |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 | 132 |
| 133 | 133 |
| 134 void ConstantVal::PrintTo(BufferFormatter* f) const { | 134 void ConstantVal::PrintTo(BufferFormatter* f) const { |
| 135 f->Print("#%s", value().ToCString()); | 135 f->Print("#%s", value().ToCString()); |
| 136 } | 136 } |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 for (intptr_t i = 0; i < inputs_.length(); ++i) { | 388 for (intptr_t i = 0; i < inputs_.length(); ++i) { |
| 389 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); | 389 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); |
| 390 if (i < inputs_.length() - 1) f->Print(","); | 390 if (i < inputs_.length() - 1) f->Print(","); |
| 391 } | 391 } |
| 392 f->Print(")"); | 392 f->Print(")"); |
| 393 } | 393 } |
| 394 | 394 |
| 395 | 395 |
| 396 void ParameterInstr::PrintTo(BufferFormatter* f) const { | 396 void ParameterInstr::PrintTo(BufferFormatter* f) const { |
| 397 f->Print(" v%d <- parameter(%d)", | 397 f->Print(" v%d <- parameter(%d)", |
| 398 (ssa_temp_index() != -1) ? ssa_temp_index() : temp_index(), | 398 HasSSATemp() ? ssa_temp_index() : temp_index(), |
| 399 index()); | 399 index()); |
| 400 } | 400 } |
| 401 | 401 |
| 402 | 402 |
| 403 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { | 403 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { |
| 404 f->Print("%2d: [target", block_id()); | 404 f->Print("%2d: [target", block_id()); |
| 405 if (HasTryIndex()) { | 405 if (HasTryIndex()) { |
| 406 f->Print(" catch %d]", try_index()); | 406 f->Print(" catch %d]", try_index()); |
| 407 } else { | 407 } else { |
| 408 f->Print("]"); | 408 f->Print("]"); |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 | 411 |
| 412 | 412 |
| 413 void BindInstr::PrintTo(BufferFormatter* f) const { | 413 void BindInstr::PrintTo(BufferFormatter* f) const { |
| 414 if (!is_used()) { | 414 if (!is_used()) { |
| 415 f->Print(" "); | 415 f->Print(" "); |
| 416 } else if (ssa_temp_index() != -1) { | 416 } else if (HasSSATemp()) { |
| 417 f->Print(" v%d <- ", ssa_temp_index()); | 417 f->Print(" v%d <- ", ssa_temp_index()); |
| 418 } else { | 418 } else { |
| 419 f->Print(" t%d <- ", temp_index()); | 419 f->Print(" t%d <- ", temp_index()); |
| 420 } | 420 } |
| 421 computation()->PrintTo(f); | 421 computation()->PrintTo(f); |
| 422 } | 422 } |
| 423 | 423 |
| 424 | 424 |
| 425 void ReturnInstr::PrintTo(BufferFormatter* f) const { | 425 void ReturnInstr::PrintTo(BufferFormatter* f) const { |
| 426 f->Print(" %s ", DebugName()); | 426 f->Print(" %s ", DebugName()); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 if (InputAt(i)->IsConstant()) { | 645 if (InputAt(i)->IsConstant()) { |
| 646 InputAt(i)->PrintTo(f); | 646 InputAt(i)->PrintTo(f); |
| 647 } | 647 } |
| 648 } | 648 } |
| 649 f->Print("\""); | 649 f->Print("\""); |
| 650 } | 650 } |
| 651 } | 651 } |
| 652 | 652 |
| 653 | 653 |
| 654 void ParameterInstr::PrintToVisualizer(BufferFormatter* f) const { | 654 void ParameterInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 655 ASSERT(ssa_temp_index() != -1); | 655 ASSERT(HasSSATemp()); |
| 656 ASSERT(temp_index() == -1); | 656 ASSERT(temp_index() == -1); |
| 657 f->Print("v%d Parameter(%d)", ssa_temp_index(), index()); | 657 f->Print("v%d Parameter(%d)", ssa_temp_index(), index()); |
| 658 } | 658 } |
| 659 | 659 |
| 660 | 660 |
| 661 void TargetEntryInstr::PrintToVisualizer(BufferFormatter* f) const { | 661 void TargetEntryInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 662 f->Print("_ [target"); | 662 f->Print("_ [target"); |
| 663 if (HasTryIndex()) { | 663 if (HasTryIndex()) { |
| 664 f->Print(" catch %d]", try_index()); | 664 f->Print(" catch %d]", try_index()); |
| 665 } else { | 665 } else { |
| 666 f->Print("]"); | 666 f->Print("]"); |
| 667 } | 667 } |
| 668 } | 668 } |
| 669 | 669 |
| 670 | 670 |
| 671 void BindInstr::PrintToVisualizer(BufferFormatter* f) const { | 671 void BindInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 672 if (!is_used()) { | 672 if (!is_used()) { |
| 673 f->Print("_ "); | 673 f->Print("_ "); |
| 674 } else if (ssa_temp_index() != -1) { | 674 } else if (HasSSATemp()) { |
| 675 f->Print("v%d ", ssa_temp_index()); | 675 f->Print("v%d ", ssa_temp_index()); |
| 676 } else { | 676 } else { |
| 677 f->Print("t%d ", temp_index()); | 677 f->Print("t%d ", temp_index()); |
| 678 } | 678 } |
| 679 computation()->PrintTo(f); | 679 computation()->PrintTo(f); |
| 680 } | 680 } |
| 681 | 681 |
| 682 | 682 |
| 683 void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const { | 683 void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 684 f->Print("_ %s ", DebugName()); | 684 f->Print("_ %s ", DebugName()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { | 730 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { |
| 731 f->Print(" ["); | 731 f->Print(" ["); |
| 732 locations_[i].PrintTo(f); | 732 locations_[i].PrintTo(f); |
| 733 f->Print("]"); | 733 f->Print("]"); |
| 734 } | 734 } |
| 735 } | 735 } |
| 736 f->Print(" }"); | 736 f->Print(" }"); |
| 737 } | 737 } |
| 738 | 738 |
| 739 } // namespace dart | 739 } // namespace dart |
| OLD | NEW |