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/flow_graph_range_analysis.h" | 7 #include "vm/flow_graph_range_analysis.h" |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 #include "vm/os.h" | 9 #include "vm/os.h" |
10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 f->Print("%" Pd "", num_context_variables()); | 573 f->Print("%" Pd "", num_context_variables()); |
574 } | 574 } |
575 | 575 |
576 | 576 |
577 void MathUnaryInstr::PrintOperandsTo(BufferFormatter* f) const { | 577 void MathUnaryInstr::PrintOperandsTo(BufferFormatter* f) const { |
578 f->Print("'%s', ", MathUnaryInstr::KindToCString(kind())); | 578 f->Print("'%s', ", MathUnaryInstr::KindToCString(kind())); |
579 value()->PrintTo(f); | 579 value()->PrintTo(f); |
580 } | 580 } |
581 | 581 |
582 | 582 |
| 583 void CaseInsensitiveCompareUC16Instr::PrintOperandsTo( |
| 584 BufferFormatter* f) const { |
| 585 str()->PrintTo(f); |
| 586 f->Print(", "); |
| 587 lhs_index()->PrintTo(f); |
| 588 f->Print(", "); |
| 589 rhs_index()->PrintTo(f); |
| 590 f->Print(", "); |
| 591 length()->PrintTo(f); |
| 592 } |
| 593 |
| 594 |
583 void MergedMathInstr::PrintOperandsTo(BufferFormatter* f) const { | 595 void MergedMathInstr::PrintOperandsTo(BufferFormatter* f) const { |
584 f->Print("'%s', ", MergedMathInstr::KindToCString(kind())); | 596 f->Print("'%s', ", MergedMathInstr::KindToCString(kind())); |
585 Definition::PrintOperandsTo(f); | 597 Definition::PrintOperandsTo(f); |
586 } | 598 } |
587 | 599 |
588 | 600 |
589 void ExtractNthOutputInstr::PrintOperandsTo(BufferFormatter* f) const { | 601 void ExtractNthOutputInstr::PrintOperandsTo(BufferFormatter* f) const { |
590 f->Print("Extract %" Pd " from ", index()); | 602 f->Print("Extract %" Pd " from ", index()); |
591 Definition::PrintOperandsTo(f); | 603 Definition::PrintOperandsTo(f); |
592 } | 604 } |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 } | 939 } |
928 f->Print("\n}"); | 940 f->Print("\n}"); |
929 } | 941 } |
930 if (HasParallelMove()) { | 942 if (HasParallelMove()) { |
931 f->Print(" "); | 943 f->Print(" "); |
932 parallel_move()->PrintTo(f); | 944 parallel_move()->PrintTo(f); |
933 } | 945 } |
934 } | 946 } |
935 | 947 |
936 | 948 |
| 949 void IndirectEntryInstr::PrintTo(BufferFormatter* f) const { |
| 950 if (try_index() != CatchClauseNode::kInvalidTryIndex) { |
| 951 f->Print("B%" Pd "[join indirect try_idx %" Pd "]:%" Pd " pred(", |
| 952 block_id(), try_index(), GetDeoptId()); |
| 953 } else { |
| 954 f->Print("B%" Pd "[join indirect]:%" Pd " pred(", block_id(), GetDeoptId()); |
| 955 } |
| 956 for (intptr_t i = 0; i < predecessors_.length(); ++i) { |
| 957 if (i > 0) f->Print(", "); |
| 958 f->Print("B%" Pd, predecessors_[i]->block_id()); |
| 959 } |
| 960 f->Print(")"); |
| 961 if (phis_ != NULL) { |
| 962 f->Print(" {"); |
| 963 for (intptr_t i = 0; i < phis_->length(); ++i) { |
| 964 if ((*phis_)[i] == NULL) continue; |
| 965 f->Print("\n "); |
| 966 (*phis_)[i]->PrintTo(f); |
| 967 } |
| 968 f->Print("\n}"); |
| 969 } |
| 970 if (HasParallelMove()) { |
| 971 f->Print(" "); |
| 972 parallel_move()->PrintTo(f); |
| 973 } |
| 974 } |
| 975 |
| 976 |
937 static const char *RepresentationToCString(Representation rep) { | 977 static const char *RepresentationToCString(Representation rep) { |
938 switch (rep) { | 978 switch (rep) { |
939 case kTagged: | 979 case kTagged: |
940 return "tagged"; | 980 return "tagged"; |
941 case kUntagged: | 981 case kUntagged: |
942 return "untagged"; | 982 return "untagged"; |
943 case kUnboxedDouble: | 983 case kUnboxedDouble: |
944 return "double"; | 984 return "double"; |
945 case kUnboxedInt32: | 985 case kUnboxedInt32: |
946 return "int32"; | 986 return "int32"; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 f->Print(" "); | 1109 f->Print(" "); |
1070 } | 1110 } |
1071 if (GetDeoptId() != Isolate::kNoDeoptId) { | 1111 if (GetDeoptId() != Isolate::kNoDeoptId) { |
1072 f->Print("goto:%" Pd " %" Pd "", GetDeoptId(), successor()->block_id()); | 1112 f->Print("goto:%" Pd " %" Pd "", GetDeoptId(), successor()->block_id()); |
1073 } else { | 1113 } else { |
1074 f->Print("goto: %" Pd "", successor()->block_id()); | 1114 f->Print("goto: %" Pd "", successor()->block_id()); |
1075 } | 1115 } |
1076 } | 1116 } |
1077 | 1117 |
1078 | 1118 |
| 1119 void IndirectGotoInstr::PrintTo(BufferFormatter* f) const { |
| 1120 if (GetDeoptId() != Isolate::kNoDeoptId) { |
| 1121 f->Print("igoto:%" Pd "(", GetDeoptId()); |
| 1122 } else { |
| 1123 f->Print("igoto:("); |
| 1124 } |
| 1125 offset_from_start_->PrintTo(f); |
| 1126 f->Print(")"); |
| 1127 } |
| 1128 |
| 1129 |
1079 void BranchInstr::PrintTo(BufferFormatter* f) const { | 1130 void BranchInstr::PrintTo(BufferFormatter* f) const { |
1080 f->Print("%s ", DebugName()); | 1131 f->Print("%s ", DebugName()); |
1081 f->Print("if "); | 1132 f->Print("if "); |
1082 comparison()->PrintTo(f); | 1133 comparison()->PrintTo(f); |
1083 | 1134 |
1084 f->Print(" goto (%" Pd ", %" Pd ")", | 1135 f->Print(" goto (%" Pd ", %" Pd ")", |
1085 true_successor()->block_id(), | 1136 true_successor()->block_id(), |
1086 false_successor()->block_id()); | 1137 false_successor()->block_id()); |
1087 } | 1138 } |
1088 | 1139 |
(...skipping 30 matching lines...) Expand all Loading... |
1119 } | 1170 } |
1120 | 1171 |
1121 const char* Environment::ToCString() const { | 1172 const char* Environment::ToCString() const { |
1122 char buffer[1024]; | 1173 char buffer[1024]; |
1123 BufferFormatter bf(buffer, 1024); | 1174 BufferFormatter bf(buffer, 1024); |
1124 PrintTo(&bf); | 1175 PrintTo(&bf); |
1125 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 1176 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
1126 } | 1177 } |
1127 | 1178 |
1128 } // namespace dart | 1179 } // namespace dart |
OLD | NEW |