mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
[IonMonkey] MIPS: Import small optimizations from load & store
This commit is contained in:
parent
8bab1f4fbf
commit
90144c967f
1 changed files with 17 additions and 4 deletions
|
|
@ -869,6 +869,10 @@ MacroAssemblerMIPS64::branchWithCode(InstImm code, Label* label, JumpKind jumpKi
|
||||||
void
|
void
|
||||||
MacroAssemblerMIPS64::ma_cmp_set(Register rd, Register rs, ImmWord imm, Condition c)
|
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_li(ScratchRegister, imm);
|
||||||
ma_cmp_set(rd, rs, ScratchRegister, c);
|
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));
|
ImmWord imm(mozilla::BitwiseCast<uint64_t>(value));
|
||||||
|
|
||||||
|
if (imm.value == 0) {
|
||||||
|
moveToDouble(zero, dest);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ma_li(ScratchRegister, imm);
|
ma_li(ScratchRegister, imm);
|
||||||
moveToDouble(ScratchRegister, dest);
|
moveToDouble(ScratchRegister, dest);
|
||||||
}
|
}
|
||||||
|
|
@ -1288,6 +1296,10 @@ MacroAssemblerMIPS64Compat::store32(Register src, const Address& address)
|
||||||
void
|
void
|
||||||
MacroAssemblerMIPS64Compat::store32(Imm32 src, const Address& address)
|
MacroAssemblerMIPS64Compat::store32(Imm32 src, const Address& address)
|
||||||
{
|
{
|
||||||
|
if (src.value == 0) {
|
||||||
|
ma_store(zero, address, SizeWord);
|
||||||
|
return;
|
||||||
|
}
|
||||||
move32(src, SecondScratchReg);
|
move32(src, SecondScratchReg);
|
||||||
ma_store(SecondScratchReg, address, SizeWord);
|
ma_store(SecondScratchReg, address, SizeWord);
|
||||||
}
|
}
|
||||||
|
|
@ -2060,9 +2072,9 @@ MacroAssemblerMIPS64Compat::handleFailureWithHandlerTail(void* handler)
|
||||||
loadPtr(Address(StackPointer, offsetof(ResumeFromException, stackPointer)), StackPointer);
|
loadPtr(Address(StackPointer, offsetof(ResumeFromException, stackPointer)), StackPointer);
|
||||||
|
|
||||||
// We're going to be returning by the ion calling convention
|
// We're going to be returning by the ion calling convention
|
||||||
ma_pop(ra);
|
as_ld(ra, StackPointer, 0);
|
||||||
as_jr(ra);
|
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
|
// If we found a catch handler, this must be a baseline frame. Restore
|
||||||
// state and jump to the catch block.
|
// state and jump to the catch block.
|
||||||
|
|
@ -2084,8 +2096,9 @@ MacroAssemblerMIPS64Compat::handleFailureWithHandlerTail(void* handler)
|
||||||
loadPtr(Address(sp, offsetof(ResumeFromException, stackPointer)), sp);
|
loadPtr(Address(sp, offsetof(ResumeFromException, stackPointer)), sp);
|
||||||
|
|
||||||
pushValue(BooleanValue(true));
|
pushValue(BooleanValue(true));
|
||||||
pushValue(exception);
|
as_daddiu(StackPointer, StackPointer, -sizeof(intptr_t));
|
||||||
jump(a0);
|
as_jr(a0);
|
||||||
|
as_sd(exception.valueReg(), StackPointer, 0); // In delay slot
|
||||||
|
|
||||||
// Only used in debug mode. Return BaselineFrame->returnValue() to the
|
// Only used in debug mode. Return BaselineFrame->returnValue() to the
|
||||||
// caller.
|
// caller.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue