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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 } | 927 } |
928 f->Print("\n}"); | 928 f->Print("\n}"); |
929 } | 929 } |
930 if (HasParallelMove()) { | 930 if (HasParallelMove()) { |
931 f->Print(" "); | 931 f->Print(" "); |
932 parallel_move()->PrintTo(f); | 932 parallel_move()->PrintTo(f); |
933 } | 933 } |
934 } | 934 } |
935 | 935 |
936 | 936 |
| 937 void IndirectEntryInstr::PrintTo(BufferFormatter* f) const { |
| 938 ASSERT(try_index() == CatchClauseNode::kInvalidTryIndex); |
| 939 f->Print("B%" Pd "[join indirect]:%" Pd " pred(", block_id(), GetDeoptId()); |
| 940 for (intptr_t i = 0; i < predecessors_.length(); ++i) { |
| 941 if (i > 0) f->Print(", "); |
| 942 f->Print("B%" Pd, predecessors_[i]->block_id()); |
| 943 } |
| 944 f->Print(")"); |
| 945 if (phis_ != NULL) { |
| 946 f->Print(" {"); |
| 947 for (intptr_t i = 0; i < phis_->length(); ++i) { |
| 948 if ((*phis_)[i] == NULL) continue; |
| 949 f->Print("\n "); |
| 950 (*phis_)[i]->PrintTo(f); |
| 951 } |
| 952 f->Print("\n}"); |
| 953 } |
| 954 if (HasParallelMove()) { |
| 955 f->Print(" "); |
| 956 parallel_move()->PrintTo(f); |
| 957 } |
| 958 } |
| 959 |
| 960 |
937 static const char *RepresentationToCString(Representation rep) { | 961 static const char *RepresentationToCString(Representation rep) { |
938 switch (rep) { | 962 switch (rep) { |
939 case kTagged: | 963 case kTagged: |
940 return "tagged"; | 964 return "tagged"; |
941 case kUntagged: | 965 case kUntagged: |
942 return "untagged"; | 966 return "untagged"; |
943 case kUnboxedDouble: | 967 case kUnboxedDouble: |
944 return "double"; | 968 return "double"; |
945 case kUnboxedInt32: | 969 case kUnboxedInt32: |
946 return "int32"; | 970 return "int32"; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 f->Print(" "); | 1093 f->Print(" "); |
1070 } | 1094 } |
1071 if (GetDeoptId() != Isolate::kNoDeoptId) { | 1095 if (GetDeoptId() != Isolate::kNoDeoptId) { |
1072 f->Print("goto:%" Pd " %" Pd "", GetDeoptId(), successor()->block_id()); | 1096 f->Print("goto:%" Pd " %" Pd "", GetDeoptId(), successor()->block_id()); |
1073 } else { | 1097 } else { |
1074 f->Print("goto: %" Pd "", successor()->block_id()); | 1098 f->Print("goto: %" Pd "", successor()->block_id()); |
1075 } | 1099 } |
1076 } | 1100 } |
1077 | 1101 |
1078 | 1102 |
| 1103 void IndirectGotoInstr::PrintTo(BufferFormatter* f) const { |
| 1104 if (GetDeoptId() != Isolate::kNoDeoptId) { |
| 1105 f->Print("igoto:%" Pd "(", GetDeoptId()); |
| 1106 } else { |
| 1107 f->Print("igoto:("); |
| 1108 } |
| 1109 InputAt(0)->PrintTo(f); |
| 1110 f->Print(")"); |
| 1111 } |
| 1112 |
| 1113 |
1079 void BranchInstr::PrintTo(BufferFormatter* f) const { | 1114 void BranchInstr::PrintTo(BufferFormatter* f) const { |
1080 f->Print("%s ", DebugName()); | 1115 f->Print("%s ", DebugName()); |
1081 f->Print("if "); | 1116 f->Print("if "); |
1082 comparison()->PrintTo(f); | 1117 comparison()->PrintTo(f); |
1083 | 1118 |
1084 f->Print(" goto (%" Pd ", %" Pd ")", | 1119 f->Print(" goto (%" Pd ", %" Pd ")", |
1085 true_successor()->block_id(), | 1120 true_successor()->block_id(), |
1086 false_successor()->block_id()); | 1121 false_successor()->block_id()); |
1087 } | 1122 } |
1088 | 1123 |
(...skipping 30 matching lines...) Expand all Loading... |
1119 } | 1154 } |
1120 | 1155 |
1121 const char* Environment::ToCString() const { | 1156 const char* Environment::ToCString() const { |
1122 char buffer[1024]; | 1157 char buffer[1024]; |
1123 BufferFormatter bf(buffer, 1024); | 1158 BufferFormatter bf(buffer, 1024); |
1124 PrintTo(&bf); | 1159 PrintTo(&bf); |
1125 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 1160 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
1126 } | 1161 } |
1127 | 1162 |
1128 } // namespace dart | 1163 } // namespace dart |
OLD | NEW |