diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2020-05-12 12:40:08 +0800 |
---|---|---|
committer | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2020-05-14 16:31:57 +0800 |
commit | 98620e3c1e67d60b4a338ba7fe2fa1fd885357b6 (patch) | |
tree | 5fb70107a9a1d038ea3a8896ca4f8b63ca61ec20 /js/src/jit/mips32 | |
parent | 6b56185c0b77cb4b3756fdd4b517b74c77c90afc (diff) | |
download | UXP-98620e3c1e67d60b4a338ba7fe2fa1fd885357b6.tar UXP-98620e3c1e67d60b4a338ba7fe2fa1fd885357b6.tar.gz UXP-98620e3c1e67d60b4a338ba7fe2fa1fd885357b6.tar.lz UXP-98620e3c1e67d60b4a338ba7fe2fa1fd885357b6.tar.xz UXP-98620e3c1e67d60b4a338ba7fe2fa1fd885357b6.zip |
Bug 1271968 - IonMonkey: MIPS: Merge MacroAssembler::branchWithCode.
Tag: #1542
Diffstat (limited to 'js/src/jit/mips32')
-rw-r--r-- | js/src/jit/mips32/MacroAssembler-mips32.cpp | 59 | ||||
-rw-r--r-- | js/src/jit/mips32/MacroAssembler-mips32.h | 1 |
2 files changed, 0 insertions, 60 deletions
diff --git a/js/src/jit/mips32/MacroAssembler-mips32.cpp b/js/src/jit/mips32/MacroAssembler-mips32.cpp index 5b9b835ce..46e52f132 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32.cpp +++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp @@ -504,65 +504,6 @@ MacroAssemblerMIPS::ma_b(Address addr, ImmGCPtr imm, Label* label, Condition c, } void -MacroAssemblerMIPS::branchWithCode(InstImm code, Label* label, JumpKind jumpKind) -{ - MOZ_ASSERT(code.encode() != InstImm(op_regimm, zero, rt_bgezal, BOffImm16(0)).encode()); - InstImm inst_beq = InstImm(op_beq, zero, zero, BOffImm16(0)); - - if (label->bound()) { - int32_t offset = label->offset() - m_buffer.nextOffset().getOffset(); - - if (BOffImm16::IsInRange(offset)) - jumpKind = ShortJump; - - if (jumpKind == ShortJump) { - MOZ_ASSERT(BOffImm16::IsInRange(offset)); - code.setBOffImm16(BOffImm16(offset)); - writeInst(code.encode()); - as_nop(); - return; - } - - if (code.encode() == inst_beq.encode()) { - // Handle mixed jump - addMixedJump(nextOffset(), ImmPtr((void*)label->offset())); - as_j(JOffImm26(0)); - as_nop(); - return; - } - - // Handle long conditional branch - writeInst(invertBranch(code, BOffImm16(4 * sizeof(uint32_t))).encode()); - as_nop(); - addMixedJump(nextOffset(), ImmPtr((void*)label->offset())); - as_j(JOffImm26(0)); - as_nop(); - return; - } - - // Generate open jump and link it to a label. - - // Second word holds a pointer to the next branch in label's chain. - uint32_t nextInChain = label->used() ? label->offset() : LabelBase::INVALID_OFFSET; - - // Make the whole branch continous in the buffer. - m_buffer.ensureSpace(4 * sizeof(uint32_t)); - - if (jumpKind == ShortJump) { - // Indicate that this is short jump with offset 4. - code.setBOffImm16(BOffImm16(4)); - } - BufferOffset bo = writeInst(code.encode()); - writeInst(nextInChain); - if (!oom()) - label->use(bo.getOffset()); - if (jumpKind != ShortJump && code.encode() != inst_beq.encode()) { - as_nop(); - as_nop(); - } -} - -void MacroAssemblerMIPS::ma_cmp_set(Register rd, Register rs, Address addr, Condition c) { ma_lw(ScratchRegister, addr); diff --git a/js/src/jit/mips32/MacroAssembler-mips32.h b/js/src/jit/mips32/MacroAssembler-mips32.h index fcb1d3c3b..69e7c4fe5 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32.h +++ b/js/src/jit/mips32/MacroAssembler-mips32.h @@ -89,7 +89,6 @@ class MacroAssemblerMIPS : public MacroAssemblerMIPSShared void ma_pop(Register r); void ma_push(Register r); - void branchWithCode(InstImm code, Label* label, JumpKind jumpKind); // branches when done from within mips-specific code void ma_b(Register lhs, ImmWord imm, Label* l, Condition c, JumpKind jumpKind = MixedJump) { |