| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 if (HasParallelMove()) { | 547 if (HasParallelMove()) { |
| 548 parallel_move()->PrintTo(f); | 548 parallel_move()->PrintTo(f); |
| 549 } else { | 549 } else { |
| 550 f->Print(" "); | 550 f->Print(" "); |
| 551 } | 551 } |
| 552 f->Print(" goto %d", successor()->block_id()); | 552 f->Print(" goto %d", successor()->block_id()); |
| 553 } | 553 } |
| 554 | 554 |
| 555 | 555 |
| 556 void BranchInstr::PrintTo(BufferFormatter* f) const { | 556 void BranchInstr::PrintTo(BufferFormatter* f) const { |
| 557 f->Print(" %s:%d ", DebugName(), deopt_id()); | 557 f->Print(" %s ", DebugName()); |
| 558 f->Print("if "); | 558 f->Print("if "); |
| 559 left()->PrintTo(f); | 559 computation()->PrintTo(f); |
| 560 f-> Print(" %s ", Token::Str(kind())); | |
| 561 right()->PrintTo(f); | |
| 562 | 560 |
| 563 f->Print(" goto (%d, %d)", | 561 f->Print(" goto (%d, %d)", |
| 564 true_successor()->block_id(), | 562 true_successor()->block_id(), |
| 565 false_successor()->block_id()); | 563 false_successor()->block_id()); |
| 566 if (HasICData()) { | |
| 567 PrintICData(f, *ic_data()); | |
| 568 } | |
| 569 } | |
| 570 | |
| 571 | |
| 572 void StrictCompareAndBranchInstr::PrintTo(BufferFormatter* f) const { | |
| 573 f->Print(" %s", DebugName()); | |
| 574 f->Print("if "); | |
| 575 left()->PrintTo(f); | |
| 576 f-> Print(" %s ", Token::Str(kind())); | |
| 577 right()->PrintTo(f); | |
| 578 f->Print(" goto (%d, %d)", | |
| 579 true_successor()->block_id(), | |
| 580 false_successor()->block_id()); | |
| 581 } | 564 } |
| 582 | 565 |
| 583 | 566 |
| 584 void ParallelMoveInstr::PrintTo(BufferFormatter* f) const { | 567 void ParallelMoveInstr::PrintTo(BufferFormatter* f) const { |
| 585 f->Print(" %s ", DebugName()); | 568 f->Print(" %s ", DebugName()); |
| 586 for (intptr_t i = 0; i < moves_.length(); i++) { | 569 for (intptr_t i = 0; i < moves_.length(); i++) { |
| 587 if (i != 0) f->Print(", "); | 570 if (i != 0) f->Print(", "); |
| 588 moves_[i]->dest().PrintTo(f); | 571 moves_[i]->dest().PrintTo(f); |
| 589 f->Print(" <- "); | 572 f->Print(" <- "); |
| 590 moves_[i]->src().PrintTo(f); | 573 moves_[i]->src().PrintTo(f); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 | 804 |
| 822 | 805 |
| 823 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const { | 806 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 824 f->Print("_ goto B%d", successor()->block_id()); | 807 f->Print("_ goto B%d", successor()->block_id()); |
| 825 } | 808 } |
| 826 | 809 |
| 827 | 810 |
| 828 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { | 811 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 829 f->Print("_ %s ", DebugName()); | 812 f->Print("_ %s ", DebugName()); |
| 830 f->Print("if "); | 813 f->Print("if "); |
| 831 left()->PrintTo(f); | 814 computation()->PrintTo(f); |
| 832 f-> Print(" %s ", Token::Str(kind())); | |
| 833 right()->PrintTo(f); | |
| 834 f->Print(" goto (B%d, B%d)", | |
| 835 true_successor()->block_id(), | |
| 836 false_successor()->block_id()); | |
| 837 } | |
| 838 | |
| 839 | |
| 840 void StrictCompareAndBranchInstr::PrintToVisualizer(BufferFormatter* f) const { | |
| 841 f->Print("_ %s ", DebugName()); | |
| 842 f->Print("if "); | |
| 843 left()->PrintTo(f); | |
| 844 f-> Print(" %s ", Token::Str(kind())); | |
| 845 right()->PrintTo(f); | |
| 846 f->Print(" goto (B%d, B%d)", | 815 f->Print(" goto (B%d, B%d)", |
| 847 true_successor()->block_id(), | 816 true_successor()->block_id(), |
| 848 false_successor()->block_id()); | 817 false_successor()->block_id()); |
| 849 } | 818 } |
| 850 | 819 |
| 851 | 820 |
| 852 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { | 821 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 853 UNIMPLEMENTED(); | 822 UNIMPLEMENTED(); |
| 854 } | 823 } |
| 855 | 824 |
| 856 | 825 |
| 857 void Environment::PrintTo(BufferFormatter* f) const { | 826 void Environment::PrintTo(BufferFormatter* f) const { |
| 858 f->Print(" env={ "); | 827 f->Print(" env={ "); |
| 859 for (intptr_t i = 0; i < values_.length(); ++i) { | 828 for (intptr_t i = 0; i < values_.length(); ++i) { |
| 860 if (i > 0) f->Print(", "); | 829 if (i > 0) f->Print(", "); |
| 861 values_[i]->PrintTo(f); | 830 values_[i]->PrintTo(f); |
| 862 if ((locations_ != NULL) && !locations_[i].IsInvalid()) { | 831 if ((locations_ != NULL) && !locations_[i].IsInvalid()) { |
| 863 f->Print(" ["); | 832 f->Print(" ["); |
| 864 locations_[i].PrintTo(f); | 833 locations_[i].PrintTo(f); |
| 865 f->Print("]"); | 834 f->Print("]"); |
| 866 } | 835 } |
| 867 } | 836 } |
| 868 f->Print(" }"); | 837 f->Print(" }"); |
| 869 } | 838 } |
| 870 | 839 |
| 871 } // namespace dart | 840 } // namespace dart |
| OLD | NEW |