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/log.h" | 9 #include "vm/log.h" |
10 #include "vm/stack_frame.h" | 10 #include "vm/stack_frame.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 | 112 |
113 Location Location::AnyOrConstant(Value* value) { | 113 Location Location::AnyOrConstant(Value* value) { |
114 ConstantInstr* constant = value->definition()->AsConstant(); | 114 ConstantInstr* constant = value->definition()->AsConstant(); |
115 return ((constant != NULL) && Assembler::IsSafe(constant->value())) | 115 return ((constant != NULL) && Assembler::IsSafe(constant->value())) |
116 ? Location::Constant(constant) | 116 ? Location::Constant(constant) |
117 : Location::Any(); | 117 : Location::Any(); |
118 } | 118 } |
119 | 119 |
120 | 120 |
| 121 // DBC does not have an notion of 'address' in its instruction set. |
| 122 #if !defined(TARGET_ARCH_DBC) |
121 Address Location::ToStackSlotAddress() const { | 123 Address Location::ToStackSlotAddress() const { |
122 const intptr_t index = stack_index(); | 124 const intptr_t index = stack_index(); |
123 const Register base = base_reg(); | 125 const Register base = base_reg(); |
124 if (base == FPREG) { | 126 if (base == FPREG) { |
125 if (index < 0) { | 127 if (index < 0) { |
126 const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize; | 128 const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize; |
127 return Address(base, offset); | 129 return Address(base, offset); |
128 } else { | 130 } else { |
129 const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize; | 131 const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize; |
130 return Address(base, offset); | 132 return Address(base, offset); |
131 } | 133 } |
132 } else { | 134 } else { |
133 ASSERT(base == SPREG); | 135 ASSERT(base == SPREG); |
134 return Address(base, index * kWordSize); | 136 return Address(base, index * kWordSize); |
135 } | 137 } |
136 } | 138 } |
137 | 139 #endif |
138 | 140 |
139 intptr_t Location::ToStackSlotOffset() const { | 141 intptr_t Location::ToStackSlotOffset() const { |
140 const intptr_t index = stack_index(); | 142 const intptr_t index = stack_index(); |
141 if (base_reg() == FPREG) { | 143 if (base_reg() == FPREG) { |
142 if (index < 0) { | 144 if (index < 0) { |
143 const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize; | 145 const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize; |
144 return offset; | 146 return offset; |
145 } else { | 147 } else { |
146 const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize; | 148 const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize; |
147 return offset; | 149 return offset; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 // with the right representation because register allocator does not know | 355 // with the right representation because register allocator does not know |
354 // how they are used within the instruction template. | 356 // how they are used within the instruction template. |
355 ASSERT(in(i).IsMachineRegister()); | 357 ASSERT(in(i).IsMachineRegister()); |
356 ASSERT(live_registers()->Contains(in(i))); | 358 ASSERT(live_registers()->Contains(in(i))); |
357 } | 359 } |
358 } | 360 } |
359 } | 361 } |
360 #endif | 362 #endif |
361 | 363 |
362 } // namespace dart | 364 } // namespace dart |
OLD | NEW |