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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/constants_arm.h" | 9 #include "vm/constants_arm.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) | 252 SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code) |
253 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), | 253 : object_pool_(ObjectPool::Handle(code.GetObjectPool())), |
254 data_pool_index_(-1), | 254 data_pool_index_(-1), |
255 target_pool_index_(-1) { | 255 target_pool_index_(-1) { |
256 ASSERT(code.ContainsInstructionAt(pc)); | 256 ASSERT(code.ContainsInstructionAt(pc)); |
257 // Last instruction: blx lr. | 257 // Last instruction: blx lr. |
258 ASSERT(*(reinterpret_cast<uword*>(pc) - 1) == 0xe12fff3e); | 258 ASSERT(*(reinterpret_cast<uword*>(pc) - 1) == 0xe12fff3e); |
259 | 259 |
260 Register reg; | 260 Register reg; |
261 uword stub_load_end = | 261 uword data_load_end = |
262 InstructionPattern::DecodeLoadWordFromPool(pc - 2 * Instr::kInstrSize, | 262 InstructionPattern::DecodeLoadWordFromPool(pc - Instr::kInstrSize, |
263 ®, | 263 ®, |
264 &target_pool_index_); | 264 &data_pool_index_); |
| 265 ASSERT(reg == R9); |
| 266 InstructionPattern::DecodeLoadWordFromPool(data_load_end - Instr::kInstrSize, |
| 267 ®, |
| 268 &target_pool_index_); |
265 ASSERT(reg == CODE_REG); | 269 ASSERT(reg == CODE_REG); |
266 InstructionPattern::DecodeLoadWordFromPool(stub_load_end, | |
267 ®, | |
268 &data_pool_index_); | |
269 ASSERT(reg == R9); | |
270 } | 270 } |
271 | 271 |
272 | 272 |
273 RawObject* SwitchableCallPattern::data() const { | 273 RawObject* SwitchableCallPattern::data() const { |
274 return object_pool_.ObjectAt(data_pool_index_); | 274 return object_pool_.ObjectAt(data_pool_index_); |
275 } | 275 } |
276 | 276 |
277 | 277 |
278 RawCode* SwitchableCallPattern::target() const { | 278 RawCode* SwitchableCallPattern::target() const { |
279 return reinterpret_cast<RawCode*>( | 279 return reinterpret_cast<RawCode*>( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } else { | 312 } else { |
313 ASSERT(version == ARMv7); | 313 ASSERT(version == ARMv7); |
314 return bx_lr->InstructionBits() == instruction; | 314 return bx_lr->InstructionBits() == instruction; |
315 } | 315 } |
316 return false; | 316 return false; |
317 } | 317 } |
318 | 318 |
319 } // namespace dart | 319 } // namespace dart |
320 | 320 |
321 #endif // defined TARGET_ARCH_ARM | 321 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |