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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 const uint16_t h2 = Utils::Low16Bits(w1); | 358 const uint16_t h2 = Utils::Low16Bits(w1); |
359 const uint16_t h3 = Utils::High16Bits(w1); | 359 const uint16_t h3 = Utils::High16Bits(w1); |
360 | 360 |
361 movz0->SetInstructionBits((movz0_bits & ~kImm16Mask) | (h0 << kImm16Shift)); | 361 movz0->SetInstructionBits((movz0_bits & ~kImm16Mask) | (h0 << kImm16Shift)); |
362 movk1->SetInstructionBits((movk1_bits & ~kImm16Mask) | (h1 << kImm16Shift)); | 362 movk1->SetInstructionBits((movk1_bits & ~kImm16Mask) | (h1 << kImm16Shift)); |
363 movk2->SetInstructionBits((movk2_bits & ~kImm16Mask) | (h2 << kImm16Shift)); | 363 movk2->SetInstructionBits((movk2_bits & ~kImm16Mask) | (h2 << kImm16Shift)); |
364 movk3->SetInstructionBits((movk3_bits & ~kImm16Mask) | (h3 << kImm16Shift)); | 364 movk3->SetInstructionBits((movk3_bits & ~kImm16Mask) | (h3 << kImm16Shift)); |
365 CPU::FlushICache(pc_, 4 * Instr::kInstrSize); | 365 CPU::FlushICache(pc_, 4 * Instr::kInstrSize); |
366 } | 366 } |
367 | 367 |
| 368 |
| 369 ReturnPattern::ReturnPattern(uword pc) |
| 370 : pc_(pc) { |
| 371 } |
| 372 |
| 373 |
| 374 bool ReturnPattern::IsValid() const { |
| 375 Instr* bx_lr = Instr::At(pc_); |
| 376 const Register crn = ConcreteRegister(LR); |
| 377 const int32_t instruction = RET | (static_cast<int32_t>(crn) << kRnShift); |
| 378 return bx_lr->InstructionBits() == instruction; |
| 379 } |
| 380 |
368 } // namespace dart | 381 } // namespace dart |
369 | 382 |
370 #endif // defined TARGET_ARCH_ARM64 | 383 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |