mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Keep the stack from on darwin 16-byte aligned. This fixes many JIT
failres. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27973 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -59,8 +59,19 @@ extern "C" {
|
|||||||
"movl %esp, %ebp\n" // Standard prologue
|
"movl %esp, %ebp\n" // Standard prologue
|
||||||
"pushl %eax\n"
|
"pushl %eax\n"
|
||||||
"pushl %edx\n" // save EAX/EDX
|
"pushl %edx\n" // save EAX/EDX
|
||||||
#if defined(__CYGWIN__) || defined(__APPLE__)
|
#if defined(__CYGWIN__)
|
||||||
"call _X86CompilationCallback2\n"
|
"call _X86CompilationCallback2\n"
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
"movl 4(%ebp), %eax\n" // load the address of return address
|
||||||
|
"movl $24, %edx\n" // if the opcode of the instruction at the
|
||||||
|
"cmpb $-51, (%eax)\n" // return address is our 0xCD marker, then
|
||||||
|
"movl $12, %eax\n" // subtract 24 from %esp to realign it to 16
|
||||||
|
"cmovne %eax, %edx\n" // bytes after the push of edx, the amount to.
|
||||||
|
"subl %edx, %esp\n" // the push of edx to keep it aligned.
|
||||||
|
"pushl %edx\n" // subtract. Otherwise, subtract 12 bytes after
|
||||||
|
"call _X86CompilationCallback2\n"
|
||||||
|
"popl %edx\n"
|
||||||
|
"addl %edx, %esp\n"
|
||||||
#else
|
#else
|
||||||
"call X86CompilationCallback2\n"
|
"call X86CompilationCallback2\n"
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user