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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 const Class& cls = | 123 const Class& cls = |
124 Class::Handle(Isolate::Current()->class_table()->At(class_ids[k])); | 124 Class::Handle(Isolate::Current()->class_table()->At(class_ids[k])); |
125 f->Print("%s", String::Handle(cls.Name()).ToCString()); | 125 f->Print("%s", String::Handle(cls.Name()).ToCString()); |
126 } | 126 } |
127 } | 127 } |
128 f->Print("]"); | 128 f->Print("]"); |
129 } | 129 } |
130 | 130 |
131 | 131 |
132 void Computation::PrintTo(BufferFormatter* f) const { | 132 void Computation::PrintTo(BufferFormatter* f) const { |
133 f->Print("%s:%d(", DebugName(), cid()); | 133 f->Print("%s:%d(", DebugName(), deopt_id()); |
134 PrintOperandsTo(f); | 134 PrintOperandsTo(f); |
135 f->Print(")"); | 135 f->Print(")"); |
136 if (HasICData()) { | 136 if (HasICData()) { |
137 PrintICData(f, *ic_data()); | 137 PrintICData(f, *ic_data()); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 | 141 |
142 void Computation::PrintOperandsTo(BufferFormatter* f) const { | 142 void Computation::PrintOperandsTo(BufferFormatter* f) const { |
143 for (int i = 0; i < InputCount(); ++i) { | 143 for (int i = 0; i < InputCount(); ++i) { |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 461 } |
462 | 462 |
463 | 463 |
464 void PushArgumentInstr::PrintTo(BufferFormatter* f) const { | 464 void PushArgumentInstr::PrintTo(BufferFormatter* f) const { |
465 f->Print(" %s ", DebugName()); | 465 f->Print(" %s ", DebugName()); |
466 value()->PrintTo(f); | 466 value()->PrintTo(f); |
467 } | 467 } |
468 | 468 |
469 | 469 |
470 void ReturnInstr::PrintTo(BufferFormatter* f) const { | 470 void ReturnInstr::PrintTo(BufferFormatter* f) const { |
471 f->Print(" %s:%d ", DebugName(), cid()); | 471 f->Print(" %s:%d ", DebugName(), deopt_id()); |
472 value()->PrintTo(f); | 472 value()->PrintTo(f); |
473 } | 473 } |
474 | 474 |
475 | 475 |
476 void ThrowInstr::PrintTo(BufferFormatter* f) const { | 476 void ThrowInstr::PrintTo(BufferFormatter* f) const { |
477 f->Print(" %s:%d ", DebugName(), cid()); | 477 f->Print(" %s:%d ", DebugName(), deopt_id()); |
478 } | 478 } |
479 | 479 |
480 | 480 |
481 void ReThrowInstr::PrintTo(BufferFormatter* f) const { | 481 void ReThrowInstr::PrintTo(BufferFormatter* f) const { |
482 f->Print(" %s:%d ", DebugName(), cid()); | 482 f->Print(" %s:%d ", DebugName(), deopt_id()); |
483 } | 483 } |
484 | 484 |
485 | 485 |
486 void GotoInstr::PrintTo(BufferFormatter* f) const { | 486 void GotoInstr::PrintTo(BufferFormatter* f) const { |
487 if (HasParallelMove()) { | 487 if (HasParallelMove()) { |
488 parallel_move()->PrintTo(f); | 488 parallel_move()->PrintTo(f); |
489 } else { | 489 } else { |
490 f->Print(" "); | 490 f->Print(" "); |
491 } | 491 } |
492 f->Print(" goto %d", successor()->block_id()); | 492 f->Print(" goto %d", successor()->block_id()); |
493 } | 493 } |
494 | 494 |
495 | 495 |
496 void BranchInstr::PrintTo(BufferFormatter* f) const { | 496 void BranchInstr::PrintTo(BufferFormatter* f) const { |
497 f->Print(" %s:%d ", DebugName(), cid()); | 497 f->Print(" %s:%d ", DebugName(), deopt_id()); |
498 f->Print("if "); | 498 f->Print("if "); |
499 left()->PrintTo(f); | 499 left()->PrintTo(f); |
500 f-> Print(" %s ", Token::Str(kind())); | 500 f-> Print(" %s ", Token::Str(kind())); |
501 right()->PrintTo(f); | 501 right()->PrintTo(f); |
502 | 502 |
503 f->Print(" goto (%d, %d)", | 503 f->Print(" goto (%d, %d)", |
504 true_successor()->block_id(), | 504 true_successor()->block_id(), |
505 false_successor()->block_id()); | 505 false_successor()->block_id()); |
506 if (HasICData()) { | 506 if (HasICData()) { |
507 PrintICData(f, *ic_data()); | 507 PrintICData(f, *ic_data()); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 } | 726 } |
727 | 727 |
728 | 728 |
729 void PushArgumentInstr::PrintToVisualizer(BufferFormatter* f) const { | 729 void PushArgumentInstr::PrintToVisualizer(BufferFormatter* f) const { |
730 f->Print("_ %s ", DebugName()); | 730 f->Print("_ %s ", DebugName()); |
731 value()->PrintTo(f); | 731 value()->PrintTo(f); |
732 } | 732 } |
733 | 733 |
734 | 734 |
735 void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const { | 735 void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const { |
736 f->Print("_ %s:%d ", DebugName(), cid()); | 736 f->Print("_ %s:%d ", DebugName(), deopt_id()); |
737 value()->PrintTo(f); | 737 value()->PrintTo(f); |
738 } | 738 } |
739 | 739 |
740 | 740 |
741 void ThrowInstr::PrintToVisualizer(BufferFormatter* f) const { | 741 void ThrowInstr::PrintToVisualizer(BufferFormatter* f) const { |
742 f->Print("_ %s:%d ", DebugName(), cid()); | 742 f->Print("_ %s:%d ", DebugName(), deopt_id()); |
743 } | 743 } |
744 | 744 |
745 | 745 |
746 void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const { | 746 void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const { |
747 f->Print("_ %s:%d ", DebugName(), cid()); | 747 f->Print("_ %s:%d ", DebugName(), deopt_id()); |
748 } | 748 } |
749 | 749 |
750 | 750 |
751 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const { | 751 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const { |
752 f->Print("_ goto B%d", successor()->block_id()); | 752 f->Print("_ goto B%d", successor()->block_id()); |
753 } | 753 } |
754 | 754 |
755 | 755 |
756 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { | 756 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { |
757 f->Print("_ %s ", DebugName()); | 757 f->Print("_ %s ", DebugName()); |
(...skipping 22 matching lines...) Expand all Loading... |
780 !locations_[i].IsInvalid()) { | 780 !locations_[i].IsInvalid()) { |
781 f->Print(" ["); | 781 f->Print(" ["); |
782 locations_[i].PrintTo(f); | 782 locations_[i].PrintTo(f); |
783 f->Print("]"); | 783 f->Print("]"); |
784 } | 784 } |
785 } | 785 } |
786 f->Print(" }"); | 786 f->Print(" }"); |
787 } | 787 } |
788 | 788 |
789 } // namespace dart | 789 } // namespace dart |
OLD | NEW |