| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 int64_t imm = bit_cast<int64_t, double>(immd); | 576 int64_t imm = bit_cast<int64_t, double>(immd); |
| 577 LoadImmediate(TMP, imm); | 577 LoadImmediate(TMP, imm); |
| 578 fmovdr(vd, TMP); | 578 fmovdr(vd, TMP); |
| 579 } | 579 } |
| 580 } | 580 } |
| 581 | 581 |
| 582 | 582 |
| 583 void Assembler::Branch(const StubEntry& stub_entry, | 583 void Assembler::Branch(const StubEntry& stub_entry, |
| 584 Register pp, | 584 Register pp, |
| 585 Patchability patchable) { | 585 Patchability patchable) { |
| 586 const Code& target = Code::Handle(stub_entry.code()); | 586 const Code& target = Code::ZoneHandle(stub_entry.code()); |
| 587 const int32_t offset = ObjectPool::element_offset( | 587 const int32_t offset = ObjectPool::element_offset( |
| 588 object_pool_wrapper_.FindObject(target, patchable)); | 588 object_pool_wrapper_.FindObject(target, patchable)); |
| 589 LoadWordFromPoolOffset(CODE_REG, offset, pp); | 589 LoadWordFromPoolOffset(CODE_REG, offset, pp); |
| 590 ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); | 590 ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 591 br(TMP); | 591 br(TMP); |
| 592 } | 592 } |
| 593 | 593 |
| 594 void Assembler::BranchPatchable(const StubEntry& stub_entry) { | 594 void Assembler::BranchPatchable(const StubEntry& stub_entry) { |
| 595 Branch(stub_entry, PP, kPatchable); | 595 Branch(stub_entry, PP, kPatchable); |
| 596 } | 596 } |
| 597 | 597 |
| 598 | 598 |
| 599 void Assembler::BranchLink(const StubEntry& stub_entry, | 599 void Assembler::BranchLink(const StubEntry& stub_entry, |
| 600 Patchability patchable) { | 600 Patchability patchable) { |
| 601 const Code& target = Code::Handle(stub_entry.code()); | 601 const Code& target = Code::ZoneHandle(stub_entry.code()); |
| 602 const int32_t offset = ObjectPool::element_offset( | 602 const int32_t offset = ObjectPool::element_offset( |
| 603 object_pool_wrapper_.FindObject(target, patchable)); | 603 object_pool_wrapper_.FindObject(target, patchable)); |
| 604 LoadWordFromPoolOffset(CODE_REG, offset); | 604 LoadWordFromPoolOffset(CODE_REG, offset); |
| 605 ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); | 605 ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 606 blr(TMP); | 606 blr(TMP); |
| 607 } | 607 } |
| 608 | 608 |
| 609 | 609 |
| 610 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) { | 610 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) { |
| 611 BranchLink(stub_entry, kPatchable); | 611 BranchLink(stub_entry, kPatchable); |
| 612 } | 612 } |
| 613 | 613 |
| 614 | 614 |
| 615 void Assembler::BranchLinkToRuntime() { | 615 void Assembler::BranchLinkToRuntime() { |
| 616 ldr(LR, Address(THR, Thread::call_to_runtime_entry_point_offset())); | 616 ldr(LR, Address(THR, Thread::call_to_runtime_entry_point_offset())); |
| 617 ldr(CODE_REG, Address(THR, Thread::call_to_runtime_stub_offset())); | 617 ldr(CODE_REG, Address(THR, Thread::call_to_runtime_stub_offset())); |
| 618 blr(LR); | 618 blr(LR); |
| 619 } | 619 } |
| 620 | 620 |
| 621 | 621 |
| 622 void Assembler::BranchLinkWithEquivalence(const StubEntry& stub_entry, | 622 void Assembler::BranchLinkWithEquivalence(const StubEntry& stub_entry, |
| 623 const Object& equivalence) { | 623 const Object& equivalence) { |
| 624 const Code& target = Code::Handle(stub_entry.code()); | 624 const Code& target = Code::ZoneHandle(stub_entry.code()); |
| 625 const int32_t offset = ObjectPool::element_offset( | 625 const int32_t offset = ObjectPool::element_offset( |
| 626 object_pool_wrapper_.FindObject(target, equivalence)); | 626 object_pool_wrapper_.FindObject(target, equivalence)); |
| 627 LoadWordFromPoolOffset(CODE_REG, offset); | 627 LoadWordFromPoolOffset(CODE_REG, offset); |
| 628 ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); | 628 ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 629 blr(TMP); | 629 blr(TMP); |
| 630 } | 630 } |
| 631 | 631 |
| 632 | 632 |
| 633 void Assembler::AddImmediate(Register dest, Register rn, int64_t imm) { | 633 void Assembler::AddImmediate(Register dest, Register rn, int64_t imm) { |
| 634 Operand op; | 634 Operand op; |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 add(base, array, Operand(index, LSL, shift)); | 1492 add(base, array, Operand(index, LSL, shift)); |
| 1493 } | 1493 } |
| 1494 const OperandSize size = Address::OperandSizeFor(cid); | 1494 const OperandSize size = Address::OperandSizeFor(cid); |
| 1495 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); | 1495 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); |
| 1496 return Address(base, offset, Address::Offset, size); | 1496 return Address(base, offset, Address::Offset, size); |
| 1497 } | 1497 } |
| 1498 | 1498 |
| 1499 } // namespace dart | 1499 } // namespace dart |
| 1500 | 1500 |
| 1501 #endif // defined TARGET_ARCH_ARM64 | 1501 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |