JIT: fix 32-bit non-Mac stack alignment
Fix function-call setup to align the stack to a 16-byte boundary on all platforms.
This commit is contained in:
parent
0bb23c3998
commit
c611f126fd
|
@ -83,6 +83,11 @@ END_XFORM_ARITH;
|
|||
# define _jit_epilog scheme_jit_epilog
|
||||
#endif
|
||||
|
||||
/* The ABI for _CALL_DARWIN or JIT_X86_64 requires alignment. Even
|
||||
when it's not required, it's better for performance when flonums
|
||||
are stored on the stack. */
|
||||
#define JIT_X86_ALIGN_STACK 1
|
||||
|
||||
#ifndef DEFINE_LIGHTNING_FUNCS
|
||||
# define SUPPRESS_LIGHTNING_FUNCS
|
||||
#endif
|
||||
|
@ -936,11 +941,7 @@ void scheme_jit_prolog_again(mz_jit_state *jitter, int n, int ret_addr_reg)
|
|||
# define mz_get_local_p_x(x, l, FP) jit_ldxi_p((x), FP, (l))
|
||||
# define mz_patch_branch_at(a, v) jit_patch_branch_at(a, v)
|
||||
# define mz_patch_ucbranch_at(a, v) jit_patch_ucbranch_at(a, v)
|
||||
/* The ABI for _CALL_DARWIN or JIT_X86_64 requires alignment. Even
|
||||
when it's not required, it's better for performance when flonums
|
||||
are stored on the stack. */
|
||||
# define X86_ALIGN_STACK 1
|
||||
# ifdef X86_ALIGN_STACK
|
||||
# ifdef JIT_X86_ALIGN_STACK
|
||||
/* Maintain 16-byte stack alignment. */
|
||||
# ifdef JIT_X86_64
|
||||
# define STACK_ALIGN_WORDS 1
|
||||
|
|
|
@ -82,7 +82,7 @@ static int save_struct_temp(mz_jit_state *jitter, int reg)
|
|||
jit_movr_p(JIT_V(3), reg);
|
||||
#endif
|
||||
#ifdef MZ_USE_JIT_I386
|
||||
# ifdef X86_ALIGN_STACK
|
||||
# ifdef JIT_X86_ALIGN_STACK
|
||||
mz_set_local_p(reg, JIT_LOCAL3);
|
||||
# else
|
||||
jit_pushr_p(reg);
|
||||
|
@ -101,7 +101,7 @@ static int restore_struct_temp(mz_jit_state *jitter, int reg)
|
|||
jit_movr_p(reg, JIT_V(3));
|
||||
#endif
|
||||
#ifdef MZ_USE_JIT_I386
|
||||
# ifdef X86_ALIGN_STACK
|
||||
# ifdef JIT_X86_ALIGN_STACK
|
||||
mz_get_local_p(reg, JIT_LOCAL3);
|
||||
# else
|
||||
jit_popr_p(reg);
|
||||
|
@ -1714,7 +1714,7 @@ int scheme_generate_struct_op(mz_jit_state *jitter, int kind, int for_branch,
|
|||
} else {
|
||||
mz_patch_ucbranch(bref_true);
|
||||
#ifdef MZ_USE_JIT_I386
|
||||
# ifndef X86_ALIGN_STACK
|
||||
# ifndef JIT_X86_ALIGN_STACK
|
||||
jit_popr_p(JIT_V1);
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -417,7 +417,7 @@ struct jit_local_state {
|
|||
/* Stack isn't used for arguments: */
|
||||
# define jit_prepare_i(ni) (_jitl.argssize = (ni), _jitl.argpushes = _jitl.argssize)
|
||||
#else
|
||||
# ifdef _CALL_DARWIN
|
||||
# if defined(_CALL_DARWIN) || defined(JIT_X86_ALIGN_STACK)
|
||||
/* Stack must stay 16-byte aligned: */
|
||||
# define jit_prepare_i(ni) (((ni & 0x3) \
|
||||
? SUBLir(4 * ((((ni) + 3) & ~(0x3)) - (ni)), JIT_SP) \
|
||||
|
|
Loading…
Reference in New Issue
Block a user