| 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 26 matching lines...) Expand all Loading... |
| 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 kRegister: return Assembler::RegisterName(reg()); |
| 47 case kSpillSlot: return "S"; | 47 case kStackSlot: return "S"; |
| 48 case kUnallocated: | 48 case kUnallocated: |
| 49 switch (policy()) { | 49 switch (policy()) { |
| 50 case kAny: | 50 case kAny: |
| 51 return "A"; | 51 return "A"; |
| 52 case kPrefersRegister: | 52 case kPrefersRegister: |
| 53 return "P"; | 53 return "P"; |
| 54 case kRequiresRegister: | 54 case kRequiresRegister: |
| 55 return "R"; | 55 return "R"; |
| 56 case kSameAsFirstInput: | 56 case kSameAsFirstInput: |
| 57 return "0"; | 57 return "0"; |
| 58 } | 58 } |
| 59 UNREACHABLE(); | 59 UNREACHABLE(); |
| 60 default: | 60 default: |
| 61 ASSERT(IsConstant()); | 61 ASSERT(IsConstant()); |
| 62 return "C"; | 62 return "C"; |
| 63 } | 63 } |
| 64 return "?"; | 64 return "?"; |
| 65 } | 65 } |
| 66 | 66 |
| 67 | 67 |
| 68 void Location::PrintTo(BufferFormatter* f) const { | 68 void Location::PrintTo(BufferFormatter* f) const { |
| 69 if (kind() == kSpillSlot) { | 69 if (kind() == kStackSlot) { |
| 70 f->Print("S%d", spill_index()); | 70 f->Print("[fp%+d]", stack_index()); |
| 71 } else { | 71 } else { |
| 72 f->Print("%s", Name()); | 72 f->Print("%s", Name()); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 | 76 |
| 77 void LocationSummary::PrintTo(BufferFormatter* f) const { | 77 void LocationSummary::PrintTo(BufferFormatter* f) const { |
| 78 if (input_count() > 0) { | 78 if (input_count() > 0) { |
| 79 f->Print(" ("); | 79 f->Print(" ("); |
| 80 for (intptr_t i = 0; i < input_count(); i++) { | 80 for (intptr_t i = 0; i < input_count(); i++) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 96 if (!out().IsInvalid()) { | 96 if (!out().IsInvalid()) { |
| 97 f->Print(" => "); | 97 f->Print(" => "); |
| 98 out().PrintTo(f); | 98 out().PrintTo(f); |
| 99 } | 99 } |
| 100 | 100 |
| 101 if (is_call()) f->Print(" C"); | 101 if (is_call()) f->Print(" C"); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace dart | 104 } // namespace dart |
| 105 | 105 |
| OLD | NEW |