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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 if (definition.HasSSATemp()) { | 165 if (definition.HasSSATemp()) { |
166 f->Print("v%"Pd, definition.ssa_temp_index()); | 166 f->Print("v%"Pd, definition.ssa_temp_index()); |
167 } else if (definition.temp_index() != -1) { | 167 } else if (definition.temp_index() != -1) { |
168 f->Print("t%"Pd, definition.temp_index()); | 168 f->Print("t%"Pd, definition.temp_index()); |
169 } | 169 } |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 | 173 |
174 void Instruction::PrintTo(BufferFormatter* f) const { | 174 void Instruction::PrintTo(BufferFormatter* f) const { |
175 f->Print("%s:%"Pd"(", DebugName(), GetDeoptId()); | 175 if (GetDeoptId() != Isolate::kNoDeoptId) { |
| 176 f->Print("%s:%"Pd"(", DebugName(), GetDeoptId()); |
| 177 } else { |
| 178 f->Print("%s(", DebugName()); |
| 179 } |
176 PrintOperandsTo(f); | 180 PrintOperandsTo(f); |
177 f->Print(")"); | 181 f->Print(")"); |
178 } | 182 } |
179 | 183 |
180 | 184 |
181 void Instruction::PrintOperandsTo(BufferFormatter* f) const { | 185 void Instruction::PrintOperandsTo(BufferFormatter* f) const { |
182 for (int i = 0; i < InputCount(); ++i) { | 186 for (int i = 0; i < InputCount(); ++i) { |
183 if (i > 0) f->Print(", "); | 187 if (i > 0) f->Print(", "); |
184 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); | 188 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); |
185 } | 189 } |
186 } | 190 } |
187 | 191 |
188 | 192 |
189 void Definition::PrintTo(BufferFormatter* f) const { | 193 void Definition::PrintTo(BufferFormatter* f) const { |
190 PrintUse(f, *this); | 194 PrintUse(f, *this); |
191 if (is_used()) { | 195 if (is_used()) { |
192 if (HasSSATemp() || (temp_index() != -1)) f->Print(" <- "); | 196 if (HasSSATemp() || (temp_index() != -1)) f->Print(" <- "); |
193 } | 197 } |
194 f->Print("%s:%"Pd"(", DebugName(), GetDeoptId()); | 198 if (GetDeoptId() != Isolate::kNoDeoptId) { |
| 199 f->Print("%s:%"Pd"(", DebugName(), GetDeoptId()); |
| 200 } else { |
| 201 f->Print("%s(", DebugName()); |
| 202 } |
195 PrintOperandsTo(f); | 203 PrintOperandsTo(f); |
196 f->Print(")"); | 204 f->Print(")"); |
197 if (range_ != NULL) { | 205 if (range_ != NULL) { |
198 f->Print(" "); | 206 f->Print(" "); |
199 range_->PrintTo(f); | 207 range_->PrintTo(f); |
200 } | 208 } |
201 | 209 |
202 if (type_ != NULL) { | 210 if (type_ != NULL) { |
203 f->Print(" "); | 211 f->Print(" "); |
204 type_->PrintTo(f); | 212 type_->PrintTo(f); |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 void PushArgumentInstr::PrintOperandsTo(BufferFormatter* f) const { | 677 void PushArgumentInstr::PrintOperandsTo(BufferFormatter* f) const { |
670 value()->PrintTo(f); | 678 value()->PrintTo(f); |
671 } | 679 } |
672 | 680 |
673 | 681 |
674 void GotoInstr::PrintTo(BufferFormatter* f) const { | 682 void GotoInstr::PrintTo(BufferFormatter* f) const { |
675 if (HasParallelMove()) { | 683 if (HasParallelMove()) { |
676 parallel_move()->PrintTo(f); | 684 parallel_move()->PrintTo(f); |
677 f->Print(" "); | 685 f->Print(" "); |
678 } | 686 } |
679 f->Print("goto:%"Pd" %"Pd"", GetDeoptId(), successor()->block_id()); | 687 if (GetDeoptId() != Isolate::kNoDeoptId) { |
| 688 f->Print("goto:%"Pd" %"Pd"", GetDeoptId(), successor()->block_id()); |
| 689 } else { |
| 690 f->Print("goto: %"Pd"", successor()->block_id()); |
| 691 } |
680 } | 692 } |
681 | 693 |
682 | 694 |
683 void BranchInstr::PrintTo(BufferFormatter* f) const { | 695 void BranchInstr::PrintTo(BufferFormatter* f) const { |
684 f->Print("%s ", DebugName()); | 696 f->Print("%s ", DebugName()); |
685 f->Print("if "); | 697 f->Print("if "); |
686 comparison()->PrintTo(f); | 698 comparison()->PrintTo(f); |
687 | 699 |
688 f->Print(" goto (%"Pd", %"Pd")", | 700 f->Print(" goto (%"Pd", %"Pd")", |
689 true_successor()->block_id(), | 701 true_successor()->block_id(), |
(...skipping 26 matching lines...) Expand all Loading... |
716 f->Print(" ["); | 728 f->Print(" ["); |
717 locations_[i].PrintTo(f); | 729 locations_[i].PrintTo(f); |
718 f->Print("]"); | 730 f->Print("]"); |
719 } | 731 } |
720 } | 732 } |
721 f->Print(" }"); | 733 f->Print(" }"); |
722 if (outer_ != NULL) outer_->PrintTo(f); | 734 if (outer_ != NULL) outer_->PrintTo(f); |
723 } | 735 } |
724 | 736 |
725 } // namespace dart | 737 } // namespace dart |
OLD | NEW |