| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 | 81 |
| 82 Location Location::AnyOrConstant(Value* value) { | 82 Location Location::AnyOrConstant(Value* value) { |
| 83 ConstantInstr* constant = value->definition()->AsConstant(); | 83 ConstantInstr* constant = value->definition()->AsConstant(); |
| 84 return (constant != NULL) | 84 return (constant != NULL) |
| 85 ? Location::Constant(constant->value()) | 85 ? Location::Constant(constant->value()) |
| 86 : Location::Any(); | 86 : Location::Any(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 | 89 |
| 90 // TODO(regis): Remove all occurences of Address in the architecture independent |
| 91 // portion of the vm. |
| 90 Address Location::ToStackSlotAddress() const { | 92 Address Location::ToStackSlotAddress() const { |
| 91 const intptr_t index = stack_index(); | 93 const intptr_t index = stack_index(); |
| 92 if (index < 0) { | 94 if (index < 0) { |
| 93 const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize; | 95 const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize; |
| 94 return Address(FPREG, offset); | 96 return Address(FPREG, offset); |
| 95 } else { | 97 } else { |
| 96 const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize; | 98 const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize; |
| 97 return Address(FPREG, offset); | 99 return Address(FPREG, offset); |
| 98 } | 100 } |
| 99 } | 101 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 174 |
| 173 if (!out().IsInvalid()) { | 175 if (!out().IsInvalid()) { |
| 174 f->Print(" => "); | 176 f->Print(" => "); |
| 175 out().PrintTo(f); | 177 out().PrintTo(f); |
| 176 } | 178 } |
| 177 | 179 |
| 178 if (always_calls()) f->Print(" C"); | 180 if (always_calls()) f->Print(" C"); |
| 179 } | 181 } |
| 180 | 182 |
| 181 } // namespace dart | 183 } // namespace dart |
| OLD | NEW |