mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 04:17:31 +09:00
Issue #3049 - Preserve loongarch64 ra across baseline helper calls
This commit is contained in:
parent
9d44c48014
commit
63a142a912
3 changed files with 36 additions and 2 deletions
|
|
@ -458,7 +458,6 @@ BaselineCompiler::emitEpilogue()
|
|||
masm.pop(BaselineFrameReg);
|
||||
|
||||
emitProfilerExitFrame();
|
||||
|
||||
masm.ret();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -484,7 +483,7 @@ BaselineCompiler::emitOutOfLinePostBarrierSlot()
|
|||
// On ARM, save the link register before calling. It contains the return
|
||||
// address. The |masm.ret()| later will pop this into |pc| to return.
|
||||
masm.push(lr);
|
||||
#elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
|
||||
#elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64) || defined(JS_CODEGEN_LOONGARCH64)
|
||||
masm.push(ra);
|
||||
#endif
|
||||
masm.pushValue(R0);
|
||||
|
|
|
|||
|
|
@ -679,9 +679,15 @@ ICToBool_Object::Compiler::generateStubCode(MacroAssembler& masm)
|
|||
EmitReturnFromIC(masm);
|
||||
|
||||
masm.bind(&slowPath);
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.push(ra);
|
||||
#endif
|
||||
masm.setupUnalignedABICall(scratch);
|
||||
masm.passABIArg(objReg);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, js::EmulatesUndefined));
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.pop(ra);
|
||||
#endif
|
||||
masm.convertBoolToInt32(ReturnReg, ReturnReg);
|
||||
masm.xor32(Imm32(1), ReturnReg);
|
||||
masm.tagValue(JSVAL_TYPE_BOOLEAN, ReturnReg, R0);
|
||||
|
|
@ -7468,6 +7474,9 @@ ICTableSwitch::Compiler::generateStubCode(MacroAssembler& masm)
|
|||
masm.convertDoubleToInt32(FloatReg0, key, &outOfRange, /* negativeZeroCheck = */ false);
|
||||
} else {
|
||||
// Pass pointer to double value.
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.push(ra);
|
||||
#endif
|
||||
masm.pushValue(R0);
|
||||
masm.moveStackPtrTo(R0.scratchReg());
|
||||
|
||||
|
|
@ -7479,6 +7488,9 @@ ICTableSwitch::Compiler::generateStubCode(MacroAssembler& masm)
|
|||
// int32.
|
||||
masm.movePtr(ReturnReg, scratch);
|
||||
masm.popValue(R0);
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.pop(ra);
|
||||
#endif
|
||||
masm.branchIfFalseBool(scratch, &outOfRange);
|
||||
masm.unboxInt32(R0, key);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -848,6 +848,8 @@ ICStubCompiler::emitPostWriteBarrierSlot(MacroAssembler& masm, Register obj, Val
|
|||
// void PostWriteBarrier(JSRuntime* rt, JSObject* obj);
|
||||
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
|
||||
saveRegs.add(ICTailCallReg);
|
||||
#elif defined(JS_CODEGEN_LOONGARCH64)
|
||||
masm.push(ra);
|
||||
#endif
|
||||
saveRegs.set() = GeneralRegisterSet::Intersect(saveRegs.set(), GeneralRegisterSet::Volatile());
|
||||
masm.PushRegsInMask(saveRegs);
|
||||
|
|
@ -857,6 +859,9 @@ ICStubCompiler::emitPostWriteBarrierSlot(MacroAssembler& masm, Register obj, Val
|
|||
masm.passABIArg(obj);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, PostWriteBarrier));
|
||||
masm.PopRegsInMask(saveRegs);
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.pop(ra);
|
||||
#endif
|
||||
|
||||
masm.bind(&skipBarrier);
|
||||
}
|
||||
|
|
@ -1292,10 +1297,16 @@ ICBinaryArith_Double::Compiler::generateStubCode(MacroAssembler& masm)
|
|||
masm.divDouble(FloatReg1, FloatReg0);
|
||||
break;
|
||||
case JSOP_MOD:
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.push(ra);
|
||||
#endif
|
||||
masm.setupUnalignedABICall(R0.scratchReg());
|
||||
masm.passABIArg(FloatReg0, MoveOp::DOUBLE);
|
||||
masm.passABIArg(FloatReg1, MoveOp::DOUBLE);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, NumberMod), MoveOp::DOUBLE);
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.pop(ra);
|
||||
#endif
|
||||
MOZ_ASSERT(ReturnDoubleReg == FloatReg0);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1417,9 +1428,15 @@ ICBinaryArith_DoubleWithInt32::Compiler::generateStubCode(MacroAssembler& masm)
|
|||
|
||||
masm.bind(&truncateABICall);
|
||||
masm.push(intReg);
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.push(ra);
|
||||
#endif
|
||||
masm.setupUnalignedABICall(scratchReg);
|
||||
masm.passABIArg(FloatReg0, MoveOp::DOUBLE);
|
||||
masm.callWithABI(mozilla::BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.pop(ra);
|
||||
#endif
|
||||
masm.storeCallInt32Result(scratchReg);
|
||||
masm.pop(intReg);
|
||||
|
||||
|
|
@ -1581,9 +1598,15 @@ ICUnaryArith_Double::Compiler::generateStubCode(MacroAssembler& masm)
|
|||
masm.jump(&doneTruncate);
|
||||
|
||||
masm.bind(&truncateABICall);
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.push(ra);
|
||||
#endif
|
||||
masm.setupUnalignedABICall(scratchReg);
|
||||
masm.passABIArg(FloatReg0, MoveOp::DOUBLE);
|
||||
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
|
||||
#ifdef JS_CODEGEN_LOONGARCH64
|
||||
masm.pop(ra);
|
||||
#endif
|
||||
masm.storeCallInt32Result(scratchReg);
|
||||
|
||||
masm.bind(&doneTruncate);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue