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