| 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 28 matching lines...) Expand all Loading... |
| 39 LocationSummary* summary = new LocationSummary(input_count, 0, contains_call); | 39 LocationSummary* summary = new LocationSummary(input_count, 0, contains_call); |
| 40 for (intptr_t i = 0; i < input_count; i++) { | 40 for (intptr_t i = 0; i < input_count; i++) { |
| 41 summary->set_in(i, Location::RequiresRegister()); | 41 summary->set_in(i, Location::RequiresRegister()); |
| 42 } | 42 } |
| 43 summary->set_out(out); | 43 summary->set_out(out); |
| 44 return summary; | 44 return summary; |
| 45 } | 45 } |
| 46 | 46 |
| 47 | 47 |
| 48 Location Location::RegisterOrConstant(Value* value) { | 48 Location Location::RegisterOrConstant(Value* value) { |
| 49 ConstantComp* constant = value->definition()->AsConstant(); | 49 ConstantInstr* constant = value->definition()->AsConstant(); |
| 50 return (constant != NULL) | 50 return (constant != NULL) |
| 51 ? Location::Constant(constant->value()) | 51 ? Location::Constant(constant->value()) |
| 52 : Location::RequiresRegister(); | 52 : Location::RequiresRegister(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 Location Location::FixedRegisterOrConstant(Value* value, Register reg) { | 56 Location Location::FixedRegisterOrConstant(Value* value, Register reg) { |
| 57 ConstantComp* constant = value->definition()->AsConstant(); | 57 ConstantInstr* constant = value->definition()->AsConstant(); |
| 58 return (constant != NULL) | 58 return (constant != NULL) |
| 59 ? Location::Constant(constant->value()) | 59 ? Location::Constant(constant->value()) |
| 60 : Location::RegisterLocation(reg); | 60 : Location::RegisterLocation(reg); |
| 61 } | 61 } |
| 62 | 62 |
| 63 | 63 |
| 64 const char* Location::Name() const { | 64 const char* Location::Name() const { |
| 65 switch (kind()) { | 65 switch (kind()) { |
| 66 case kInvalid: return "?"; | 66 case kInvalid: return "?"; |
| 67 case kRegister: return Assembler::RegisterName(reg()); | 67 case kRegister: return Assembler::RegisterName(reg()); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 if (!out().IsInvalid()) { | 132 if (!out().IsInvalid()) { |
| 133 f->Print(" => "); | 133 f->Print(" => "); |
| 134 out().PrintTo(f); | 134 out().PrintTo(f); |
| 135 } | 135 } |
| 136 | 136 |
| 137 if (always_calls()) f->Print(" C"); | 137 if (always_calls()) f->Print(" C"); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace dart | 140 } // namespace dart |
| OLD | NEW |