summaryrefslogtreecommitdiffstats
path: root/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-12 12:40:08 +0800
committerMoonchild <moonchild@palemoon.org>2020-05-20 14:01:14 +0000
commit61af6cc299cb40497a5a9f5b0c1221026e365cd5 (patch)
tree7d4502201a1ea8c0de36438aea17a973fd8706df /js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
parentc3a21acaee65f9fde0f76b635ce906ca9c901889 (diff)
downloadUXP-61af6cc299cb40497a5a9f5b0c1221026e365cd5.tar
UXP-61af6cc299cb40497a5a9f5b0c1221026e365cd5.tar.gz
UXP-61af6cc299cb40497a5a9f5b0c1221026e365cd5.tar.lz
UXP-61af6cc299cb40497a5a9f5b0c1221026e365cd5.tar.xz
UXP-61af6cc299cb40497a5a9f5b0c1221026e365cd5.zip
Bug 1271968 - IonMonkey: MIPS: Merge MacroAssembler::ma_jal.
Tag: #1542
Diffstat (limited to 'js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp')
-rw-r--r--js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
index a8b53e67c..97660299a 100644
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
@@ -727,6 +727,30 @@ MacroAssemblerMIPSShared::ma_b(wasm::TrapDesc target, JumpKind jumpKind)
bindLater(&label, target);
}
+void
+MacroAssemblerMIPSShared::ma_jal(Label* label)
+{
+ if (label->bound()) {
+ // Generate the mixed jump.
+ addMixedJump(nextOffset(), ImmPtr((void*)label->offset()));
+ as_jal(JOffImm26(0));
+ as_nop();
+ return;
+ }
+
+ // 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. The '2'
+ // instructions are writing at below (contain delay slot).
+ m_buffer.ensureSpace(2 * sizeof(uint32_t));
+
+ BufferOffset bo = as_jal(JOffImm26(0));
+ writeInst(nextInChain);
+ if (!oom())
+ label->use(bo.getOffset());
+}
+
Assembler::Condition
MacroAssemblerMIPSShared::ma_cmp(Register scratch, Register lhs, Register rhs, Condition c)
{