| 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/locations.h" | 5 #include "vm/locations.h" |
| 6 | 6 |
| 7 #include "vm/il_printer.h" | 7 #include "vm/il_printer.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/flow_graph_compiler.h" | 9 #include "vm/flow_graph_compiler.h" |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 default: | 59 default: |
| 60 ASSERT(IsConstant()); | 60 ASSERT(IsConstant()); |
| 61 return "C"; | 61 return "C"; |
| 62 } | 62 } |
| 63 return "?"; | 63 return "?"; |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 void Location::PrintTo(BufferFormatter* f) const { | 67 void Location::PrintTo(BufferFormatter* f) const { |
| 68 if (kind() == kStackSlot) { | 68 if (kind() == kStackSlot) { |
| 69 f->Print("[fp%+d]", stack_index()); | 69 f->Print("S%+d", stack_index()); |
| 70 } else { | 70 } else { |
| 71 f->Print("%s", Name()); | 71 f->Print("%s", Name()); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 | 75 |
| 76 void Location::Print() const { |
| 77 if (kind() == kStackSlot) { |
| 78 OS::Print("S%+d", stack_index()); |
| 79 } else { |
| 80 OS::Print("%s", Name()); |
| 81 } |
| 82 } |
| 83 |
| 84 |
| 76 void LocationSummary::PrintTo(BufferFormatter* f) const { | 85 void LocationSummary::PrintTo(BufferFormatter* f) const { |
| 77 if (input_count() > 0) { | 86 if (input_count() > 0) { |
| 78 f->Print(" ("); | 87 f->Print(" ("); |
| 79 for (intptr_t i = 0; i < input_count(); i++) { | 88 for (intptr_t i = 0; i < input_count(); i++) { |
| 80 if (i != 0) f->Print(", "); | 89 if (i != 0) f->Print(", "); |
| 81 in(i).PrintTo(f); | 90 in(i).PrintTo(f); |
| 82 } | 91 } |
| 83 f->Print(")"); | 92 f->Print(")"); |
| 84 } | 93 } |
| 85 | 94 |
| 86 if (temp_count() > 0) { | 95 if (temp_count() > 0) { |
| 87 f->Print(" ["); | 96 f->Print(" ["); |
| 88 for (intptr_t i = 0; i < temp_count(); i++) { | 97 for (intptr_t i = 0; i < temp_count(); i++) { |
| 89 if (i != 0) f->Print(", "); | 98 if (i != 0) f->Print(", "); |
| 90 temp(i).PrintTo(f); | 99 temp(i).PrintTo(f); |
| 91 } | 100 } |
| 92 f->Print("]"); | 101 f->Print("]"); |
| 93 } | 102 } |
| 94 | 103 |
| 95 if (!out().IsInvalid()) { | 104 if (!out().IsInvalid()) { |
| 96 f->Print(" => "); | 105 f->Print(" => "); |
| 97 out().PrintTo(f); | 106 out().PrintTo(f); |
| 98 } | 107 } |
| 99 | 108 |
| 100 if (is_call()) f->Print(" C"); | 109 if (is_call()) f->Print(" C"); |
| 101 } | 110 } |
| 102 | 111 |
| 103 } // namespace dart | 112 } // namespace dart |
| OLD | NEW |