| 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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 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/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 2733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2744 const Code& code = Code::Handle(stub_entry.code()); | 2744 const Code& code = Code::Handle(stub_entry.code()); |
| 2745 BranchLink(code, patchable); | 2745 BranchLink(code, patchable); |
| 2746 } | 2746 } |
| 2747 | 2747 |
| 2748 | 2748 |
| 2749 void Assembler::BranchLinkPatchable(const Code& target) { | 2749 void Assembler::BranchLinkPatchable(const Code& target) { |
| 2750 BranchLink(target, kPatchable); | 2750 BranchLink(target, kPatchable); |
| 2751 } | 2751 } |
| 2752 | 2752 |
| 2753 | 2753 |
| 2754 void Assembler::BranchLinkWithEquivalence(const StubEntry& stub_entry, |
| 2755 const Object& equivalence) { |
| 2756 const Code& target = Code::Handle(stub_entry.code()); |
| 2757 // Make sure that class CallPattern is able to patch the label referred |
| 2758 // to by this code sequence. |
| 2759 // For added code robustness, use 'blx lr' in a patchable sequence and |
| 2760 // use 'blx ip' in a non-patchable sequence (see other BranchLink flavors). |
| 2761 const int32_t offset = ObjectPool::element_offset( |
| 2762 object_pool_wrapper_.FindObject(target, equivalence)); |
| 2763 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag, PP, AL); |
| 2764 ldr(LR, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 2765 blx(LR); // Use blx instruction so that the return branch prediction works. |
| 2766 } |
| 2767 |
| 2768 |
| 2754 void Assembler::BranchLink(const ExternalLabel* label) { | 2769 void Assembler::BranchLink(const ExternalLabel* label) { |
| 2755 LoadImmediate(LR, label->address()); // Target address is never patched. | 2770 LoadImmediate(LR, label->address()); // Target address is never patched. |
| 2756 blx(LR); // Use blx instruction so that the return branch prediction works. | 2771 blx(LR); // Use blx instruction so that the return branch prediction works. |
| 2757 } | 2772 } |
| 2758 | 2773 |
| 2759 | 2774 |
| 2760 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) { | 2775 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) { |
| 2761 BranchLinkPatchable(Code::Handle(stub_entry.code())); | 2776 BranchLinkPatchable(Code::Handle(stub_entry.code())); |
| 2762 } | 2777 } |
| 2763 | 2778 |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3667 | 3682 |
| 3668 | 3683 |
| 3669 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3684 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 3670 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); | 3685 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); |
| 3671 return fpu_reg_names[reg]; | 3686 return fpu_reg_names[reg]; |
| 3672 } | 3687 } |
| 3673 | 3688 |
| 3674 } // namespace dart | 3689 } // namespace dart |
| 3675 | 3690 |
| 3676 #endif // defined TARGET_ARCH_ARM | 3691 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |