From fa1628f76785e18240c7c7aca63b99d490879461 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 12 May 2020 12:40:05 +0800 Subject: Bug 1323136 - wasm: MIPS: Do bounds check in 32-bit Tag: #1542 --- js/src/jit/mips-shared/Assembler-mips-shared.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'js/src/jit/mips-shared/Assembler-mips-shared.cpp') diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.cpp b/js/src/jit/mips-shared/Assembler-mips-shared.cpp index f813eb946..58af49dda 100644 --- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp +++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp @@ -1744,3 +1744,12 @@ AssemblerMIPSShared::ToggleToCmp(CodeLocationLabel inst_) AutoFlushICache::flush(uintptr_t(inst), 4); } +void +AssemblerMIPSShared::UpdateLuiOriValue(Instruction* inst0, Instruction* inst1, uint32_t value) +{ + MOZ_ASSERT(inst0->extractOpcode() == ((uint32_t)op_lui >> OpcodeShift)); + MOZ_ASSERT(inst1->extractOpcode() == ((uint32_t)op_ori >> OpcodeShift)); + + ((InstImm*) inst0)->setImm16(Imm16::Upper(Imm32(value))); + ((InstImm*) inst1)->setImm16(Imm16::Lower(Imm32(value))); +} -- cgit v1.2.3 From 3fb8648bed83c95f601d2c2e20962cbd08bc7dc7 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 12 May 2020 12:40:07 +0800 Subject: Bug 1271968 - IonMonkey: MIPS: Replace long jumps by mixed jumps. Tag: #1542 --- js/src/jit/mips-shared/Assembler-mips-shared.cpp | 100 ++++++++++++++++++++++- 1 file changed, 96 insertions(+), 4 deletions(-) (limited to 'js/src/jit/mips-shared/Assembler-mips-shared.cpp') diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.cpp b/js/src/jit/mips-shared/Assembler-mips-shared.cpp index 58af49dda..8519bab4d 100644 --- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp +++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp @@ -92,6 +92,7 @@ void AssemblerMIPSShared::finish() { MOZ_ASSERT(!isFinished); + GenerateMixedJumps(); isFinished = true; } @@ -100,13 +101,21 @@ AssemblerMIPSShared::asmMergeWith(const AssemblerMIPSShared& other) { if (!AssemblerShared::asmMergeWith(size(), other)) return false; - for (size_t i = 0; i < other.numLongJumps(); i++) { - size_t off = other.longJumps_[i]; - addLongJump(BufferOffset(size() + off)); - } return m_buffer.appendBuffer(other.m_buffer); } +void +AssemblerMIPSShared::executableCopy(uint8_t* buffer) +{ + MOZ_ASSERT(isFinished); + m_buffer.executableCopy(buffer); + + // Patch all mixed jumps during code copy. + PatchMixedJumps(buffer); + + AutoFlushICache::setRange(uintptr_t(buffer), m_buffer.size()); +} + uint32_t AssemblerMIPSShared::actualIndex(uint32_t idx_) const { @@ -1662,6 +1671,89 @@ AssemblerMIPSShared::NextInstruction(uint8_t* inst_, uint32_t* count) return reinterpret_cast(inst->next()); } +Instruction* +AssemblerMIPSShared::GetInstructionImmediateFromJump(Instruction* jump) +{ + if (jump->extractOpcode() == ((uint32_t)op_j >> OpcodeShift) || + jump->extractOpcode() == ((uint32_t)op_jal >> OpcodeShift)) + { + InstJump* j = (InstJump*) jump; + uintptr_t base = (uintptr_t(j) >> Imm28Bits) << Imm28Bits; + uint32_t index = j->extractImm26Value() << 2; + + jump = (Instruction*)(base | index); + } + + return jump; +} + +void +AssemblerMIPSShared::PatchMixedJump(uint8_t* src, uint8_t* mid, uint8_t* target) +{ + InstImm* b = (InstImm*)src; + uint32_t opcode = b->extractOpcode(); + int offset; + + if (mid) { + offset = intptr_t(mid); + Assembler::PatchInstructionImmediate(mid, PatchedImmPtr(target)); + } else { + offset = intptr_t(target); + } + + if (((uint32_t)op_j >> OpcodeShift) == opcode || + ((uint32_t)op_jal >> OpcodeShift) == opcode) + { + InstJump* j = (InstJump*)b; + + j->setJOffImm26(JOffImm26(offset)); + } else { + InstImm inst_beq = InstImm(op_beq, zero, zero, BOffImm16(0)); + int i = (b[0].encode() == inst_beq.encode()) ? 0 : 2; + + b[i] = InstJump(op_j, JOffImm26(offset)).encode(); + } +} + +void +AssemblerMIPSShared::PatchMixedJumps(uint8_t* buffer) +{ + // Patch all mixed jumps. + for (size_t i = 0; i < numMixedJumps(); i++) { + MixedJumpPatch& mjp = mixedJump(i); + InstImm* b = (InstImm*)(buffer + mjp.src.getOffset()); + uint32_t opcode = b->extractOpcode(); + int offset; + + if (mjp.mid.assigned()) { + offset = intptr_t(buffer) + mjp.mid.getOffset(); + Assembler::PatchInstructionImmediate(buffer + mjp.mid.getOffset(), + PatchedImmPtr(buffer + uintptr_t(mjp.target))); + } else { + offset = intptr_t(buffer) + intptr_t(mjp.target); + } + + if (((uint32_t)op_j >> OpcodeShift) == opcode || + ((uint32_t)op_jal >> OpcodeShift) == opcode) + { + InstJump* j = (InstJump*)b; + + j->setJOffImm26(JOffImm26(offset)); + } else { + InstImm inst_beq = InstImm(op_beq, zero, zero, BOffImm16(0)); + + if (b[0].encode() == inst_beq.encode()) { + b[0] = InstJump(op_j, JOffImm26(offset)).encode(); + } else { + b[0] = invertBranch(b[0], BOffImm16(4 * sizeof(uint32_t))); + b[2] = InstJump(op_j, JOffImm26(offset)).encode(); + } + } + + b[1].makeNop(); + } +} + // Since there are no pools in MIPS implementation, this should be simple. Instruction* Instruction::next() -- cgit v1.2.3 From c3a21acaee65f9fde0f76b635ce906ca9c901889 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 12 May 2020 12:40:07 +0800 Subject: Bug 1271968 - IonMonkey: MIPS: Merge Assembler::bind. Tag: #1542 --- js/src/jit/mips-shared/Assembler-mips-shared.cpp | 81 ++++++++++++++++++++++++ 1 file changed, 81 insertions(+) (limited to 'js/src/jit/mips-shared/Assembler-mips-shared.cpp') diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.cpp b/js/src/jit/mips-shared/Assembler-mips-shared.cpp index 8519bab4d..1b14ef0eb 100644 --- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp +++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp @@ -1596,6 +1596,87 @@ AssemblerMIPSShared::bindLater(Label* label, wasm::TrapDesc target) label->reset(); } +void +AssemblerMIPSShared::bind(InstImm* inst, uintptr_t branch, uintptr_t target) +{ + intptr_t offset = target - branch; + + // Generate the patchable mixed jump for call. + if (inst->extractOpcode() == ((uint32_t)op_jal >> OpcodeShift)) { + addMixedJump(BufferOffset(branch), ImmPtr((void*)target)); + return; + } + + // If encoded offset is 4, then the jump must be short + if (BOffImm16(inst[0]).decode() == 4) { + MOZ_ASSERT(BOffImm16::IsInRange(offset)); + inst[0].setBOffImm16(BOffImm16(offset)); + inst[1].makeNop(); + return; + } + + if (BOffImm16::IsInRange(offset)) { + inst[0].setBOffImm16(BOffImm16(offset)); + inst[1].makeNop(); + return; + } + + addMixedJump(BufferOffset(branch), ImmPtr((void*)target)); +} + +void +AssemblerMIPSShared::bind(RepatchLabel* label) +{ + BufferOffset dest = nextOffset(); + if (label->used() && !oom()) { + // If the label has a use, then change this use to refer to + // the bound label; + BufferOffset b(label->offset()); + InstImm* inst = (InstImm*)editSrc(b); + InstImm inst_beq = InstImm(op_beq, zero, zero, BOffImm16(0)); + intptr_t offset = dest.getOffset() - label->offset(); + + // If first instruction is j, then this is a mixed jump. + // If second instruction is lui, then this is a loop backedge. + if (inst[0].extractOpcode() == (uint32_t(op_j) >> OpcodeShift)) { + // For unconditional mixed branches generated by jumpWithPatch + addMixedJump(b, ImmPtr((void*)dest.getOffset()), MixedJumpPatch::PATCHABLE); + } else if (inst[1].extractOpcode() == (uint32_t(op_lui) >> OpcodeShift) || + BOffImm16::IsInRange(offset)) + { + // Handle code produced by: + // backedgeJump + MOZ_ASSERT(BOffImm16::IsInRange(offset)); + MOZ_ASSERT(inst[0].extractOpcode() == (uint32_t(op_beq) >> OpcodeShift) || + inst[0].extractOpcode() == (uint32_t(op_bne) >> OpcodeShift) || + inst[0].extractOpcode() == (uint32_t(op_blez) >> OpcodeShift) || + inst[0].extractOpcode() == (uint32_t(op_bgtz) >> OpcodeShift)); + inst[0].setBOffImm16(BOffImm16(offset)); + } else if (inst[0].encode() == inst_beq.encode()) { + // Handle open mixed unconditional jumps created by + // MacroAssemblerMIPSShared::ma_b(..., wasm::Trap, ...). + // We need to add it to mixed jumps array here. + // See MacroAssemblerMIPS::branchWithCode(). + MOZ_ASSERT(inst[1].encode() == NopInst); + addMixedJump(b, ImmPtr((void*)dest.getOffset()), MixedJumpPatch::PATCHABLE); + inst[0] = InstJump(op_j, JOffImm26(0)).encode(); + } else { + // Handle open mixed conditional jumps created by + // MacroAssemblerMIPSShared::ma_b(..., wasm::Trap, ...). + inst[0] = invertBranch(inst[0], BOffImm16(4 * sizeof(uint32_t))); + // No need for a "nop" here because we can clobber scratch. + // We need to add it to mixed jumps array here. + // See MacroAssemblerMIPS::branchWithCode(). + MOZ_ASSERT(inst[1].encode() == NopInst); + MOZ_ASSERT(inst[2].encode() == NopInst); + MOZ_ASSERT(inst[3].encode() == NopInst); + addMixedJump(b, ImmPtr((void*)dest.getOffset()), MixedJumpPatch::PATCHABLE); + inst[2] = InstJump(op_j, JOffImm26(0)).encode(); + } + } + label->bind(dest.getOffset()); +} + void AssemblerMIPSShared::retarget(Label* label, Label* target) { -- cgit v1.2.3 From ac62e4cfdd03369d60e22f78b38b81f5f8daa5bd Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 12 May 2020 12:40:08 +0800 Subject: Bug 1271968 - IonMonkey: MIPS: Handle conditional branch in out of line code of mixed jump. Tag: #1542 --- js/src/jit/mips-shared/Assembler-mips-shared.cpp | 57 +++++++++++------------- 1 file changed, 27 insertions(+), 30 deletions(-) (limited to 'js/src/jit/mips-shared/Assembler-mips-shared.cpp') diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.cpp b/js/src/jit/mips-shared/Assembler-mips-shared.cpp index 1b14ef0eb..7b8ead20a 100644 --- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp +++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp @@ -1621,7 +1621,12 @@ AssemblerMIPSShared::bind(InstImm* inst, uintptr_t branch, uintptr_t target) return; } - addMixedJump(BufferOffset(branch), ImmPtr((void*)target)); + MixedJumpPatch::Kind kind = MixedJumpPatch::NONE; + InstImm inst_beq = InstImm(op_beq, zero, zero, BOffImm16(0)); + if (inst[0].encode() != inst_beq.encode()) + kind = MixedJumpPatch::CONDITIONAL; + + addMixedJump(BufferOffset(branch), ImmPtr((const void*)target), kind); } void @@ -1763,6 +1768,8 @@ AssemblerMIPSShared::GetInstructionImmediateFromJump(Instruction* jump) uint32_t index = j->extractImm26Value() << 2; jump = (Instruction*)(base | index); + if (jump->extractOpcode() != ((uint32_t)op_lui >> OpcodeShift)) + jump = jump->next(); } return jump; @@ -1776,8 +1783,16 @@ AssemblerMIPSShared::PatchMixedJump(uint8_t* src, uint8_t* mid, uint8_t* target) int offset; if (mid) { + int o = 0; + InstImm* insn = (InstImm*)mid; + offset = intptr_t(mid); - Assembler::PatchInstructionImmediate(mid, PatchedImmPtr(target)); + if (insn->extractOpcode() != ((uint32_t)op_lui >> OpcodeShift)) { + o = 1 * sizeof(uint32_t); + Assembler::PatchInstructionImmediate(mid + Assembler::PatchWrite_NearCallSize(), + PatchedImmPtr(&b[2])); + } + Assembler::PatchInstructionImmediate(mid + o, PatchedImmPtr(target)); } else { offset = intptr_t(target); } @@ -1789,10 +1804,7 @@ AssemblerMIPSShared::PatchMixedJump(uint8_t* src, uint8_t* mid, uint8_t* target) j->setJOffImm26(JOffImm26(offset)); } else { - InstImm inst_beq = InstImm(op_beq, zero, zero, BOffImm16(0)); - int i = (b[0].encode() == inst_beq.encode()) ? 0 : 2; - - b[i] = InstJump(op_j, JOffImm26(offset)).encode(); + b[0] = InstJump(op_j, JOffImm26(offset)).encode(); } } @@ -1802,35 +1814,20 @@ AssemblerMIPSShared::PatchMixedJumps(uint8_t* buffer) // Patch all mixed jumps. for (size_t i = 0; i < numMixedJumps(); i++) { MixedJumpPatch& mjp = mixedJump(i); - InstImm* b = (InstImm*)(buffer + mjp.src.getOffset()); - uint32_t opcode = b->extractOpcode(); - int offset; + uint8_t* src = buffer + mjp.src.getOffset(); + uint8_t* mid = nullptr; + uint8_t* target = buffer + uintptr_t(mjp.target); + InstImm* b = (InstImm*)src; if (mjp.mid.assigned()) { - offset = intptr_t(buffer) + mjp.mid.getOffset(); - Assembler::PatchInstructionImmediate(buffer + mjp.mid.getOffset(), - PatchedImmPtr(buffer + uintptr_t(mjp.target))); - } else { - offset = intptr_t(buffer) + intptr_t(mjp.target); - } - - if (((uint32_t)op_j >> OpcodeShift) == opcode || - ((uint32_t)op_jal >> OpcodeShift) == opcode) - { - InstJump* j = (InstJump*)b; - - j->setJOffImm26(JOffImm26(offset)); - } else { - InstImm inst_beq = InstImm(op_beq, zero, zero, BOffImm16(0)); - - if (b[0].encode() == inst_beq.encode()) { - b[0] = InstJump(op_j, JOffImm26(offset)).encode(); - } else { - b[0] = invertBranch(b[0], BOffImm16(4 * sizeof(uint32_t))); - b[2] = InstJump(op_j, JOffImm26(offset)).encode(); + mid = buffer + mjp.mid.getOffset(); + if (MixedJumpPatch::CONDITIONAL & mjp.kind) { + InstImm* bc = (InstImm*)(buffer + mjp.mid.getOffset()); + bc[0] = invertBranch(b[0], BOffImm16(Assembler::PatchWrite_NearCallSize())); } } + PatchMixedJump(src, mid, target); b[1].makeNop(); } } -- cgit v1.2.3 From b4f0be5e9537c6c202443b34f7bb3b99cb08be0f Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 12 May 2020 12:40:09 +0800 Subject: Bug 1271968 - IonMonkey: MIPS: Refactor PatchWrite_NearCall. Tag: #1542 --- js/src/jit/mips-shared/Assembler-mips-shared.cpp | 26 +++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'js/src/jit/mips-shared/Assembler-mips-shared.cpp') diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.cpp b/js/src/jit/mips-shared/Assembler-mips-shared.cpp index 7b8ead20a..e78d33549 100644 --- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp +++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp @@ -1748,6 +1748,25 @@ AssemblerMIPSShared::PatchWrite_Imm32(CodeLocationLabel label, Imm32 imm) *(raw - 1) = imm.value; } +uint32_t +AssemblerMIPSShared::PatchWrite_NearCallSize() +{ + return 2 * sizeof(uint32_t); +} + +void +AssemblerMIPSShared::PatchWrite_NearCall(CodeLocationLabel start, CodeLocationLabel toCall) +{ + Instruction* inst = (Instruction*) start.raw(); + + // Overwrite whatever instruction used to be here with a call. + inst[0] = InstJump(op_jal, JOffImm26(uintptr_t(toCall.raw()))); + inst[1] = InstNOP(); + + // Ensure everyone sees the code that was just written into memory. + AutoFlushICache::flush(uintptr_t(inst), PatchWrite_NearCallSize()); +} + uint8_t* AssemblerMIPSShared::NextInstruction(uint8_t* inst_, uint32_t* count) { @@ -1789,8 +1808,8 @@ AssemblerMIPSShared::PatchMixedJump(uint8_t* src, uint8_t* mid, uint8_t* target) offset = intptr_t(mid); if (insn->extractOpcode() != ((uint32_t)op_lui >> OpcodeShift)) { o = 1 * sizeof(uint32_t); - Assembler::PatchInstructionImmediate(mid + Assembler::PatchWrite_NearCallSize(), - PatchedImmPtr(&b[2])); + Assembler::PatchInstructionImmediate(mid + Assembler::InstructionImmediateSize() + + 2 * sizeof(uint32_t), PatchedImmPtr(&b[2])); } Assembler::PatchInstructionImmediate(mid + o, PatchedImmPtr(target)); } else { @@ -1823,7 +1842,8 @@ AssemblerMIPSShared::PatchMixedJumps(uint8_t* buffer) mid = buffer + mjp.mid.getOffset(); if (MixedJumpPatch::CONDITIONAL & mjp.kind) { InstImm* bc = (InstImm*)(buffer + mjp.mid.getOffset()); - bc[0] = invertBranch(b[0], BOffImm16(Assembler::PatchWrite_NearCallSize())); + BOffImm16 offset(Assembler::InstructionImmediateSize() + 2 * sizeof(uint32_t)); + bc[0] = invertBranch(b[0], offset); } } -- cgit v1.2.3 From 494cfe32c9224ef5697b53288aaad0896c05b4b8 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 12 May 2020 12:40:09 +0800 Subject: Bug 1271968 - wasm: MIPS: Port mixed jump for wasm. Tag: #1542 --- js/src/jit/mips-shared/Assembler-mips-shared.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js/src/jit/mips-shared/Assembler-mips-shared.cpp') diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.cpp b/js/src/jit/mips-shared/Assembler-mips-shared.cpp index e78d33549..63edc0b02 100644 --- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp +++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp @@ -101,6 +101,11 @@ AssemblerMIPSShared::asmMergeWith(const AssemblerMIPSShared& other) { if (!AssemblerShared::asmMergeWith(size(), other)) return false; + for (size_t i = 0; i < other.numMixedJumps(); i++) { + const MixedJumpPatch& mjp = other.mixedJumps_[i]; + addMixedJump(BufferOffset(size() + mjp.src.getOffset()), + ImmPtr(size() + mjp.target), mjp.kind); + } return m_buffer.appendBuffer(other.m_buffer); } -- cgit v1.2.3 From 31ad2d12db7ebd94f79ed4c81f066f64721504f4 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Tue, 12 May 2020 12:40:10 +0800 Subject: Bug 1271968 - IonMonkey: MIPS: Refactor addMixedJump. Tag: #1542 --- js/src/jit/mips-shared/Assembler-mips-shared.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'js/src/jit/mips-shared/Assembler-mips-shared.cpp') diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.cpp b/js/src/jit/mips-shared/Assembler-mips-shared.cpp index 63edc0b02..97f27c2e6 100644 --- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp +++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp @@ -104,7 +104,7 @@ AssemblerMIPSShared::asmMergeWith(const AssemblerMIPSShared& other) for (size_t i = 0; i < other.numMixedJumps(); i++) { const MixedJumpPatch& mjp = other.mixedJumps_[i]; addMixedJump(BufferOffset(size() + mjp.src.getOffset()), - ImmPtr(size() + mjp.target), mjp.kind); + size() + mjp.target, mjp.kind); } return m_buffer.appendBuffer(other.m_buffer); } @@ -1608,7 +1608,7 @@ AssemblerMIPSShared::bind(InstImm* inst, uintptr_t branch, uintptr_t target) // Generate the patchable mixed jump for call. if (inst->extractOpcode() == ((uint32_t)op_jal >> OpcodeShift)) { - addMixedJump(BufferOffset(branch), ImmPtr((void*)target)); + addMixedJump(BufferOffset(branch), target); return; } @@ -1631,7 +1631,7 @@ AssemblerMIPSShared::bind(InstImm* inst, uintptr_t branch, uintptr_t target) if (inst[0].encode() != inst_beq.encode()) kind = MixedJumpPatch::CONDITIONAL; - addMixedJump(BufferOffset(branch), ImmPtr((const void*)target), kind); + addMixedJump(BufferOffset(branch), target, kind); } void @@ -1650,7 +1650,7 @@ AssemblerMIPSShared::bind(RepatchLabel* label) // If second instruction is lui, then this is a loop backedge. if (inst[0].extractOpcode() == (uint32_t(op_j) >> OpcodeShift)) { // For unconditional mixed branches generated by jumpWithPatch - addMixedJump(b, ImmPtr((void*)dest.getOffset()), MixedJumpPatch::PATCHABLE); + addMixedJump(b, dest.getOffset(), MixedJumpPatch::PATCHABLE); } else if (inst[1].extractOpcode() == (uint32_t(op_lui) >> OpcodeShift) || BOffImm16::IsInRange(offset)) { @@ -1668,7 +1668,7 @@ AssemblerMIPSShared::bind(RepatchLabel* label) // We need to add it to mixed jumps array here. // See MacroAssemblerMIPS::branchWithCode(). MOZ_ASSERT(inst[1].encode() == NopInst); - addMixedJump(b, ImmPtr((void*)dest.getOffset()), MixedJumpPatch::PATCHABLE); + addMixedJump(b, dest.getOffset(), MixedJumpPatch::PATCHABLE); inst[0] = InstJump(op_j, JOffImm26(0)).encode(); } else { // Handle open mixed conditional jumps created by @@ -1680,7 +1680,7 @@ AssemblerMIPSShared::bind(RepatchLabel* label) MOZ_ASSERT(inst[1].encode() == NopInst); MOZ_ASSERT(inst[2].encode() == NopInst); MOZ_ASSERT(inst[3].encode() == NopInst); - addMixedJump(b, ImmPtr((void*)dest.getOffset()), MixedJumpPatch::PATCHABLE); + addMixedJump(b, dest.getOffset(), MixedJumpPatch::PATCHABLE); inst[2] = InstJump(op_j, JOffImm26(0)).encode(); } } @@ -1840,7 +1840,7 @@ AssemblerMIPSShared::PatchMixedJumps(uint8_t* buffer) MixedJumpPatch& mjp = mixedJump(i); uint8_t* src = buffer + mjp.src.getOffset(); uint8_t* mid = nullptr; - uint8_t* target = buffer + uintptr_t(mjp.target); + uint8_t* target = buffer + mjp.target; InstImm* b = (InstImm*)src; if (mjp.mid.assigned()) { -- cgit v1.2.3