summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-12 12:40:06 +0800
committerMoonchild <moonchild@palemoon.org>2020-05-20 14:00:40 +0000
commit16ae8db8060f9cf56b37f6a3bb59f1185f6f8809 (patch)
treee0c3a73f23afaa5926f97ed1e8917d9c5a11ab88
parent43f57fe6425cc98bacd404d159d6952ba6820da0 (diff)
downloadUXP-16ae8db8060f9cf56b37f6a3bb59f1185f6f8809.tar
UXP-16ae8db8060f9cf56b37f6a3bb59f1185f6f8809.tar.gz
UXP-16ae8db8060f9cf56b37f6a3bb59f1185f6f8809.tar.lz
UXP-16ae8db8060f9cf56b37f6a3bb59f1185f6f8809.tar.xz
UXP-16ae8db8060f9cf56b37f6a3bb59f1185f6f8809.zip
[IonMonkey] MIPS: Import small optimizations from load & store
-rw-r--r--js/src/jit/mips64/MacroAssembler-mips64.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/js/src/jit/mips64/MacroAssembler-mips64.cpp b/js/src/jit/mips64/MacroAssembler-mips64.cpp
index efdaac8d4..c35723d74 100644
--- a/js/src/jit/mips64/MacroAssembler-mips64.cpp
+++ b/js/src/jit/mips64/MacroAssembler-mips64.cpp
@@ -869,6 +869,10 @@ MacroAssemblerMIPS64::branchWithCode(InstImm code, Label* label, JumpKind jumpKi
void
MacroAssemblerMIPS64::ma_cmp_set(Register rd, Register rs, ImmWord imm, Condition c)
{
+ if (imm.value == 0) {
+ ma_cmp_set(rd, rs, zero, c);
+ return;
+ }
ma_li(ScratchRegister, imm);
ma_cmp_set(rd, rs, ScratchRegister, c);
}
@@ -886,6 +890,10 @@ MacroAssemblerMIPS64::ma_lid(FloatRegister dest, double value)
{
ImmWord imm(mozilla::BitwiseCast<uint64_t>(value));
+ if (imm.value == 0) {
+ moveToDouble(zero, dest);
+ return;
+ }
ma_li(ScratchRegister, imm);
moveToDouble(ScratchRegister, dest);
}
@@ -1288,6 +1296,10 @@ MacroAssemblerMIPS64Compat::store32(Register src, const Address& address)
void
MacroAssemblerMIPS64Compat::store32(Imm32 src, const Address& address)
{
+ if (src.value == 0) {
+ ma_store(zero, address, SizeWord);
+ return;
+ }
move32(src, SecondScratchReg);
ma_store(SecondScratchReg, address, SizeWord);
}
@@ -2060,9 +2072,9 @@ MacroAssemblerMIPS64Compat::handleFailureWithHandlerTail(void* handler)
loadPtr(Address(StackPointer, offsetof(ResumeFromException, stackPointer)), StackPointer);
// We're going to be returning by the ion calling convention
- ma_pop(ra);
+ as_ld(ra, StackPointer, 0);
as_jr(ra);
- as_nop();
+ as_daddiu(StackPointer, StackPointer, sizeof(intptr_t)); // in delay slot.
// If we found a catch handler, this must be a baseline frame. Restore
// state and jump to the catch block.
@@ -2084,8 +2096,9 @@ MacroAssemblerMIPS64Compat::handleFailureWithHandlerTail(void* handler)
loadPtr(Address(sp, offsetof(ResumeFromException, stackPointer)), sp);
pushValue(BooleanValue(true));
- pushValue(exception);
- jump(a0);
+ as_daddiu(StackPointer, StackPointer, -sizeof(intptr_t));
+ as_jr(a0);
+ as_sd(exception.valueReg(), StackPointer, 0); // In delay slot
// Only used in debug mode. Return BaselineFrame->returnValue() to the
// caller.