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/globals.h" // Needed here to get TARGET_ARCH_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
7 | 7 |
8 #include "vm/constants_mips.h" | 8 #include "vm/constants_mips.h" |
9 #include "vm/instructions.h" | 9 #include "vm/instructions.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 ASSERT(target_address_pool_index_ >= 0); | 143 ASSERT(target_address_pool_index_ >= 0); |
144 const Object& target_address = | 144 const Object& target_address = |
145 Object::Handle(object_pool_.At(target_address_pool_index_)); | 145 Object::Handle(object_pool_.At(target_address_pool_index_)); |
146 ASSERT(target_address.IsSmi()); | 146 ASSERT(target_address.IsSmi()); |
147 // The address is stored in the object array as a RawSmi. | 147 // The address is stored in the object array as a RawSmi. |
148 return reinterpret_cast<uword>(target_address.raw()); | 148 return reinterpret_cast<uword>(target_address.raw()); |
149 } | 149 } |
150 | 150 |
151 | 151 |
152 void CallPattern::SetTargetAddress(uword target_address) const { | 152 void CallPattern::SetTargetAddress(uword target_address) const { |
153 UNIMPLEMENTED(); | 153 ASSERT(Utils::IsAligned(target_address, 4)); |
| 154 // The address is stored in the object array as a RawSmi. |
| 155 const Smi& smi = Smi::Handle(reinterpret_cast<RawSmi*>(target_address)); |
| 156 object_pool_.SetAt(target_address_pool_index_, smi); |
| 157 // No need to flush the instruction cache, since the code is not modified. |
154 } | 158 } |
155 | 159 |
156 | 160 |
157 JumpPattern::JumpPattern(uword pc) : pc_(pc) { } | 161 JumpPattern::JumpPattern(uword pc) : pc_(pc) { } |
158 | 162 |
159 | 163 |
160 bool JumpPattern::IsValid() const { | 164 bool JumpPattern::IsValid() const { |
161 UNIMPLEMENTED(); | 165 UNIMPLEMENTED(); |
162 return false; | 166 return false; |
163 } | 167 } |
164 | 168 |
165 | 169 |
166 uword JumpPattern::TargetAddress() const { | 170 uword JumpPattern::TargetAddress() const { |
167 UNIMPLEMENTED(); | 171 UNIMPLEMENTED(); |
168 return 0; | 172 return 0; |
169 } | 173 } |
170 | 174 |
171 | 175 |
172 void JumpPattern::SetTargetAddress(uword target_address) const { | 176 void JumpPattern::SetTargetAddress(uword target_address) const { |
173 UNIMPLEMENTED(); | 177 UNIMPLEMENTED(); |
174 } | 178 } |
175 | 179 |
176 } // namespace dart | 180 } // namespace dart |
177 | 181 |
178 #endif // defined TARGET_ARCH_MIPS | 182 #endif // defined TARGET_ARCH_MIPS |
179 | 183 |
OLD | NEW |