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