| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/il_printer.h" | 8 #include "vm/il_printer.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 | 72 |
| 73 Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) { | 73 Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) { |
| 74 ConstantInstr* constant = value->definition()->AsConstant(); | 74 ConstantInstr* constant = value->definition()->AsConstant(); |
| 75 return ((constant != NULL) && constant->value().IsSmi()) | 75 return ((constant != NULL) && constant->value().IsSmi()) |
| 76 ? Location::Constant(constant->value()) | 76 ? Location::Constant(constant->value()) |
| 77 : Location::RegisterLocation(reg); | 77 : Location::RegisterLocation(reg); |
| 78 } | 78 } |
| 79 | 79 |
| 80 | 80 |
| 81 Location Location::WritableRegisterOrSmiConstant(Value* value) { |
| 82 ConstantInstr* constant = value->definition()->AsConstant(); |
| 83 return ((constant != NULL) && constant->value().IsSmi()) |
| 84 ? Location::Constant(constant->value()) |
| 85 : Location::WritableRegister(); |
| 86 } |
| 87 |
| 88 |
| 81 Location Location::AnyOrConstant(Value* value) { | 89 Location Location::AnyOrConstant(Value* value) { |
| 82 ConstantInstr* constant = value->definition()->AsConstant(); | 90 ConstantInstr* constant = value->definition()->AsConstant(); |
| 83 return (constant != NULL) | 91 return (constant != NULL) |
| 84 ? Location::Constant(constant->value()) | 92 ? Location::Constant(constant->value()) |
| 85 : Location::Any(); | 93 : Location::Any(); |
| 86 } | 94 } |
| 87 | 95 |
| 88 | 96 |
| 89 Address Location::ToStackSlotAddress() const { | 97 Address Location::ToStackSlotAddress() const { |
| 90 const intptr_t index = stack_index(); | 98 const intptr_t index = stack_index(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 179 |
| 172 if (!out().IsInvalid()) { | 180 if (!out().IsInvalid()) { |
| 173 f->Print(" => "); | 181 f->Print(" => "); |
| 174 out().PrintTo(f); | 182 out().PrintTo(f); |
| 175 } | 183 } |
| 176 | 184 |
| 177 if (always_calls()) f->Print(" C"); | 185 if (always_calls()) f->Print(" C"); |
| 178 } | 186 } |
| 179 | 187 |
| 180 } // namespace dart | 188 } // namespace dart |
| OLD | NEW |