Changeset 72663 in webkit for trunk/JavaScriptCore/assembler/ARMAssembler.h
- Timestamp:
- Nov 24, 2010, 5:04:35 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/assembler/ARMAssembler.h
r70752 r72663 625 625 { 626 626 #if WTF_ARM_ARCH_AT_LEAST(5) 627 int s = m_buffer.uncheckedSize();628 627 emitInst(static_cast<ARMWord>(cc) | BLX, 0, 0, RM(rm)); 629 628 #else … … 631 630 ensureSpace(2 * sizeof(ARMWord), 0); 632 631 mov_r(ARMRegisters::lr, ARMRegisters::pc, cc); 633 int s = m_buffer.uncheckedSize();634 632 bx(rm, cc); 635 633 #endif 636 return JmpSrc( s);634 return JmpSrc(m_buffer.uncheckedSize()); 637 635 } 638 636 … … 712 710 { 713 711 ensureSpace(sizeof(ARMWord), sizeof(ARMWord)); 714 int s = m_buffer.uncheckedSize();712 m_jumps.append(m_buffer.uncheckedSize() | (useConstantPool & 0x1)); 715 713 ldr_un_imm(rd, InvalidBranchTarget, cc); 716 m_jumps.append(s | (useConstantPool & 0x1)); 717 return JmpSrc(s); 714 return JmpSrc(m_buffer.uncheckedSize()); 718 715 } 719 716 … … 801 798 802 799 // Linkers 800 static intptr_t getAbsoluteJumpAddress(void* base, int offset = 0) 801 { 802 return reinterpret_cast<intptr_t>(base) + offset - sizeof(ARMWord); 803 } 803 804 804 805 void linkJump(JmpSrc from, JmpDst to) 805 806 { 806 ARMWord* insn = reinterpret_cast<ARMWord*>( m_buffer.data()) + (from.m_offset / sizeof(ARMWord));807 ARMWord* insn = reinterpret_cast<ARMWord*>(getAbsoluteJumpAddress(m_buffer.data(), from.m_offset)); 807 808 ARMWord* addr = getLdrImmAddressOnPool(insn, m_buffer.poolAddress()); 808 809 *addr = static_cast<ARMWord>(to.m_offset); … … 811 812 static void linkJump(void* code, JmpSrc from, void* to) 812 813 { 813 patchPointerInternal( reinterpret_cast<intptr_t>(code) + from.m_offset, to);814 patchPointerInternal(getAbsoluteJumpAddress(code, from.m_offset), to); 814 815 } 815 816 816 817 static void relinkJump(void* from, void* to) 817 818 { 818 patchPointerInternal( reinterpret_cast<intptr_t>(from) - sizeof(ARMWord), to);819 patchPointerInternal(getAbsoluteJumpAddress(from), to); 819 820 } 820 821 821 822 static void linkCall(void* code, JmpSrc from, void* to) 822 823 { 823 patchPointerInternal( reinterpret_cast<intptr_t>(code) + from.m_offset, to);824 patchPointerInternal(getAbsoluteJumpAddress(code, from.m_offset), to); 824 825 } 825 826 826 827 static void relinkCall(void* from, void* to) 827 828 { 828 patchPointerInternal( reinterpret_cast<intptr_t>(from) - sizeof(ARMWord), to);829 patchPointerInternal(getAbsoluteJumpAddress(from), to); 829 830 } 830 831 … … 833 834 static void* getRelocatedAddress(void* code, JmpSrc jump) 834 835 { 835 return reinterpret_cast<void*>(reinterpret_cast< ARMWord*>(code) + jump.m_offset / sizeof(ARMWord) + 1);836 return reinterpret_cast<void*>(reinterpret_cast<char*>(code) + jump.m_offset); 836 837 } 837 838 838 839 static void* getRelocatedAddress(void* code, JmpDst label) 839 840 { 840 return reinterpret_cast<void*>(reinterpret_cast< ARMWord*>(code) + label.m_offset / sizeof(ARMWord));841 return reinterpret_cast<void*>(reinterpret_cast<char*>(code) + label.m_offset); 841 842 } 842 843 … … 845 846 static int getDifferenceBetweenLabels(JmpDst from, JmpSrc to) 846 847 { 847 return (to.m_offset + sizeof(ARMWord))- from.m_offset;848 return to.m_offset - from.m_offset; 848 849 } 849 850 … … 855 856 static unsigned getCallReturnOffset(JmpSrc call) 856 857 { 857 return call.m_offset + sizeof(ARMWord);858 return call.m_offset; 858 859 } 859 860
Note:
See TracChangeset
for help on using the changeset viewer.