From 13c61fdc5b35b2a40a92f51126e0d8838ba15581 Mon Sep 17 00:00:00 2001 From: Geoff Norton Date: Fri, 6 Feb 2015 18:51:33 -0800 Subject: [PATCH] Remove the old version of DBG_CheckStackAlignment and make sure the assembly version is guarded on _DEBUG like the original --- src/pal/src/arch/i386/context.S | 2 ++ src/pal/src/arch/i386/context.cpp | 39 --------------------------------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/src/pal/src/arch/i386/context.S b/src/pal/src/arch/i386/context.S index b13de6d..440b8f2 100644 --- a/src/pal/src/arch/i386/context.S +++ b/src/pal/src/arch/i386/context.S @@ -1,3 +1,4 @@ +#if defined(_DEBUG) .text .globl _DBG_CheckStackAlignment @@ -13,3 +14,4 @@ _DBG_CheckStackAlignment: // Epilog popq %rbp ret +#endif diff --git a/src/pal/src/arch/i386/context.cpp b/src/pal/src/arch/i386/context.cpp index f9ff458..d52952e 100644 --- a/src/pal/src/arch/i386/context.cpp +++ b/src/pal/src/arch/i386/context.cpp @@ -1311,42 +1311,3 @@ DBG_FlushInstructionCache( // Intel x86 hardware has cache coherency, so nothing needs to be done. return TRUE; } - -#if _DEBUG && defined(__APPLE__) -/*++ -Function: - DBG_CheckStackAlignment - - The Apple ABI requires 16-byte alignment on the stack pointer. - This function interrupts otherwise. ---*/ -// Bullseye has parsing problems if "asm" comes after VOID - -#ifndef __llvm__ -asm -VOID -DBG_CheckStackAlignment() -{ -#ifdef _X86_ - // Prolog - at this point we are at aligned - 4 (for the call) - push ebp // aligned - 8 - mov ebp, esp - sub esp,STACK_ALIGN_REQ-8 // aligned (or should be) -#elif defined(_AMD64_) - // Prolog - at this point we are at aligned - 8 (for the call) - push rbp // aligned -16 - mov rbp, rsp -#else -#error Unexpected architecture. -#endif - - test esp,STACK_ALIGN_REQ-1 // can get away with esp even on AMD64. - jz .+3 - int 3 - - // Epilog - leave -} -#endif // !__llvm__ -#endif // DEBUG && APPLE - -- 2.7.4