FFI: Unify stack setup for C calls in interpreter.

This commit is contained in:
Mike Pall
2023-08-29 02:12:13 +02:00
parent 7cc53f0b85
commit cf903edb30
9 changed files with 63 additions and 54 deletions

View File

@@ -2571,16 +2571,16 @@ static void build_subroutines(BuildCtx *ctx)
|.endif
| mov r11, sp
| sub sp, sp, CARG1 // Readjust stack.
| subs CARG2, CARG2, #1
| subs CARG2, CARG2, #4
|.if HFABI
| vldm RB, {d0-d7}
|.endif
| ldr RB, CCSTATE->func
| bmi >2
|1: // Copy stack slots.
| ldr CARG4, [CARG3, CARG2, lsl #2]
| str CARG4, [sp, CARG2, lsl #2]
| subs CARG2, CARG2, #1
| ldr CARG4, [CARG3, CARG2]
| str CARG4, [sp, CARG2]
| subs CARG2, CARG2, #4
| bpl <1
|2:
| ldrd CARG12, CCSTATE->gpr[0]