| 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 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 (current == NULL) ? NULL : current->AsBlockEntry(); | 43 (current == NULL) ? NULL : current->AsBlockEntry(); |
| 44 if (successor != NULL) { | 44 if (successor != NULL) { |
| 45 OS::Print(" goto %d", successor->block_id()); | 45 OS::Print(" goto %d", successor->block_id()); |
| 46 } | 46 } |
| 47 OS::Print("\n"); | 47 OS::Print("\n"); |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 | 51 |
| 52 void FlowGraphPrinter::PrintInstruction(Instruction* instr) { | 52 void FlowGraphPrinter::PrintInstruction(Instruction* instr) { |
| 53 char str[80]; | 53 char str[120]; |
| 54 BufferFormatter f(str, sizeof(str)); | 54 BufferFormatter f(str, sizeof(str)); |
| 55 instr->PrintTo(&f); | 55 instr->PrintTo(&f); |
| 56 OS::Print("%s", str); | 56 OS::Print("%s", str); |
| 57 } | 57 } |
| 58 | 58 |
| 59 | 59 |
| 60 void FlowGraphPrinter::PrintComputation(Computation* comp) { | 60 void FlowGraphPrinter::PrintComputation(Computation* comp) { |
| 61 char str[80]; | 61 char str[120]; |
| 62 BufferFormatter f(str, sizeof(str)); | 62 BufferFormatter f(str, sizeof(str)); |
| 63 comp->PrintTo(&f); | 63 comp->PrintTo(&f); |
| 64 OS::Print("%s", str); | 64 OS::Print("%s", str); |
| 65 } | 65 } |
| 66 | 66 |
| 67 | 67 |
| 68 | 68 |
| 69 void Computation::PrintTo(BufferFormatter* f) const { | 69 void Computation::PrintTo(BufferFormatter* f) const { |
| 70 f->Print("%s(", DebugName()); | 70 f->Print("%s(", DebugName()); |
| 71 PrintOperandsTo(f); | 71 PrintOperandsTo(f); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 90 void ConstantVal::PrintTo(BufferFormatter* f) const { | 90 void ConstantVal::PrintTo(BufferFormatter* f) const { |
| 91 f->Print("#%s", value().ToCString()); | 91 f->Print("#%s", value().ToCString()); |
| 92 } | 92 } |
| 93 | 93 |
| 94 | 94 |
| 95 void AssertAssignableComp::PrintOperandsTo(BufferFormatter* f) const { | 95 void AssertAssignableComp::PrintOperandsTo(BufferFormatter* f) const { |
| 96 value()->PrintTo(f); | 96 value()->PrintTo(f); |
| 97 f->Print(", %s, '%s'", | 97 f->Print(", %s, '%s'", |
| 98 String::Handle(dst_type().Name()).ToCString(), | 98 String::Handle(dst_type().Name()).ToCString(), |
| 99 dst_name().ToCString()); | 99 dst_name().ToCString()); |
| 100 if (instantiator() != NULL) { | 100 f->Print(" (instantiator:"); |
| 101 f->Print(" (instantiator:"); | 101 instantiator()->PrintTo(f); |
| 102 instantiator()->PrintTo(f); | 102 f->Print(")"); |
| 103 f->Print(")"); | 103 f->Print(" (instantiator_type_arguments:"); |
| 104 } | 104 instantiator_type_arguments()->PrintTo(f); |
| 105 if (instantiator_type_arguments() != NULL) { | 105 f->Print(")"); |
| 106 f->Print(" (instantiator:"); | |
| 107 instantiator_type_arguments()->PrintTo(f); | |
| 108 f->Print(")"); | |
| 109 } | |
| 110 } | 106 } |
| 111 | 107 |
| 112 | 108 |
| 113 void ClosureCallComp::PrintOperandsTo(BufferFormatter* f) const { | 109 void ClosureCallComp::PrintOperandsTo(BufferFormatter* f) const { |
| 114 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 110 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
| 115 if (i == 0) f->Print(", "); | 111 if (i == 0) f->Print(", "); |
| 116 ArgumentAt(i)->PrintTo(f); | 112 ArgumentAt(i)->PrintTo(f); |
| 117 } | 113 } |
| 118 } | 114 } |
| 119 | 115 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 f->Print(" %s ", DebugName()); | 348 f->Print(" %s ", DebugName()); |
| 353 f->Print("if "); | 349 f->Print("if "); |
| 354 value()->PrintTo(f); | 350 value()->PrintTo(f); |
| 355 f->Print(" goto (%d, %d)", | 351 f->Print(" goto (%d, %d)", |
| 356 true_successor()->block_id(), | 352 true_successor()->block_id(), |
| 357 false_successor()->block_id()); | 353 false_successor()->block_id()); |
| 358 } | 354 } |
| 359 | 355 |
| 360 | 356 |
| 361 } // namespace dart | 357 } // namespace dart |
| OLD | NEW |