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 25 matching lines...) Expand all Loading... |
36 summary->set_in(i, Location::RequiresRegister()); | 36 summary->set_in(i, Location::RequiresRegister()); |
37 } | 37 } |
38 summary->set_out(out); | 38 summary->set_out(out); |
39 return summary; | 39 return summary; |
40 } | 40 } |
41 | 41 |
42 | 42 |
43 const char* Location::Name() const { | 43 const char* Location::Name() const { |
44 switch (kind()) { | 44 switch (kind()) { |
45 case kInvalid: return "?"; | 45 case kInvalid: return "?"; |
| 46 case kRegister: return Assembler::RegisterName(reg()); |
46 case kSpillSlot: return "S"; | 47 case kSpillSlot: return "S"; |
47 case kRegister: return Assembler::RegisterName(reg()); | |
48 case kUnallocated: | 48 case kUnallocated: |
49 switch (policy()) { | 49 switch (policy()) { |
| 50 case kAny: |
| 51 return "A"; |
| 52 case kPrefersRegister: |
| 53 return "P"; |
50 case kRequiresRegister: | 54 case kRequiresRegister: |
51 return "R"; | 55 return "R"; |
52 case kSameAsFirstInput: | 56 case kSameAsFirstInput: |
53 return "0"; | 57 return "0"; |
54 } | 58 } |
| 59 UNREACHABLE(); |
55 default: | 60 default: |
56 ASSERT(IsConstant()); | 61 ASSERT(IsConstant()); |
57 return "C"; | 62 return "C"; |
58 } | 63 } |
59 return "?"; | 64 return "?"; |
60 } | 65 } |
61 | 66 |
62 | 67 |
63 void Location::PrintTo(BufferFormatter* f) const { | 68 void Location::PrintTo(BufferFormatter* f) const { |
64 if (kind() == kSpillSlot) { | 69 if (kind() == kSpillSlot) { |
(...skipping 26 matching lines...) Expand all Loading... |
91 if (!out().IsInvalid()) { | 96 if (!out().IsInvalid()) { |
92 f->Print(" => "); | 97 f->Print(" => "); |
93 out().PrintTo(f); | 98 out().PrintTo(f); |
94 } | 99 } |
95 | 100 |
96 if (is_call()) f->Print(" C"); | 101 if (is_call()) f->Print(" C"); |
97 } | 102 } |
98 | 103 |
99 } // namespace dart | 104 } // namespace dart |
100 | 105 |
OLD | NEW |