OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/constants_arm64.h" | 9 #include "vm/constants_arm64.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 start -= Instr::kInstrSize; | 202 start -= Instr::kInstrSize; |
203 instr = Instr::At(start); | 203 instr = Instr::At(start); |
204 ASSERT(instr->IsMoveWideOp()); | 204 ASSERT(instr->IsMoveWideOp()); |
205 ASSERT(instr->RdField() == *reg); | 205 ASSERT(instr->RdField() == *reg); |
206 ASSERT(instr->Bits(29, 2) == 2); // movz dst, low_offset, 0 | 206 ASSERT(instr->Bits(29, 2) == 2); // movz dst, low_offset, 0 |
207 ASSERT(instr->HWField() == 0); | 207 ASSERT(instr->HWField() == 0); |
208 offset |= instr->Imm16Field(); | 208 offset |= instr->Imm16Field(); |
209 } | 209 } |
210 } | 210 } |
| 211 // PP is untagged on ARM64. |
211 ASSERT(Utils::IsAligned(offset, 8)); | 212 ASSERT(Utils::IsAligned(offset, 8)); |
212 *index = (offset - Array::data_offset()) / 8; | 213 *index = ObjectPool::IndexFromOffset(offset - kHeapObjectTag); |
213 return start; | 214 return start; |
214 } | 215 } |
215 | 216 |
216 | 217 |
217 // Encodes a load sequence ending at 'end'. Encodes a fixed length two | 218 // Encodes a load sequence ending at 'end'. Encodes a fixed length two |
218 // instruction load from the pool pointer in PP using the destination | 219 // instruction load from the pool pointer in PP using the destination |
219 // register reg as a temporary for the base address. | 220 // register reg as a temporary for the base address. |
220 // Assumes that the location has already been validated for patching. | 221 // Assumes that the location has already been validated for patching. |
221 void InstructionPattern::EncodeLoadWordFromPoolFixed(uword end, | 222 void InstructionPattern::EncodeLoadWordFromPoolFixed(uword end, |
222 int32_t offset) { | 223 int32_t offset) { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 bool ReturnPattern::IsValid() const { | 367 bool ReturnPattern::IsValid() const { |
367 Instr* bx_lr = Instr::At(pc_); | 368 Instr* bx_lr = Instr::At(pc_); |
368 const Register crn = ConcreteRegister(LR); | 369 const Register crn = ConcreteRegister(LR); |
369 const int32_t instruction = RET | (static_cast<int32_t>(crn) << kRnShift); | 370 const int32_t instruction = RET | (static_cast<int32_t>(crn) << kRnShift); |
370 return bx_lr->InstructionBits() == instruction; | 371 return bx_lr->InstructionBits() == instruction; |
371 } | 372 } |
372 | 373 |
373 } // namespace dart | 374 } // namespace dart |
374 | 375 |
375 #endif // defined TARGET_ARCH_ARM64 | 376 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |