mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 19:47:32 +09:00
Issue #3049 - loongarch64: use explicit VM wrapper tail-call contracts
This commit is contained in:
parent
df4de67d30
commit
ff4332d605
1 changed files with 3 additions and 12 deletions
|
|
@ -675,19 +675,10 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
|
||||||
Register cxreg = a0;
|
Register cxreg = a0;
|
||||||
regs.take(cxreg);
|
regs.take(cxreg);
|
||||||
|
|
||||||
// LoongArch callers can arrive here in either style:
|
// Non-tail calls keep the return address in |ra|, while tail-call sites
|
||||||
// - Non-tail calls keep the return address in |ra| and only push a descriptor.
|
// have already materialized a CommonFrameLayout on the stack.
|
||||||
// - Tail calls push a full CommonFrameLayout with the return address on the stack.
|
if (f.expectTailCall == NonTailCall)
|
||||||
// Normalize both forms so the wrapper always sees a stack return address.
|
|
||||||
{
|
|
||||||
Label haveStackReturnAddress;
|
|
||||||
Register scratch = regs.getAny();
|
|
||||||
masm.loadPtr(Address(StackPointer, 0), scratch);
|
|
||||||
masm.rshiftPtr(Imm32(32), scratch);
|
|
||||||
masm.branch32(Assembler::NotEqual, scratch, Imm32(0), &haveStackReturnAddress);
|
|
||||||
masm.pushReturnAddress();
|
masm.pushReturnAddress();
|
||||||
masm.bind(&haveStackReturnAddress);
|
|
||||||
}
|
|
||||||
|
|
||||||
// We're aligned to an exit frame, so link it up.
|
// We're aligned to an exit frame, so link it up.
|
||||||
masm.enterExitFrame(&f);
|
masm.enterExitFrame(&f);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue