| 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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 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/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); | 604 ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 605 blr(TMP); | 605 blr(TMP); |
| 606 } | 606 } |
| 607 | 607 |
| 608 | 608 |
| 609 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) { | 609 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) { |
| 610 BranchLink(stub_entry, kPatchable); | 610 BranchLink(stub_entry, kPatchable); |
| 611 } | 611 } |
| 612 | 612 |
| 613 | 613 |
| 614 void Assembler::BranchLinkWithEquivalence(const StubEntry& stub_entry, |
| 615 const Object& equivalence) { |
| 616 const Code& target = Code::Handle(stub_entry.code()); |
| 617 const int32_t offset = ObjectPool::element_offset( |
| 618 object_pool_wrapper_.FindObject(target, equivalence)); |
| 619 LoadWordFromPoolOffset(CODE_REG, offset); |
| 620 ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 621 blr(TMP); |
| 622 } |
| 623 |
| 624 |
| 614 void Assembler::AddImmediate(Register dest, Register rn, int64_t imm) { | 625 void Assembler::AddImmediate(Register dest, Register rn, int64_t imm) { |
| 615 Operand op; | 626 Operand op; |
| 616 if (imm == 0) { | 627 if (imm == 0) { |
| 617 if (dest != rn) { | 628 if (dest != rn) { |
| 618 mov(dest, rn); | 629 mov(dest, rn); |
| 619 } | 630 } |
| 620 return; | 631 return; |
| 621 } | 632 } |
| 622 if (Operand::CanHold(imm, kXRegSizeInBits, &op) == Operand::Immediate) { | 633 if (Operand::CanHold(imm, kXRegSizeInBits, &op) == Operand::Immediate) { |
| 623 add(dest, rn, op); | 634 add(dest, rn, op); |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 add(base, array, Operand(index, LSL, shift)); | 1483 add(base, array, Operand(index, LSL, shift)); |
| 1473 } | 1484 } |
| 1474 const OperandSize size = Address::OperandSizeFor(cid); | 1485 const OperandSize size = Address::OperandSizeFor(cid); |
| 1475 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); | 1486 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); |
| 1476 return Address(base, offset, Address::Offset, size); | 1487 return Address(base, offset, Address::Offset, size); |
| 1477 } | 1488 } |
| 1478 | 1489 |
| 1479 } // namespace dart | 1490 } // namespace dart |
| 1480 | 1491 |
| 1481 #endif // defined TARGET_ARCH_ARM64 | 1492 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |