diff --git a/js/src/ion/arm/MacroAssembler-arm.cpp b/js/src/ion/arm/MacroAssembler-arm.cpp index badd5fc25ab1..ed14deb635a1 100644 --- a/js/src/ion/arm/MacroAssembler-arm.cpp +++ b/js/src/ion/arm/MacroAssembler-arm.cpp @@ -389,11 +389,11 @@ MacroAssemblerARM::ma_mov(const ImmGCPtr &ptr, Register dest) // before to recover the pointer, and not after. writeDataRelocation(ptr); RelocStyle rs; - if (hasMOVWT()) { + if (hasMOVWT()) rs = L_MOVWT; - } else { + else rs = L_LDR; - } + ma_movPatchable(Imm32(ptr.value), dest, Always, rs); } @@ -1527,7 +1527,13 @@ MacroAssemblerARMCompat::callWithExitFrame(IonCode *target) Push(Imm32(descriptor)); // descriptor addPendingJump(m_buffer.nextOffset(), target->raw(), Relocation::IONCODE); - ma_mov(Imm32((int) target->raw()), ScratchRegister); + RelocStyle rs; + if (hasMOVWT()) + rs = L_MOVWT; + else + rs = L_LDR; + + ma_movPatchable(Imm32((int) target->raw()), ScratchRegister, Always, rs); ma_callIonHalfPush(ScratchRegister); } @@ -1539,7 +1545,13 @@ MacroAssemblerARMCompat::callWithExitFrame(IonCode *target, Register dynStack) Push(dynStack); // descriptor addPendingJump(m_buffer.nextOffset(), target->raw(), Relocation::IONCODE); - ma_mov(Imm32((int) target->raw()), ScratchRegister); + RelocStyle rs; + if (hasMOVWT()) + rs = L_MOVWT; + else + rs = L_LDR; + + ma_movPatchable(Imm32((int) target->raw()), ScratchRegister, Always, rs); ma_callIonHalfPush(ScratchRegister); } @@ -2970,7 +2982,13 @@ MacroAssemblerARM::ma_callIonHalfPush(const Register r) void MacroAssemblerARM::ma_call(void *dest) { - ma_mov(Imm32((uint32_t)dest), CallReg); + RelocStyle rs; + if (hasMOVWT()) + rs = L_MOVWT; + else + rs = L_LDR; + + ma_movPatchable(Imm32((uint32_t) dest), CallReg, Always, rs); as_blx(CallReg); } diff --git a/js/src/ion/arm/MacroAssembler-arm.h b/js/src/ion/arm/MacroAssembler-arm.h index 1774de57524f..0db5713421a8 100644 --- a/js/src/ion/arm/MacroAssembler-arm.h +++ b/js/src/ion/arm/MacroAssembler-arm.h @@ -516,13 +516,25 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM void call(IonCode *c) { BufferOffset bo = m_buffer.nextOffset(); addPendingJump(bo, c->raw(), Relocation::IONCODE); - ma_mov(Imm32((uint32_t)c->raw()), ScratchRegister); + RelocStyle rs; + if (hasMOVWT()) + rs = L_MOVWT; + else + rs = L_LDR; + + ma_movPatchable(Imm32((int) c->raw()), ScratchRegister, Always, rs); ma_callIonHalfPush(ScratchRegister); } void branch(IonCode *c) { BufferOffset bo = m_buffer.nextOffset(); addPendingJump(bo, c->raw(), Relocation::IONCODE); - ma_mov(Imm32((uint32_t)c->raw()), ScratchRegister); + RelocStyle rs; + if (hasMOVWT()) + rs = L_MOVWT; + else + rs = L_LDR; + + ma_movPatchable(Imm32((int) c->raw()), ScratchRegister, Always, rs); ma_bx(ScratchRegister); } void branch(const Register reg) {